← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1697: Improved deletionhandler for maplegendset

 

------------------------------------------------------------
revno: 1697
committer: Lars Helge Oeverland <larshelge@xxxxxxxxx>
branch nick: trunk
timestamp: Thu 2010-03-25 18:25:47 +0100
message:
  Improved deletionhandler for maplegendset
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/comparator/MapLegendComparator.java
  dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/MapLegendSetDeletionHandler.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DeletionHandler.java
  dhis-2/dhis-web/dhis-web-mapping/pom.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-api/src/main/java/org/hisp/dhis/mapping/comparator/MapLegendComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/comparator/MapLegendComparator.java	2010-03-25 16:43:52 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/comparator/MapLegendComparator.java	2010-03-25 17:25:47 +0000
@@ -31,20 +31,16 @@
 
 import org.hisp.dhis.mapping.MapLegend;
 
-
 /**
  * @author Tran Thanh Tri
  * @version $Id$
  */
-
-public class MapLegendComparator 
-	implements Comparator<MapLegend> 
+public class MapLegendComparator
+    implements Comparator<MapLegend>
 {
-
-	@Override
-	public int compare( MapLegend o1, MapLegend o2 ) 
-	{		
-		return o1.getStartValue().compareTo( o2.getStartValue() );
-	}
-
+    @Override
+    public int compare( MapLegend o1, MapLegend o2 )
+    {
+        return o1.getStartValue().compareTo( o2.getStartValue() );
+    }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/MapLegendSetDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/MapLegendSetDeletionHandler.java	2009-04-23 17:16:55 +0000
+++ dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/MapLegendSetDeletionHandler.java	2010-03-25 17:25:47 +0000
@@ -59,6 +59,18 @@
     }
     
     @Override
+    public void deleteMapLegend( MapLegend mapLegend )
+    {
+        for ( MapLegendSet legendSet : mappingService.getAllMapLegendSets() )
+        {
+            if ( legendSet.getMapLegends().remove( mapLegend ) )
+            {
+                mappingService.updateMapLegendSet( legendSet );
+            }
+        }
+    }
+    
+    @Override
     public void deleteIndicator( Indicator indicator )
     {
         for ( MapLegendSet legendSet : mappingService.getAllMapLegendSets() )

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DeletionHandler.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DeletionHandler.java	2010-02-22 09:19:15 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DeletionHandler.java	2010-03-25 17:25:47 +0000
@@ -51,6 +51,7 @@
 import org.hisp.dhis.indicator.IndicatorGroupSet;
 import org.hisp.dhis.indicator.IndicatorType;
 import org.hisp.dhis.mapping.Map;
+import org.hisp.dhis.mapping.MapLegend;
 import org.hisp.dhis.mapping.MapLegendSet;
 import org.hisp.dhis.mapping.MapOrganisationUnitRelation;
 import org.hisp.dhis.mapping.MapView;
@@ -445,6 +446,15 @@
         return true;
     }
     
+    public void deleteMapLegend( MapLegend mapLegend )
+    {
+    }
+    
+    public boolean allowDeleteMapLegend( MapLegend mapLegend )
+    {
+        return true;
+    }
+    
     public void deleteMapLegendSet( MapLegendSet mapLegendSet )
     {   
     }

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/pom.xml'
--- dhis-2/dhis-web/dhis-web-mapping/pom.xml	2010-03-25 11:32:49 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/pom.xml	2010-03-25 17:25:47 +0000
@@ -75,6 +75,9 @@
           <artifactId>xercesImpl</artifactId>
         </exclusion>
       </exclusions>
+<<<<<<< TREE
+    </dependency>	
+=======
     </dependency>
 	
 	<!-- JSON -->
@@ -86,6 +89,7 @@
 		<classifier>jdk15</classifier>
 	</dependency>
 	
+>>>>>>> MERGE-SOURCE
 	
 	<!-- Batik -->
 
@@ -169,8 +173,7 @@
 		<artifactId>batik-xml</artifactId>
 		<version>1.7</version>
 	</dependency>
-	
-  
+	  
   </dependencies>
 
   <repositories>