argos/dmp-backend/src/main/java/models/admin/composite/DatasetProfile.java

40 lines
1.0 KiB
Java
Raw Normal View History

package models.admin.composite;
2017-11-27 14:40:16 +01:00
import utilities.builders.ModelBuilder;
import utilities.helpers.ModelBuilderCollector;
2017-11-27 14:40:16 +01:00
import java.util.List;
import models.admin.components.datasetprofile.*;
2017-11-27 14:40:16 +01:00
public class DatasetProfile {
2017-12-05 17:56:21 +01:00
private String label;
2017-11-27 14:40:16 +01:00
private List<Section> sections;
public List<Section> getSections() {
return sections;
}
public void setSections(List<Section> sections) {
this.sections = sections;
2017-12-05 17:56:21 +01:00
}
2017-12-05 17:56:21 +01:00
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public void buildProfile(entities.xmlmodels.modeldefinition.FieldGroup fieldGroup,entities.xmlmodels.viewstyledefinition.ViewStyleModel viewStyle){
this.sections = new ModelBuilder().fromViewStyleDefinition(viewStyle.getSections(), Section.class);
updateProfile(fieldGroup,viewStyle);
}
private void updateProfile(entities.xmlmodels.modeldefinition.FieldGroup fieldGroup,entities.xmlmodels.viewstyledefinition.ViewStyleModel viewStyle){
ModelBuilderCollector.mapSections(sections, fieldGroup.getFieldSets());
}
2017-11-27 14:40:16 +01:00
}