← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3785: exposed dataSet / group ids in json for dataElements/indicators

 

------------------------------------------------------------
revno: 3785
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-05-30 10:42:17 +0200
message:
  exposed dataSet / group ids in json for dataElements/indicators
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataElements.vm
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonIndicators.vm


--
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-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataElements.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataElements.vm	2011-05-16 14:21:57 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataElements.vm	2011-05-30 08:42:17 +0000
@@ -1,15 +1,19 @@
 #set( $size = $dataElements.size() )
 { "dataElements": [
 #foreach( $dataElement in $dataElements )
+#set( $groups = $dataElement.groups )
+#set( $dataSets = $dataElement.dataSets )
   {
-    "id":  ${dataElement.id} ,
-    "name": "$!encoder.jsonEncode( ${dataElement.name} )",
-    "alternativeName": "$!encoder.jsonEncode( ${dataElement.alternativeNamee} )",
-    "shortName": "$!encoder.jsonEncode( ${dataElement.shortName} )",
-    "code": "$!encoder.jsonEncode( ${dataElement.code} )",
-    "type": "$!{dataElement.type}",
-    "aggregationOperator": "$!{dataElement.aggregationOperator}",
-	"zeroIsSignificant": "$!{dataElement.zeroIsSignificant}"
+	"id":  ${dataElement.id} ,
+	"name": "$!encoder.jsonEncode( ${dataElement.name} )",
+	"alternativeName": "$!encoder.jsonEncode( ${dataElement.alternativeNamee} )",
+	"shortName": "$!encoder.jsonEncode( ${dataElement.shortName} )",
+	"code": "$!encoder.jsonEncode( ${dataElement.code} )",
+	"type": "$!{dataElement.type}",
+	"aggregationOperator": "$!{dataElement.aggregationOperator}",
+	"zeroIsSignificant": "$!{dataElement.zeroIsSignificant}",
+	"dataSets": [ #foreach( $dataSet in $dataSets )${dataSet.id}#if( $velocityCount < $dataSets.size() ),#end#end ],
+	"groups": [ #foreach( $group in $groups )${group.id}#if( $velocityCount < $groups.size() ),#end#end ]
   }#if( $velocityCount < $size ),#end
 #end
 ]

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonIndicators.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonIndicators.vm	2011-05-16 14:21:57 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonIndicators.vm	2011-05-30 08:42:17 +0000
@@ -1,6 +1,7 @@
 #set( $size = $indicators.size() )
 { "indicators": [
 #foreach( $indicator in $indicators )
+#set( $groups = $indicator.groups )
   {
     "id": $!{indicator.id},
     "name": "$!encoder.jsonEncode( ${indicator.name} )",
@@ -8,7 +9,8 @@
     "shortName": "$!encoder.jsonEncode( ${indicator.shortName} )",
     "code": "$!encoder.jsonEncode( ${indicator.code} )",
     "annualized": "${indicator.annualized}",
-    "indicatorTypeId": $!{indicator.indicatorType.id}
+    "indicatorTypeId": $!{indicator.indicatorType.id},
+    "groups": [ #foreach( $group in $groups )${group.id}#if( $velocityCount < $groups.size() ),#end#end ]
   }#if( $velocityCount < $size ),#end
 #end
 ]