← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15072: Replaced OrganisationUnitService.getLevelOfOrganisationUnit( String ) with getLevelOfOrganisation...

 

------------------------------------------------------------
revno: 15072
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-04-28 20:23:49 +0200
message:
  Replaced OrganisationUnitService.getLevelOfOrganisationUnit( String ) with getLevelOfOrganisationUnit( int )
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitService.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultQueryPlanner.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventQueryPlanner.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DataApprovalSelection.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataapproval/action/GetCategoryOptionGroupsAction.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/organisationunit/OrganisationUnitService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitService.java	2014-04-28 18:13:09 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitService.java	2014-04-28 18:23:49 +0000
@@ -217,13 +217,6 @@
     int getLevelOfOrganisationUnit( int id );
 
     /**
-     * Returns the level of the organisation unit with the given uid.
-     *
-     * @return the level of the organisation unit with the given uid.
-     */
-    int getLevelOfOrganisationUnit( String uid );
-
-    /**
      * Returns all OrganisationUnits which are part of the subtree of the
      * OrganisationUnit with the given identifier and have no children.
      *

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultQueryPlanner.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultQueryPlanner.java	2014-04-21 16:49:12 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultQueryPlanner.java	2014-04-28 18:23:49 +0000
@@ -619,7 +619,7 @@
         {
             OrganisationUnit ou = (OrganisationUnit) orgUnit;
             
-            int level = ou.getLevel() != 0 ? ou.getLevel() : organisationUnitService.getLevelOfOrganisationUnit( ou.getUid() );
+            int level = ou.getLevel() != 0 ? ou.getLevel() : organisationUnitService.getLevelOfOrganisationUnit( ou.getId() );
             
             map.putValue( level, orgUnit );
         }

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java	2014-04-21 14:52:46 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java	2014-04-28 18:23:49 +0000
@@ -372,7 +372,7 @@
             for ( NameableObject object : params.getDimensionOrFilter( ORGUNIT_DIM_ID ) )
             {
                 OrganisationUnit unit = (OrganisationUnit) object;
-                unit.setLevel( organisationUnitService.getLevelOfOrganisationUnit( unit.getUid() ) );
+                unit.setLevel( organisationUnitService.getLevelOfOrganisationUnit( unit.getId() ) );
             }
         }
 

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventQueryPlanner.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventQueryPlanner.java	2014-04-21 14:52:46 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventQueryPlanner.java	2014-04-28 18:23:49 +0000
@@ -177,7 +177,7 @@
             for ( NameableObject object : params.getDimensionOrFilter( DimensionalObject.ORGUNIT_DIM_ID ) )
             {
                 OrganisationUnit unit = (OrganisationUnit) object; 
-                unit.setLevel( organisationUnitService.getLevelOfOrganisationUnit( unit.getUid() ) );
+                unit.setLevel( organisationUnitService.getLevelOfOrganisationUnit( unit.getId() ) );
             }
         }
         

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DataApprovalSelection.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DataApprovalSelection.java	2014-04-28 14:48:54 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DataApprovalSelection.java	2014-04-28 18:23:49 +0000
@@ -163,7 +163,7 @@
     {
         organisationUnitLevel = organisationUnit.getLevel() != 0 ?
             organisationUnit.getLevel() :
-            organisationUnitService.getLevelOfOrganisationUnit( organisationUnit.getUid() );
+            organisationUnitService.getLevelOfOrganisationUnit( organisationUnit.getId() );
 
         log.debug( logSelection() + " starting." );
 

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java	2014-04-28 18:13:09 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java	2014-04-28 18:23:49 +0000
@@ -257,11 +257,6 @@
         return getOrganisationUnit( id ).getOrganisationUnitLevel();
     }
 
-    public int getLevelOfOrganisationUnit( String uid )
-    {
-        return getOrganisationUnit( uid ).getOrganisationUnitLevel();
-    }
-
     public Collection<OrganisationUnit> getLeafOrganisationUnits( int id )
     {
         Collection<OrganisationUnit> units = getOrganisationUnitWithChildren( id );

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataapproval/action/GetCategoryOptionGroupsAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataapproval/action/GetCategoryOptionGroupsAction.java	2014-04-20 16:02:32 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataapproval/action/GetCategoryOptionGroupsAction.java	2014-04-28 18:23:49 +0000
@@ -40,6 +40,7 @@
 import org.hisp.dhis.dataelement.CategoryOptionGroupSet;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
 import org.hisp.dhis.i18n.I18n;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.system.util.Filter;
 import org.hisp.dhis.system.util.FilterUtils;
@@ -103,7 +104,9 @@
     {
         if ( ou != null )
         {
-            int orgUnitLevel = organisationUnitService.getLevelOfOrganisationUnit( ou );
+            OrganisationUnit unit = organisationUnitService.getOrganisationUnit( ou );
+            
+            int orgUnitLevel = organisationUnitService.getLevelOfOrganisationUnit( unit.getId() );
             
             List<DataApprovalLevel> approvalLevels = approvalLevelService.getUserDataApprovalLevels();