← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16203: FormUtils, added property dataElementCount to section

 

------------------------------------------------------------
revno: 16203
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-07-21 14:05:04 +0200
message:
  FormUtils, added property dataElementCount to section
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/utils/FormUtils.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/utils/FormUtils.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/utils/FormUtils.java	2014-07-21 11:43:03 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/utils/FormUtils.java	2014-07-21 12:05:04 +0000
@@ -80,6 +80,7 @@
                 Group s = new Group();
                 s.setLabel( section.getDisplayName() );
                 s.setDescription( section.getDescription() );
+                s.setDataElementCount( section.getDataElements().size() );
                 s.setFields( fields );
                 form.getGroups().add( s );
             }
@@ -91,6 +92,7 @@
             Group s = new Group();
             s.setLabel( DataElementCategoryCombo.DEFAULT_CATEGORY_COMBO_NAME );
             s.setDescription( DataElementCategoryCombo.DEFAULT_CATEGORY_COMBO_NAME );
+            s.setDataElementCount( dataSet.getDataElements().size() );
             s.setFields( fields );
             form.getGroups().add( s );
         }

=== 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-07-21 11:43:03 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/webdomain/form/Group.java	2014-07-21 12:05:04 +0000
@@ -46,6 +46,8 @@
     private String label;
     
     private String description;
+    
+    private int dataElementCount;
 
     private List<Field> fields = new ArrayList<Field>();
 
@@ -77,6 +79,18 @@
         this.description = description;
     }
 
+    @JsonProperty
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    public int getDataElementCount()
+    {
+        return dataElementCount;
+    }
+    
+    public void setDataElementCount( int dataElementCount )
+    {
+        this.dataElementCount = dataElementCount;
+    }
+    
     @JsonProperty( value = "fields" )
     @JacksonXmlElementWrapper( localName = "fields", namespace = DxfNamespaces.DXF_2_0 )
     @JacksonXmlProperty( localName = "field", namespace = DxfNamespaces.DXF_2_0 )