diff --git a/dmp-backend/src/main/java/entities/UserInfo.java b/dmp-backend/src/main/java/entities/UserInfo.java index 3910d160e..7e4215dd8 100644 --- a/dmp-backend/src/main/java/entities/UserInfo.java +++ b/dmp-backend/src/main/java/entities/UserInfo.java @@ -34,7 +34,7 @@ import entities.security.UserAuth; @Entity @Table(name="\"UserInfo\"") @JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id") -public class UserInfo implements Serializable{ +public class UserInfo implements Serializable,DataEntity{ private static final long serialVersionUID = 1225151430484658395L; 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 067231b28..251093a12 100644 --- a/dmp-backend/src/main/java/entities/xmlmodels/viewstyledefinition/Field.java +++ b/dmp-backend/src/main/java/entities/xmlmodels/viewstyledefinition/Field.java @@ -137,7 +137,7 @@ public class Field implements DatabaseViewStyleDefinition,XmlSerializable Element dataElement = (Element)XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "data"); - this.data = new ModelBuilder().toFieldData(null, this.viewStyle.getRenderStyle()); + this.data = new ModelBuilder().toFieldData(null, this.viewStyle.getRenderStyle(),dataElement); if(this.data!=null)this.data.fromXml(dataElement); return this; } diff --git a/dmp-backend/src/main/java/models/admin/components/datasetprofile/Field.java b/dmp-backend/src/main/java/models/admin/components/datasetprofile/Field.java index faf7d97b3..f3ab4e576 100644 --- a/dmp-backend/src/main/java/models/admin/components/datasetprofile/Field.java +++ b/dmp-backend/src/main/java/models/admin/components/datasetprofile/Field.java @@ -124,7 +124,7 @@ public class Field implements ModelDefinition viewStylefields = new ModelBuilder().toViewStyleDefinition(this.fields, entities.xmlmodels.viewstyledefinition.Field.class); item.setFields(viewStylefields); diff --git a/dmp-backend/src/main/java/models/admin/components/datasetprofile/Group.java b/dmp-backend/src/main/java/models/admin/components/datasetprofile/Group.java index a39c04f32..e2f25f7af 100644 --- a/dmp-backend/src/main/java/models/admin/components/datasetprofile/Group.java +++ b/dmp-backend/src/main/java/models/admin/components/datasetprofile/Group.java @@ -86,7 +86,7 @@ public class Group implements ModelDefinition{ + private String url; + private Option autoCompleteOptions; + + @Override + public Element toXml(Document doc) { + Element root = super.toXml(doc); + + root.setAttribute("url", this.url); + + Element element = doc.createElement("option"); + element.setAttribute("label", this.autoCompleteOptions.getLabel()); + element.setAttribute("value", autoCompleteOptions.getValue()); + root.appendChild(element); + return root; + } + @Override + public AutoCompleteData fromXml(Element item) { + super.fromXml(item); + this.url = item.getAttribute("url"); + Element optionElement = (Element)item.getElementsByTagName("option").item(0); + + if(optionElement!=null){ + this.autoCompleteOptions = new Option(); + this.autoCompleteOptions.setLabel(optionElement.getAttribute("label")); + this.autoCompleteOptions.setValue(optionElement.getAttribute("value")); + } + return this; + } + @Override + public AutoCompleteData fromData(Object data) { + super.fromData(data); + this.autoCompleteOptions = new Option(); + if(data!=null){ + this.url = (String)((Map)data).get("url"); + Map options = ((Map>)data).get("option"); + this.autoCompleteOptions.setLabel(options.get("label")); + this.autoCompleteOptions.setValue(options.get("value")); + } + + return this; + } + @Override + public Object toData() { + // TODO Auto-generated method stub + return null; + } + + +} 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 258cc18b6..263b4f7c1 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 @@ -11,8 +11,8 @@ import org.w3c.dom.NodeList; import utilities.XmlSerializable; -public class ComboBoxData extends FieldData{ - private class Option implements XmlSerializable