← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1894: Removed the cut and append random number to orgunit shortname on dhis 14 file import

 

------------------------------------------------------------
revno: 1894
committer: Lars <larshelg@larshelg-laptop>
branch nick: trunk
timestamp: Tue 2010-08-03 13:34:19 +0200
message:
  Removed the cut and append random number to orgunit shortname on dhis 14 file import
modified:
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/file/rowhandler/OrganisationUnitRowHandler.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/manager/DefaultSelectionTreeManager.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-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/file/rowhandler/OrganisationUnitRowHandler.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/file/rowhandler/OrganisationUnitRowHandler.java	2010-05-29 16:06:56 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/file/rowhandler/OrganisationUnitRowHandler.java	2010-08-03 11:34:19 +0000
@@ -35,7 +35,6 @@
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.source.Source;
-import org.hisp.dhis.system.util.MathUtils;
 import org.hisp.dhis.system.util.UUIdUtils;
 
 import com.ibatis.sqlmap.client.event.RowHandler;
@@ -78,11 +77,6 @@
         
         unit.setUuid( UUIdUtils.getUUId() );
         
-        if ( unit.getShortName() != null && unit.getShortName().length() > 30 )
-        {
-            unit.setShortName( unit.getShortName().substring( 30 ) + MathUtils.getRandom() );
-        }
-            
         if ( unit.getCode() != null && unit.getCode().trim().length() == 0 )
         {
             unit.setCode( null );                

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/manager/DefaultSelectionTreeManager.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/manager/DefaultSelectionTreeManager.java	2010-05-18 14:32:23 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/manager/DefaultSelectionTreeManager.java	2010-08-03 11:34:19 +0000
@@ -51,7 +51,7 @@
 
     private static final String SESSION_KEY_ROOT_ORG_UNITS = "dhis-oust-root-org-units";
     
-    private static final double PERCENTAGE_OF_MULTIPLE_RELOADING_ORG_UNITS = 0.3;
+    private static final double PERCENTAGE_OF_MULTIPLE_RELOADING_ORG_UNITS = 0.2;
 
     // -------------------------------------------------------------------------
     // Dependencies
@@ -310,18 +310,19 @@
         
         int noSelected = units.size();
 
-        if ( (double) noSelected / noTotal > PERCENTAGE_OF_MULTIPLE_RELOADING_ORG_UNITS )
+        if ( (double) noSelected / noTotal > PERCENTAGE_OF_MULTIPLE_RELOADING_ORG_UNITS ) // Select all at once
         {
             Collection<OrganisationUnit> allOrgUnits = organisationUnitService.getAllOrganisationUnits();
-            for ( OrganisationUnit each : allOrgUnits )
+            
+            for ( OrganisationUnit unit : allOrgUnits )
             {
-                if ( units.contains( each ) )
+                if ( units.contains( unit ) )
                 {
-                    reloadedUnits.add( each );
+                    reloadedUnits.add( unit );
                 }
             }
         }
-        else
+        else // Select one by one
         {
             for ( OrganisationUnit unit : units )
             {