← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12715: PNG map, fixed bug related to data element operands

 

------------------------------------------------------------
revno: 12715
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-10-16 12:26:51 +0200
message:
  PNG map, fixed bug related to data element operands
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapView.java
  dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/GeoToolsMapGenerationService.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-api/src/main/java/org/hisp/dhis/mapping/MapView.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapView.java	2013-10-16 08:49:41 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapView.java	2013-10-16 10:26:51 +0000
@@ -170,8 +170,20 @@
     @Override
     public String getName()
     {
-        return ( indicators != null && !indicators.isEmpty() ) ? indicators.get( 0 ).getName() : 
-            ( dataElements != null && !dataElements.isEmpty() ) ? dataElements.get( 0 ).getName() : uid;
+        if ( indicators != null && !indicators.isEmpty() )
+        {
+            return indicators.get( 0 ).getName();
+        }
+        else if ( dataElements != null && !dataElements.isEmpty() )
+        {
+            return dataElements.get( 0 ).getName();
+        }
+        else if ( dataElementOperands != null && !dataElementOperands.isEmpty() )
+        {
+            return dataElementOperands.get( 0 ).getName();
+        }
+        
+        return uid;
     }
     
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/GeoToolsMapGenerationService.java'
--- dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/GeoToolsMapGenerationService.java	2013-10-16 09:44:07 +0000
+++ dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/GeoToolsMapGenerationService.java	2013-10-16 10:26:51 +0000
@@ -326,8 +326,11 @@
         {
             if ( row != null && row.size() >= 3 )
             {
-                String ou = (String) row.get( 1 );
-                Double value = (Double) row.get( ( row.size() - 1 ) );
+                int ouIndex = row.size() - 2;
+                int valueIndex = row.size() - 1;
+                
+                String ou = (String) row.get( ouIndex );
+                Double value = (Double) row.get( ( valueIndex ) );
                 
                 mapValues.add( new MapValue( ou, value ) );
             }