← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2248: (GIS) Polygon layer restricted to polygon levels.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 2248 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2010-12-01 13:18:47 +0100
message:
  (GIS) Polygon layer restricted to polygon levels.
renamed:
  dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetOrganisationUnitLevelsAction.java => dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetAllOrganisationUnitLevelsAction.java
modified:
  dhis-2/dhis-web/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/index.html
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js
  dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetAllOrganisationUnitLevelsAction.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
=== renamed file 'dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetOrganisationUnitLevelsAction.java' => 'dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetAllOrganisationUnitLevelsAction.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetOrganisationUnitLevelsAction.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetAllOrganisationUnitLevelsAction.java	2010-12-01 12:16:51 +0000
@@ -38,7 +38,7 @@
  * @author Lars Helge Overland
  * @version $Id$
  */
-public class GetOrganisationUnitLevelsAction
+public class GetAllOrganisationUnitLevelsAction
     implements Action
 {
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml	2010-11-29 15:44:01 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml	2010-12-01 12:16:51 +0000
@@ -20,13 +20,20 @@
 
 	<!-- OrganisationUnit -->
 
-	<bean id="org.hisp.dhis.mapping.action.GetOrganisationUnitLevelsAction"
-		class="org.hisp.dhis.mapping.action.GetOrganisationUnitLevelsAction"
+	<bean id="org.hisp.dhis.mapping.action.GetAllOrganisationUnitLevelsAction"
+		class="org.hisp.dhis.mapping.action.GetAllOrganisationUnitLevelsAction"
 		scope="prototype">
 		<property name="organisationUnitService"
 			ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
 	</bean>
 
+    <bean id="org.hisp.dhis.mapping.action.GetOrganisationUnitLevelsByFeatureTypeAction"
+        class="org.hisp.dhis.mapping.action.GetOrganisationUnitLevelsByFeatureTypeAction"
+        scope="prototype">
+        <property name="organisationUnitService"
+            ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+    </bean>
+
 	<bean id="org.hisp.dhis.mapping.action.GetOrganisationUnitsAtLevelAction"
 		class="org.hisp.dhis.mapping.action.GetOrganisationUnitsAtLevelAction"
 		scope="prototype">

=== 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-11-29 15:44:01 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.xml	2010-12-01 12:16:51 +0000
@@ -40,12 +40,18 @@
 
 		<!-- OrganisationUnit -->
 
-		<action name="getOrganisationUnitLevels"
-			class="org.hisp.dhis.mapping.action.GetOrganisationUnitLevelsAction">
+		<action name="getAllOrganisationUnitLevels"
+			class="org.hisp.dhis.mapping.action.GetAllOrganisationUnitLevelsAction">
 			<result name="success" type="velocity-json">
 				/dhis-web-mapping/jsonOrganisationUnitLevels.vm</result>
 		</action>
 
+        <action name="getOrganisationUnitLevelsByFeatureType"
+            class="org.hisp.dhis.mapping.action.GetOrganisationUnitLevelsByFeatureTypeAction">
+            <result name="success" type="velocity-json">
+                /dhis-web-mapping/jsonOrganisationUnitLevels.vm</result>
+        </action>
+
 		<action name="getOrganisationUnitsAtLevel"
 			class="org.hisp.dhis.mapping.action.GetOrganisationUnitsAtLevelAction">
 			<result name="success" type="velocity-json">

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/index.html'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/index.html	2010-10-29 13:02:44 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/index.html	2010-12-01 12:16:51 +0000
@@ -91,4 +91,4 @@
         <script type="text/javascript" src="script/index.js"></script>    
 </body>
 
-</html>
\ No newline at end of file
+</html>

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js	2010-11-30 14:48:52 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js	2010-12-01 12:16:51 +0000
@@ -231,7 +231,30 @@
     });
     
 	var organisationUnitLevelStore = new Ext.data.JsonStore({
-        url: GLOBAL.conf.path_mapping + 'getOrganisationUnitLevels' + GLOBAL.conf.type,
+        url: GLOBAL.conf.path_mapping + 'getAllOrganisationUnitLevels' + GLOBAL.conf.type,
+        root: 'organisationUnitLevels',
+        fields: ['id', 'level', 'name'],
+        autoLoad: false,
+        isLoaded: false,
+        listeners: {
+            'load': function(store) {
+                store.isLoaded = true;
+                
+                if (!symbol.form.findField('level').getValue()) {
+					if (this.isLoaded) {
+						var data = this.getAt(this.getTotalCount()-1).data;
+						symbol.organisationUnitSelection.setValues(null, null, null, data.level, data.name);
+						symbol.form.findField('level').setValue(data.name);
+					}
+				}
+                // Ext.getCmp('level_cb').mode = 'local';
+            }
+        }
+    });
+    
+	var polygonOrganisationUnitLevelStore = new Ext.data.JsonStore({
+        url: GLOBAL.conf.path_mapping + 'getOrganisationUnitLevelsByFeatureType' + GLOBAL.conf.type,
+        baseParams: {featureType: GLOBAL.conf.map_feature_type_multipolygon},
         root: 'organisationUnitLevels',
         fields: ['id', 'level', 'name'],
         autoLoad: false,
@@ -348,6 +371,7 @@
         predefinedMapLegend: predefinedMapLegendStore,
         predefinedMapLegendSet: predefinedMapLegendSetStore,
         organisationUnitLevel: organisationUnitLevelStore,
+        polygonOrganisationUnitLevel: polygonOrganisationUnitLevelStore,
         organisationUnitsAtLevel: organisationUnitsAtLevelStore,
         geojsonFiles: geojsonFilesStore,
         wmsCapabilities: wmsCapabilitiesStore,
@@ -2081,7 +2105,7 @@
             Ext.getCmp('vectorlayeroptions_w').destroy();
         }
         
-        var data = [];        
+        var data = [];
         for (var i = 0; i < layer.features.length; i++) {
             data.push([layer.features[i].data.id || i, layer.features[i].data.name]);
         }

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js	2010-11-30 18:26:00 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js	2010-12-01 12:16:51 +0000
@@ -676,7 +676,7 @@
                                                         labelSeparator: GLOBAL.conf.labelseparator,
                                                         selectOnFocus: true,
                                                         width: GLOBAL.conf.combo_width,
-                                                        store: GLOBAL.stores.organisationUnitLevel,
+                                                        store: GLOBAL.stores.polygonOrganisationUnitLevel,
                                                         listeners: {
                                                             'select': {
                                                                 scope: this,