diff --git a/dmp-backend/src/main/java/entities/xmlmodels/viewstyledefinition/Field.java b/dmp-backend/src/main/java/entities/xmlmodels/viewstyledefinition/Field.java index 30e911ac8..529c48581 100644 --- a/dmp-backend/src/main/java/entities/xmlmodels/viewstyledefinition/Field.java +++ b/dmp-backend/src/main/java/entities/xmlmodels/viewstyledefinition/Field.java @@ -89,12 +89,16 @@ public class Field implements DatabaseViewStyleDefinition,XmlSerializable Element description = doc.createElement("description"); description.setTextContent(this.description); + Element title = doc.createElement("title"); + title.setTextContent(this.title); + Element viewStyle = doc.createElement("viewStyle"); viewStyle.setAttribute("renderstyle", this.viewStyle.getRenderStyle()); viewStyle.setAttribute("cssClass", this.viewStyle.getCssClass()); Element visibility = this.visible.toXml(doc); + rootElement.appendChild(title); rootElement.appendChild(visibility); rootElement.appendChild(extendedDescription); rootElement.appendChild(viewStyle); @@ -114,6 +118,9 @@ public class Field implements DatabaseViewStyleDefinition,XmlSerializable Element description = (Element)element.getElementsByTagName("description").item(0); this.description = description.getTextContent(); + Element title = (Element)element.getElementsByTagName("title").item(0); + this.title = title.getTextContent(); + this.viewStyle = new ViewStyle(); Element viewStyle = (Element)element.getElementsByTagName("viewStyle").item(0); this.viewStyle.setRenderStyle(viewStyle.getAttribute("renderstyle")); diff --git a/dmp-backend/src/main/java/entities/xmlmodels/viewstyledefinition/FieldGroup.java b/dmp-backend/src/main/java/entities/xmlmodels/viewstyledefinition/FieldGroup.java index c61ce0584..1fad73e63 100644 --- a/dmp-backend/src/main/java/entities/xmlmodels/viewstyledefinition/FieldGroup.java +++ b/dmp-backend/src/main/java/entities/xmlmodels/viewstyledefinition/FieldGroup.java @@ -10,6 +10,7 @@ import org.w3c.dom.NodeList; import entities.xmlmodels.modeldefinition.DatabaseModelDefinition; import utilities.XmlSerializable; +import utilities.builders.XmlBuilder; public class FieldGroup implements DatabaseViewStyleDefinition,XmlSerializable{ private String id; @@ -97,6 +98,9 @@ public class FieldGroup implements DatabaseViewStyleDefinition,XmlSerializable{ private String id; @@ -91,6 +92,9 @@ public class Section implements DatabaseViewStyleDefinition,XmlSerializable(); Element sections = (Element)element.getElementsByTagName("sections").item(0); diff --git a/dmp-backend/src/main/java/managers/AdminManager.java b/dmp-backend/src/main/java/managers/AdminManager.java index b47e31adc..998bceca6 100644 --- a/dmp-backend/src/main/java/managers/AdminManager.java +++ b/dmp-backend/src/main/java/managers/AdminManager.java @@ -33,7 +33,7 @@ public class AdminManager { entities.DatasetProfile datasetProfile = new entities.DatasetProfile(); datasetProfile.setDefinition(xml); datasetProfile.setStatus((short)1); - datasetProfile.setLabel("dasd"); + datasetProfile.setLabel(profile.getLabel()); datasetProfile.setCreated(new Date()); return datasetProfile; } @@ -48,7 +48,7 @@ public class AdminManager { DatasetProfileViewstyle datasetProfileViewstyle = new DatasetProfileViewstyle(); datasetProfileViewstyle.setDefinition(xml); - datasetProfileViewstyle.setLabel("skdjal"); + datasetProfileViewstyle.setLabel(profile.getLabel()); return datasetProfileViewstyle; } diff --git a/dmp-backend/src/main/java/models/admin/composite/DatasetProfile.java b/dmp-backend/src/main/java/models/admin/composite/DatasetProfile.java index 9c613bae6..cd39aab47 100644 --- a/dmp-backend/src/main/java/models/admin/composite/DatasetProfile.java +++ b/dmp-backend/src/main/java/models/admin/composite/DatasetProfile.java @@ -8,6 +8,7 @@ import java.util.List; import models.admin.components.datasetprofile.*; public class DatasetProfile { + private String label; private List
sections; public List
getSections() { @@ -16,9 +17,16 @@ public class DatasetProfile { public void setSections(List
sections) { this.sections = sections; - } - + } + 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); diff --git a/dmp-backend/src/main/java/models/components/commons/datafield/CheckBoxData.java b/dmp-backend/src/main/java/models/components/commons/datafield/CheckBoxData.java index aea083a39..8f37abb4d 100644 --- a/dmp-backend/src/main/java/models/components/commons/datafield/CheckBoxData.java +++ b/dmp-backend/src/main/java/models/components/commons/datafield/CheckBoxData.java @@ -1,27 +1,42 @@ package models.components.commons.datafield; +import java.util.Map; + import org.w3c.dom.Document; import org.w3c.dom.Element; import utilities.XmlSerializable; public class CheckBoxData extends FieldData{ + private String label; + + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } @Override public Element toXml(Document doc) { - // TODO Auto-generated method stub - return doc.createElement("data"); + Element root = doc.createElement("data"); + root.setAttribute("label", this.label); + return root; } @Override public CheckBoxData fromXml(Element item) { - // TODO Auto-generated method stub + this.label = item!=null?item.getAttribute("label"):""; //TODO return this; } @Override public CheckBoxData fromData(Object data) { - // TODO Auto-generated method stub + if(data!=null){ + this.label= (String)((Map)data).get("label"); + } return this; } diff --git a/dmp-backend/src/main/java/models/components/commons/datafield/ComboBoxData.java b/dmp-backend/src/main/java/models/components/commons/datafield/ComboBoxData.java index 8ba4a7c82..258cc18b6 100644 --- a/dmp-backend/src/main/java/models/components/commons/datafield/ComboBoxData.java +++ b/dmp-backend/src/main/java/models/components/commons/datafield/ComboBoxData.java @@ -102,11 +102,22 @@ public class ComboBoxData extends FieldData{ } @Override public ComboBoxData fromData(Object data) { + this.options = new LinkedList(); + if(data!=null){ this.type = (String)((Map)data).get("type"); this.url = (String)((Map)data).get("url"); - this.options = (List