← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1787: (GIS) Reduced json filesize when assigning orgunits.

 

------------------------------------------------------------
revno: 1787
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: trunk
timestamp: Mon 2010-04-19 15:48:35 +0200
message:
  (GIS) Reduced json filesize when assigning orgunits.
added:
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonminMapOrganisationUnitRelations.vm
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonminOrganisationUnits.vm
modified:
  dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.xml


--
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-mapping/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.xml	2010-04-06 17:41:30 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.xml	2010-04-19 13:48:35 +0000
@@ -35,7 +35,7 @@
 		<action name="getOrganisationUnitsAtLevel"
 			class="org.hisp.dhis.mapping.action.GetOrganisationUnitsAtLevelAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-mapping/jsonOrganisationUnits.vm</result>
+				/dhis-web-mapping/jsonminOrganisationUnits.vm</result>
 		</action>
 
 		<!-- Map -->
@@ -132,7 +132,7 @@
 		<action name="getAvailableMapOrganisationUnitRelations"
 			class="org.hisp.dhis.mapping.action.GetAvailableMapOrganisationUnitRelationsAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-mapping/jsonMapOrganisationUnitRelations.vm</result>
+				/dhis-web-mapping/jsonminMapOrganisationUnitRelations.vm</result>
 		</action>
 
 		<action name="deleteMapOrganisationUnitRelationsByMap"

=== added file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonminMapOrganisationUnitRelations.vm'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonminMapOrganisationUnitRelations.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonminMapOrganisationUnitRelations.vm	2010-04-19 13:48:35 +0000
@@ -0,0 +1,1 @@
+#set( $size = $object.size() ){"mapOrganisationUnitRelations":[#foreach( $mapOrganisationUnitRelation in $object ){"id":"$!{mapOrganisationUnitRelation.id}","map":"$!encoder.jsEncode( ${mapOrganisationUnitRelation.map.mapLayerPath} )","organisationUnit":"$!encoder.jsEncode( ${mapOrganisationUnitRelation.organisationUnit.name} )","organisationUnitId":$!{mapOrganisationUnitRelation.organisationUnit.id},"featureId":"$!{mapOrganisationUnitRelation.featureId}"}#if( $velocityCount < $size ),#end#end]}
\ No newline at end of file

=== added file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonminOrganisationUnits.vm'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonminOrganisationUnits.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonminOrganisationUnits.vm	2010-04-19 13:48:35 +0000
@@ -0,0 +1,1 @@
+#set( $size = $object.size() ){"organisationUnits":[#foreach ( $unit in $object ){"id":"$!{unit.id}","name":"$!encoder.jsEncode( ${unit.name} )"}#if( $velocityCount < $size ),#end#end]}
\ No newline at end of file