← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2247: DataSet module - Dataset Assignment Editor - Removed unused method

 

------------------------------------------------------------
revno: 2247
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: trunk
timestamp: Mon 2010-09-27 15:17:04 +0700
message:
  DataSet module - Dataset Assignment Editor - Removed unused method
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/editor/SaveAssignMultiDataSetForOrgunitAction.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-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/editor/SaveAssignMultiDataSetForOrgunitAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/editor/SaveAssignMultiDataSetForOrgunitAction.java	2010-09-27 07:56:19 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/editor/SaveAssignMultiDataSetForOrgunitAction.java	2010-09-27 08:17:04 +0000
@@ -82,11 +82,8 @@
     public String execute()
         throws Exception
     {
-        Collection<OrganisationUnit> rootUnits = selectionTreeManager.getRootOrganisationUnits();
-
-        Set<OrganisationUnit> unitsInTheTree = new HashSet<OrganisationUnit>();
-
-        getUnitsInTheTree( rootUnits, unitsInTheTree );
+        Set<Source> selectedOrganisationUnits = convert( selectionTreeManager
+            .getReloadedSelectedOrganisationUnits() );
 
         for ( String dataSetId : selectedDataSets )
         {
@@ -94,16 +91,13 @@
 
             Set<Source> assignedSources = dataSet.getSources();
 
-            Collection<OrganisationUnit> selectedOrganisationUnits = selectionTreeManager
-                .getReloadedSelectedOrganisationUnits();
-
-            assignedSources.addAll( convert( selectedOrganisationUnits ) );
+            assignedSources.addAll( selectedOrganisationUnits );
 
             dataSet.setSources( assignedSources );
-            
+
             dataSetService.updateDataSet( dataSet );
         }
-        
+
         return SUCCESS;
     }
 
@@ -119,13 +113,4 @@
 
         return sources;
     }
-
-    private void getUnitsInTheTree( Collection<OrganisationUnit> rootUnits, Set<OrganisationUnit> unitsInTheTree )
-    {
-        for ( OrganisationUnit root : rootUnits )
-        {
-            unitsInTheTree.add( root );
-            getUnitsInTheTree( root.getChildren(), unitsInTheTree );
-        }
-    }
 }