93 lines
2.7 KiB
Java
93 lines
2.7 KiB
Java
package models.user.components.datasetprofile;
|
|
|
|
import java.util.List;
|
|
|
|
import utilities.ModelDefinition;
|
|
import utilities.ViewStyleDefinition;
|
|
import utilities.builders.ModelBuilder;
|
|
|
|
public class Section implements ViewStyleDefinition<entities.xmlmodels.viewstyledefinition.Section>{
|
|
private List<Section> sections;
|
|
private List<Group> fieldGroups;
|
|
private Boolean defaultVisibility;
|
|
private int page;
|
|
private int ordinal;
|
|
private String id;
|
|
private String title;
|
|
private String description;
|
|
public List<Section> getSections() {
|
|
return sections;
|
|
}
|
|
public void setSections(List<Section> sections) {
|
|
this.sections = sections;
|
|
}
|
|
public List<Group> getFieldGroups() {
|
|
return fieldGroups;
|
|
}
|
|
public void setFieldGroups(List<Group> fieldGroups) {
|
|
this.fieldGroups = fieldGroups;
|
|
}
|
|
public Boolean getDefaultVisibility() {
|
|
return defaultVisibility;
|
|
}
|
|
public void setDefaultVisibility(Boolean defaultVisibility) {
|
|
this.defaultVisibility = defaultVisibility;
|
|
}
|
|
public int getPage() {
|
|
return page;
|
|
}
|
|
public void setPage(int page) {
|
|
this.page = page;
|
|
}
|
|
public String getId() {
|
|
return id;
|
|
}
|
|
public void setId(String id) {
|
|
this.id = id;
|
|
}
|
|
public String getTitle() {
|
|
return title;
|
|
}
|
|
public void setTitle(String title) {
|
|
this.title = title;
|
|
}
|
|
public String getDescription() {
|
|
return description;
|
|
}
|
|
public void setDescription(String description) {
|
|
this.description = description;
|
|
}
|
|
|
|
public int getOrdinal() {
|
|
return ordinal;
|
|
}
|
|
public void setOrdinal(int ordinal) {
|
|
this.ordinal = ordinal;
|
|
}
|
|
@Override
|
|
public entities.xmlmodels.viewstyledefinition.Section toDatabaseDefinition(entities.xmlmodels.viewstyledefinition.Section item) {
|
|
item.setDefaultVisibility(this.defaultVisibility);
|
|
item.setDescription(this.description);
|
|
if(this.fieldGroups!=null)item.setFieldGroups(new ModelBuilder().toViewStyleDefinition(this.fieldGroups, entities.xmlmodels.viewstyledefinition.FieldGroup.class));
|
|
item.setId(this.id);
|
|
item.setOrdinal(this.ordinal);
|
|
item.setPage(this.page);
|
|
if(this.sections!=null)item.setSections(new ModelBuilder().toViewStyleDefinition(this.sections, entities.xmlmodels.viewstyledefinition.Section.class));
|
|
item.setTitle(this.title);
|
|
return item;
|
|
}
|
|
@Override
|
|
public void fromDatabaseDefinition(entities.xmlmodels.viewstyledefinition.Section item) {
|
|
this.defaultVisibility = item.isDefaultVisibility();
|
|
this.description = item.getDescription();
|
|
this.fieldGroups = new ModelBuilder().fromViewStyleDefinition(item.getFieldGroups(),Group.class);
|
|
this.id = item.getId();
|
|
this.ordinal = item.getOrdinal();
|
|
this.page = item.getPage();
|
|
this.sections = new ModelBuilder().fromViewStyleDefinition(item.getSections(),Section.class);
|
|
this.title = item.getTitle();
|
|
}
|
|
|
|
|
|
}
|