← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 202: Fixed json encoding bug. Added index action

 

------------------------------------------------------------
revno: 202
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Mon 2009-04-20 18:24:17 +0200
message:
  Fixed json encoding bug. Added index action
modified:
  gis/dhis-web-mapping/src/main/resources/xwork.xml
  gis/dhis-web-mapping/src/main/webapp/demos/geostat/geostat.js
  gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonIndicatorGroups.vm
  gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonMap.vm
  gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonMapOrganisationUnitRelations.vm
  gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonOrganisationUnitLevels.vm
  gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonOrganisationUnits.vm
  gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonPeriodTypes.vm
  gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonminIndicators.vm
  gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonminMaps.vm

=== modified file 'gis/dhis-web-mapping/src/main/resources/xwork.xml'
--- gis/dhis-web-mapping/src/main/resources/xwork.xml	2009-04-17 22:18:50 +0000
+++ gis/dhis-web-mapping/src/main/resources/xwork.xml	2009-04-20 16:24:17 +0000
@@ -7,11 +7,10 @@
   <package name="dhis-web-mapping" extends="dhis-web-commons"
     namespace="/dhis-web-mapping">
         
-    <!-- No -->
+    <!-- Default -->
   
     <action name="index" class="org.hisp.dhis.mapping.action.NoAction">
-      <result name="success" type="velocity">/main.vm</result>
-      <param name="page">/dhis-web-mapping/index.vm</param>
+      <result name="success" type="redirect">../demos/geostat/index.html</result>
     </action>
     
     <!-- OrganisationUnit -->

=== modified file 'gis/dhis-web-mapping/src/main/webapp/demos/geostat/geostat.js'
--- gis/dhis-web-mapping/src/main/webapp/demos/geostat/geostat.js	2009-04-17 23:00:32 +0000
+++ gis/dhis-web-mapping/src/main/webapp/demos/geostat/geostat.js	2009-04-20 16:24:17 +0000
@@ -72,7 +72,7 @@
     map.setCenter(new OpenLayers.LonLat(init_longitude, init_latitude), init_zoom); // config.js
     
     organisationUnitLevelStore = new Ext.data.JsonStore({
-        url: 'getOrganisationUnitLevels.action',
+        url: 'dhis-web-mapping/getOrganisationUnitLevels.action',
         baseParams: { format: 'json' },
         root: 'organisationUnitLevels',
         fields: ['id', 'level', 'name'],

=== modified file 'gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonIndicatorGroups.vm'
--- gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonIndicatorGroups.vm	2009-04-17 21:35:32 +0000
+++ gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonIndicatorGroups.vm	2009-04-20 16:24:17 +0000
@@ -3,7 +3,7 @@
 #foreach( $indicatorGroup in $object )
   {
     "id": $!{indicatorGroup.id},
-    "name": "$!{indicatorGroup.name}",
+    "name": "$!encoder.jsEncode( ${indicatorGroup.name} )",
   }#if( $velocityCount < $size ),#end
 #end
 ] }
\ No newline at end of file

=== modified file 'gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonMap.vm'
--- gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonMap.vm	2009-04-17 21:35:32 +0000
+++ gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonMap.vm	2009-04-20 16:24:17 +0000
@@ -1,13 +1,13 @@
 { "map": 
   {
     "id": $!{object.id},
-    "mapLayerPath": "$!encoder.jsonEncode( ${object.mapLayerPath} )",
-    "organisationUnit": "$!encoder.jsonEncode( ${object.organisationUnit.name} )",
+    "mapLayerPath": "$!encoder.jsEncode( ${object.mapLayerPath} )",
+    "organisationUnit": "$!encoder.jsEncode( ${object.organisationUnit.name} )",
     "organisationUnitLevel": $!{object.organisationUnitLevel.level},
-    "uniqueColumn": "$!encoder.jsonEncode( ${object.uniqueColumn} )",
-    "nameColumn": "$!encoder.jsonEncode( ${object.nameColumn} )",
-    "longitude": "$!encoder.jsonEncode( ${object.longitude} )",
-    "latitude": "$!encoder.jsonEncode( ${object.latitude} )",
+    "uniqueColumn": "$!encoder.jsEncode( ${object.uniqueColumn} )",
+    "nameColumn": "$!encoder.jsEncode( ${object.nameColumn} )",
+    "longitude": "$!encoder.jsEncode( ${object.longitude} )",
+    "latitude": "$!encoder.jsEncode( ${object.latitude} )",
     "zoom": $!{object.zoom}
   }
 }
\ No newline at end of file

=== modified file 'gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonMapOrganisationUnitRelations.vm'
--- gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonMapOrganisationUnitRelations.vm	2009-04-17 21:35:32 +0000
+++ gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonMapOrganisationUnitRelations.vm	2009-04-20 16:24:17 +0000
@@ -3,8 +3,8 @@
 #foreach( $mapOrganisationUnitRelation in $object )
   {
     "id": $!{mapOrganisationUnitRelation.id},
-    "map": "$!encoder.jsonEncode( ${mapOrganisationUnitRelation.map.mapLayerPath} )",
-    "organisationUnit": "$!encoder.jsonEncode( ${mapOrganisationUnitRelation.organisationUnit.name} )",
+    "map": "$!encoder.jsEncode( ${mapOrganisationUnitRelation.map.mapLayerPath} )",
+    "organisationUnit": "$!encoder.jsEncode( ${mapOrganisationUnitRelation.organisationUnit.name} )",
     "organisationUnitId": $!{mapOrganisationUnitRelation.organisationUnit.id},
     "featureId": "$!{mapOrganisationUnitRelation.featureId}"
   }#if( $velocityCount < $size ),#end

=== modified file 'gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonOrganisationUnitLevels.vm'
--- gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonOrganisationUnitLevels.vm	2009-04-07 13:22:12 +0000
+++ gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonOrganisationUnitLevels.vm	2009-04-20 16:24:17 +0000
@@ -4,7 +4,7 @@
   {
     "id": $!{level.id},
     "level": $!{level.level},
-    "name": "$!{level.name}"
+    "name": "$!encoder.jsEncode( ${level.name} )"
   }#if( $velocityCount < $size ),#end
 #end
 ] }
\ No newline at end of file

=== modified file 'gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonOrganisationUnits.vm'
--- gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonOrganisationUnits.vm	2009-04-17 21:35:32 +0000
+++ gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonOrganisationUnits.vm	2009-04-20 16:24:17 +0000
@@ -3,13 +3,13 @@
 #foreach ( $unit in $object )
   {
     "id": $!{unit.id},
-    "name": "$!{unit.name}",
-    "shortName": "$!{unit.shortName}",
-    "code": "$!{unit.code}",
+    "name": "$!encoder.jsEncode( ${unit.name} )",
+    "shortName": "$!encoder.jsEncode( ${unit.shortName} )",
+    "code": "$!encoder.jsEncode( ${unit.code} )",
     "openingDate": "$!{unit.openingDate}",
     "closedDate": "$!{unit.closedDate}",
     "active": "$!{unit.active}",
-    "comment": "$!{unit.comment}",
+    "comment": "$!encoder.jsEncode( ${unit.comment} )",
     "geoCode": "$!{unit.geoCode}",
     "latitude": "$!{unit.latitude}",
     "longitude": "$!{unit.longitude}"

=== modified file 'gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonPeriodTypes.vm'
--- gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonPeriodTypes.vm	2009-04-17 21:35:32 +0000
+++ gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonPeriodTypes.vm	2009-04-20 16:24:17 +0000
@@ -3,7 +3,7 @@
 #foreach( $periodType in $object )
   {
     "id": $!{periodType.id},
-    "name": "$!{periodType.name}"
+    "name": "$!encoder.jsEncode( ${periodType.name} )"
   }#if( $velocityCount < $size ),#end
 #end
 ] }

=== modified file 'gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonminIndicators.vm'
--- gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonminIndicators.vm	2009-04-17 21:35:32 +0000
+++ gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonminIndicators.vm	2009-04-20 16:24:17 +0000
@@ -3,7 +3,7 @@
 #foreach( $indicator in $object )
   {
     "id": $!{indicator.id},
-    "name": "$!encoder.jsonEncode( ${indicator.name} )"
+    "name": "$!encoder.jsEncode( ${indicator.name} )"
   }#if( $velocityCount < $size ),#end
 #end
 ] }
\ No newline at end of file

=== modified file 'gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonminMaps.vm'
--- gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonminMaps.vm	2009-04-17 21:35:32 +0000
+++ gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonminMaps.vm	2009-04-20 16:24:17 +0000
@@ -3,8 +3,7 @@
 #foreach( $map in $object )
   {
     "id": $!{map.id},
-    "mapLayerPath": "$!encoder.jsonEncode( ${map.mapLayerPath} )",
+    "mapLayerPath": "$!encoder.jsEncode( ${map.mapLayerPath} )",
     "organisationUnitLevel": $!{map.organisationUnitLevel.level}
   }#if( $velocityCount < $size ),#end
 #end
-] }
\ No newline at end of file



--
Trunk
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.