← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17333: Approval, removed unused method

 

------------------------------------------------------------
revno: 17333
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2014-11-02 08:30:47 -0500
message:
  Approval, removed unused method
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalLevelService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DefaultDataApprovalLevelService.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/dataapproval/DataApprovalLevelService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalLevelService.java	2014-10-31 15:23:23 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalLevelService.java	2014-11-02 13:30:47 +0000
@@ -32,7 +32,6 @@
 import java.util.Map;
 import java.util.Set;
 
-import org.hisp.dhis.dataelement.DataElementCategoryOption;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitLevel;
@@ -98,21 +97,19 @@
     DataApprovalLevel getLowestDataApprovalLevel( OrganisationUnit orgUnit, DataElementCategoryOptionCombo attributeOptionCombo );
 
     /**
-     * Gets the lowest approval level for a given attribute option (for
-     * any possible organisation unit.)
-     *
-     * @param option option (if any) that may belong to an approval level.
-     * @return lowest approval level that could contain the option.
-     */
-    DataApprovalLevel getLowestOptionApprovalLevel( DataElementCategoryOption option );
-
-    /**
      * Gets a list of all data approval levels.
      *
-     * @return List of all data approval levels, ordered from 1 to n.
+     * @return list of all data approval levels, ordered from 1 to n.
      */
     List<DataApprovalLevel> getAllDataApprovalLevels();
     
+    /**
+     * Gets a mapping of all data approval levels between level number and approval
+     * level.
+     * 
+     * @return map of all data approval levels between level number and approval
+     * level.
+     */
     Map<Integer, DataApprovalLevel> getDataApprovalLevelMap();
     
     List<DataApprovalLevel> getUserDataApprovalLevels();

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DefaultDataApprovalLevelService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DefaultDataApprovalLevelService.java	2014-10-25 21:58:41 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DefaultDataApprovalLevelService.java	2014-11-02 13:30:47 +0000
@@ -208,35 +208,6 @@
     }
 
     @Override
-    public DataApprovalLevel getLowestOptionApprovalLevel( DataElementCategoryOption option )
-    {
-        Set<CategoryOptionGroupSet> cogSets = null;
-
-        if ( option != null && option.getGroupSets() != null
-                && !categoryService.getDefaultDataElementCategoryCombo().getCategoryOptions().contains( option ) )
-        {
-            cogSets = option.getGroupSets();
-        }
-
-        for ( DataApprovalLevel level : Lists.reverse( getAllDataApprovalLevels() ) )
-        {
-            if ( level.getCategoryOptionGroupSet() == null )
-            {
-                if ( cogSets == null )
-                {
-                    return level;
-                }
-            }
-            else if ( cogSets != null && cogSets.contains( level.getCategoryOptionGroupSet() ) )
-            {
-                return level;
-            }
-        }
-
-        return null;
-    }
-
-    @Override
     public List<DataApprovalLevel> getAllDataApprovalLevels()
     {
         List<DataApprovalLevel> dataApprovalLevels = dataApprovalLevelStore.getAllDataApprovalLevels();