=== 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-08-03 11:34:19 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/manager/DefaultSelectionTreeManager.java 2010-08-05 17:12:47 +0000 @@ -45,10 +45,7 @@ public class DefaultSelectionTreeManager implements SelectionTreeManager { - private static final String SESSION_KEY_SELECTED_ORG_UNITS = "dhis-oust-selected-org-units"; - - private static final String SESSION_KEY_LOCKED_ORG_UNITS = "dhis-oust-locked-org-units"; - + private static final String SESSION_KEY_SELECTED_ORG_UNITS = "dhis-oust-selected-org-units"; 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.2; @@ -109,18 +106,6 @@ return reloadOrganisationUnits( rootUnits ); } - public Collection getLockedRootOrganisationUnits() - { - Collection rootUnits = getCollectionFromSession( SESSION_KEY_LOCKED_ORG_UNITS ); - - if ( rootUnits == null ) - { - return organisationUnitService.getRootOrganisationUnits(); - } - - return reloadOrganisationUnits( rootUnits ); - } - public OrganisationUnit getRootOrganisationUnitsParent() { Collection rootUnits = getCollectionFromSession( SESSION_KEY_ROOT_ORG_UNITS ); @@ -163,23 +148,6 @@ } } - public void setLockOnSelectedOrganisationUnits( Collection selectedUnits ) - { - if ( selectedUnits == null ) - { - throw new IllegalArgumentException( "Selected locked OrganisationUnits cannot be null" ); - } - - Collection rootUnits = getRootOrganisationUnits(); - - if ( rootUnits != null ) - { - selectedUnits = getUnitsInTree( rootUnits, selectedUnits ); - - saveToSession( SESSION_KEY_LOCKED_ORG_UNITS, selectedUnits ); - } - } - public Collection getSelectedOrganisationUnits() { Collection selectedUnits = getCollectionFromSession( SESSION_KEY_SELECTED_ORG_UNITS ); @@ -197,50 +165,10 @@ return reloadOrganisationUnits( getSelectedOrganisationUnits() ); } - public Collection getLockOnSelectedOrganisationUnits() - { - Collection selectedUnits = getCollectionFromSession( SESSION_KEY_LOCKED_ORG_UNITS ); - - if ( selectedUnits == null ) - { - return new HashSet(); - } - return selectedUnits; - } - public void clearSelectedOrganisationUnits() { removeFromSession( SESSION_KEY_SELECTED_ORG_UNITS ); } - - public void setLockOnSelectedOrganisationUnits( OrganisationUnit selectedUnit ) - { - if ( selectedUnit == null ) - { - throw new IllegalArgumentException( "Selected OrganisationUnit cannot be null" ); - } - - Set set = new HashSet( 1 ); - set.add( selectedUnit ); - setLockOnSelectedOrganisationUnits( set ); - } - - public OrganisationUnit getLockOnSelectedOrganisationUnit() - { - Collection selectedUnits = getLockOnSelectedOrganisationUnits(); - - if ( selectedUnits.isEmpty() ) - { - return null; - } - - return selectedUnits.iterator().next(); - } - - public void clearLockOnSelectedOrganisationUnits() - { - removeFromSession( SESSION_KEY_LOCKED_ORG_UNITS ); - } public OrganisationUnit getSelectedOrganisationUnit() { === modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/manager/SelectionTreeManager.java' --- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/manager/SelectionTreeManager.java 2010-05-17 16:13:24 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/manager/SelectionTreeManager.java 2010-08-05 17:12:47 +0000 @@ -79,8 +79,6 @@ */ Collection getRootOrganisationUnits(); - Collection getLockedRootOrganisationUnits(); - /** * Resets the selection tree to use the actual root of the OrganisationUnit * tree. @@ -108,16 +106,6 @@ */ Collection getSelectedOrganisationUnits(); - void setLockOnSelectedOrganisationUnits( Collection selectedUnits ); - - void setLockOnSelectedOrganisationUnits( OrganisationUnit selectedUnit ); - - OrganisationUnit getLockOnSelectedOrganisationUnit(); - - Collection getLockOnSelectedOrganisationUnits(); - - void clearLockOnSelectedOrganisationUnits(); - /** * Clears the selection and makes getSelectedOrganisationUnit() return null. */