← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16033: minor updates to form xml

 

------------------------------------------------------------
revno: 16033
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-07-09 08:44:58 +0700
message:
  minor updates to form xml
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/webdomain/Forms.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/webdomain/form/Field.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/webdomain/form/Form.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/webdomain/form/Group.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/webdomain/Forms.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/webdomain/Forms.java	2014-07-07 07:29:24 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/webdomain/Forms.java	2014-07-09 01:44:58 +0000
@@ -32,6 +32,10 @@
 import java.util.List;
 import java.util.Map;
 
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import org.hisp.dhis.common.DxfNamespaces;
 import org.hisp.dhis.webapi.webdomain.form.Form;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
@@ -40,6 +44,7 @@
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
+@JacksonXmlRootElement( localName = "forms", namespace = DxfNamespaces.DXF_2_0 )
 public class Forms
 {
     // maps ou.uid => org unit.
@@ -54,7 +59,9 @@
     {
     }
 
-    @JsonProperty
+    @JsonProperty( value = "organisationUnits" )
+    @JacksonXmlElementWrapper( localName = "organisationUnits", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "organisationUnit", namespace = DxfNamespaces.DXF_2_0 )
     public Map<String, FormOrganisationUnit> getOrganisationUnits()
     {
         return organisationUnits;
@@ -65,7 +72,9 @@
         this.organisationUnits = organisationUnits;
     }
 
-    @JsonProperty
+    @JsonProperty( value = "forms" )
+    @JacksonXmlElementWrapper( localName = "forms", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "form", namespace = DxfNamespaces.DXF_2_0 )
     public Map<String, Form> getForms()
     {
         return forms;
@@ -76,7 +85,9 @@
         this.forms = forms;
     }
 
-    @JsonProperty
+    @JsonProperty( value = "optionSets" )
+    @JacksonXmlElementWrapper( localName = "optionSets", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "optionSet", namespace = DxfNamespaces.DXF_2_0 )
     public Map<String, List<String>> getOptionSets()
     {
         return optionSets;

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/webdomain/form/Field.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/webdomain/form/Field.java	2014-07-07 02:11:52 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/webdomain/form/Field.java	2014-07-09 01:44:58 +0000
@@ -29,10 +29,14 @@
  */
 
 import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import org.hisp.dhis.common.DxfNamespaces;
 
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
+@JacksonXmlRootElement( localName = "field", namespace = DxfNamespaces.DXF_2_0 )
 public class Field
 {
     private String label;
@@ -54,6 +58,7 @@
     }
 
     @JsonProperty
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getLabel()
     {
         return label;
@@ -65,6 +70,7 @@
     }
 
     @JsonProperty
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getDataElement()
     {
         return dataElement;
@@ -76,6 +82,7 @@
     }
 
     @JsonProperty
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getCategoryOptionCombo()
     {
         return categoryOptionCombo;
@@ -87,6 +94,7 @@
     }
 
     @JsonProperty
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getValue()
     {
         return value;
@@ -98,6 +106,7 @@
     }
 
     @JsonProperty
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public InputType getType()
     {
         return type;
@@ -109,6 +118,7 @@
     }
 
     @JsonProperty
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getOptionSet()
     {
         return optionSet;
@@ -120,6 +130,7 @@
     }
 
     @JsonProperty
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public Integer getSortOrder()
     {
         return sortOrder;

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/webdomain/form/Form.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/webdomain/form/Form.java	2014-07-02 15:01:59 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/webdomain/form/Form.java	2014-07-09 01:44:58 +0000
@@ -29,8 +29,11 @@
  */
 
 import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import org.hisp.dhis.common.DxfNamespaces;
 
-import javax.xml.bind.annotation.XmlRootElement;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -39,7 +42,7 @@
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
-@XmlRootElement(name = "form")
+@JacksonXmlRootElement( localName = "form", namespace = DxfNamespaces.DXF_2_0 )
 public class Form
 {
     private String label;
@@ -55,6 +58,7 @@
     }
 
     @JsonProperty
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getLabel()
     {
         return label;
@@ -66,6 +70,7 @@
     }
 
     @JsonProperty
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getSubtitle()
     {
         return subtitle;
@@ -76,7 +81,9 @@
         this.subtitle = subtitle;
     }
     
-    @JsonProperty
+    @JsonProperty( value = "groups" )
+    @JacksonXmlElementWrapper( localName = "groups", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "group", namespace = DxfNamespaces.DXF_2_0 )
     public List<Group> getGroups()
     {
         return groups;
@@ -88,6 +95,7 @@
     }
 
     @JsonProperty
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public Map<String, Object> getOptions()
     {
         return options;

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/webdomain/form/Group.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/webdomain/form/Group.java	2014-05-22 12:40:24 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/webdomain/form/Group.java	2014-07-09 01:44:58 +0000
@@ -29,6 +29,10 @@
  */
 
 import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import org.hisp.dhis.common.DxfNamespaces;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -36,6 +40,7 @@
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
+@JacksonXmlRootElement( localName = "group", namespace = DxfNamespaces.DXF_2_0 )
 public class Group
 {
     private String label;
@@ -47,6 +52,7 @@
     }
 
     @JsonProperty
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getLabel()
     {
         return label;
@@ -57,7 +63,9 @@
         this.label = label;
     }
 
-    @JsonProperty
+    @JsonProperty( value = "fields" )
+    @JacksonXmlElementWrapper( localName = "fields", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "field", namespace = DxfNamespaces.DXF_2_0 )
     public List<Field> getFields()
     {
         return fields;