← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2093: FIXED bug602547: in datalockin screen orgunittree is not loading

 

------------------------------------------------------------
revno: 2093
committer: devratan <devratan@hisp-4fac068894>
branch nick: trunk
timestamp: Wed 2010-07-07 11:49:59 +0530
message:
  FIXED bug602547: in datalockin screen orgunittree is not loading
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/GetNumberOfLevelsAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/LockSelectedOrganisationUnitAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/RemoveLockSelectedOrganisationUnitAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/SetupAssociationsTreeAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/selectionedTreeInFrame.vm


--
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-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/GetNumberOfLevelsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/GetNumberOfLevelsAction.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/GetNumberOfLevelsAction.java	2010-07-07 06:19:59 +0000
@@ -32,14 +32,16 @@
 import org.hisp.dhis.organisationunit.OrganisationUnitLevel;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 
-import com.opensymphony.xwork2.ActionSupport;
+import com.opensymphony.xwork2.Action;
+
+//import com.opensymphony.xwork2.ActionSupport;
 
 /**
  * @author Brajesh Murari
  * @version $Id$
  */
-public class GetNumberOfLevelsAction 
-    extends ActionSupport
+public class GetNumberOfLevelsAction
+    implements Action
 {
     // -------------------------------------------------------------------------
     // Dependencies
@@ -57,7 +59,7 @@
     // -------------------------------------------------------------------------
 
     private List<OrganisationUnitLevel> levels;
-    
+
     public List<OrganisationUnitLevel> getLevels()
     {
         return levels;
@@ -70,7 +72,7 @@
     public String execute()
     {
         levels = organisationUnitService.getOrganisationUnitLevels();
-        
+
         return SUCCESS;
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/LockSelectedOrganisationUnitAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/LockSelectedOrganisationUnitAction.java	2010-01-04 12:33:03 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/LockSelectedOrganisationUnitAction.java	2010-07-07 06:19:59 +0000
@@ -26,8 +26,7 @@
  */
 package org.hisp.dhis.dataadmin.action.lock;
 
-import java.util.Collection;
-import java.util.Set;
+import java.util.Collection; //import java.util.Set;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -42,7 +41,7 @@
  * @version $Id$
  */
 public class LockSelectedOrganisationUnitAction
-implements Action
+    implements Action
 {
     private static final Log LOG = LogFactory.getLog( LockSelectedOrganisationUnitAction.class );
 
@@ -92,8 +91,8 @@
         try
         {
             OrganisationUnit unit = organisationUnitService.getOrganisationUnit( id );
-            
-            Set<OrganisationUnit> lockedUnits = (Set<OrganisationUnit>) selectionTreeManager.getLockOnSelectedOrganisationUnits();
+
+            lockedUnits = selectionTreeManager.getLockOnSelectedOrganisationUnits();
             lockedUnits.add( unit );
             selectionTreeManager.setLockOnSelectedOrganisationUnits( lockedUnits );
         }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/RemoveLockSelectedOrganisationUnitAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/RemoveLockSelectedOrganisationUnitAction.java	2009-09-28 22:49:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/RemoveLockSelectedOrganisationUnitAction.java	2010-07-07 06:19:59 +0000
@@ -26,8 +26,7 @@
  */
 package org.hisp.dhis.dataadmin.action.lock;
 
-import java.util.Collection;
-import java.util.Set;
+import java.util.Collection; //import java.util.Set;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -42,7 +41,7 @@
  * @version $Id$
  */
 public class RemoveLockSelectedOrganisationUnitAction
-implements Action
+    implements Action
 {
     private static final Log LOG = LogFactory.getLog( RemoveLockSelectedOrganisationUnitAction.class );
 
@@ -98,8 +97,8 @@
                 throw new RuntimeException( "OrganisationUnit with id " + id + " doesn't exist" );
             }
 
-            Set<OrganisationUnit> lockedUnits = (Set<OrganisationUnit>) selectionTreeManager.getLockOnSelectedOrganisationUnits();           
-            lockedUnits.remove( unit );           
+            lockedUnits = selectionTreeManager.getLockOnSelectedOrganisationUnits();
+            lockedUnits.remove( unit );
             selectionTreeManager.setLockOnSelectedOrganisationUnits( lockedUnits );
         }
         catch ( Exception e )

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/SetupAssociationsTreeAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/SetupAssociationsTreeAction.java	2009-09-28 22:49:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/SetupAssociationsTreeAction.java	2010-07-07 06:19:59 +0000
@@ -26,7 +26,7 @@
  */
 package org.hisp.dhis.dataadmin.action.lock;
 
-import java.util.Collection;
+//import java.util.Collection;
 import java.util.Date;
 import java.util.HashSet;
 import java.util.Set;
@@ -50,7 +50,7 @@
  */
 public class SetupAssociationsTreeAction
     implements Action
-  {
+{
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------
@@ -103,26 +103,26 @@
 
     public Integer getSelectedLockedDataSetId()
     {
-         return selectedLockedDataSetId;
+        return selectedLockedDataSetId;
     }
 
     private Integer periodId;
 
     public void setPeriodId( Integer periodId )
     {
-         this.periodId = periodId;
+        this.periodId = periodId;
     }
 
     public Integer getPeriodId()
     {
-         return periodId;
+        return periodId;
     }
 
     private String storedBy;
 
     public String getStoredBy()
     {
-         return storedBy;
+        return storedBy;
     }
 
     // -------------------------------------------------------------------------
@@ -130,56 +130,56 @@
     // -------------------------------------------------------------------------
 
     public String execute()
-      throws Exception
-	  {
-	        Period period = new Period();
-	        period = periodService.getPeriod( periodId.intValue() );
-	
-	        DataSet dataSet = new DataSet();
-	        dataSet = dataSetService.getDataSet( selectedLockedDataSetId.intValue() );
-	        storedBy = currentUserService.getCurrentUsername();
-	
-	        DataSetLock dataSetLock = dataSetLockService.getDataSetLockByDataSetAndPeriod( dataSet, period );
-	        
-	        selectionTreeManager.clearSelectedOrganisationUnits();
-	        selectionTreeManager.clearLockOnSelectedOrganisationUnits();
-	        
-	        Set<OrganisationUnit> selectedUnits = convert( dataSet.getSources() );
-	        if ( dataSetLock != null )
-	        {           
-	            selectionTreeManager.setSelectedOrganisationUnits( selectedUnits );
-	            Set<Source> sources = dataSetLock.getSources();
-	            if ( sources != null )
-	            {
-	                selectionTreeManager.setLockOnSelectedOrganisationUnits( convert( sources ) );
-	            }
-	        }
-	        else
-	        {
-	            selectionTreeManager.setSelectedOrganisationUnits( selectedUnits );
-	            DataSetLock dataSLock = new DataSetLock( dataSet, period );
-	            dataSLock.setTimestamp( new Date() );
-	            dataSLock.setStoredBy( storedBy );
-	            dataSetLockService.addDataSetLock( dataSLock );
-	            dataSet.setLocked( true );
-	            dataSetService.updateDataSet( dataSet );
-	        }
-	        return SUCCESS;
-	    }
-
-        // -------------------------------------------------------------------------
-        // Supportive methods
-        // -------------------------------------------------------------------------
-
-        private Set<OrganisationUnit> convert( Collection<Source> sources )
+        throws Exception
+    {
+        Period period = new Period();
+        period = periodService.getPeriod( periodId.intValue() );
+
+        DataSet dataSet = new DataSet();
+        dataSet = dataSetService.getDataSet( selectedLockedDataSetId.intValue() );
+        storedBy = currentUserService.getCurrentUsername();
+
+        DataSetLock dataSetLock = dataSetLockService.getDataSetLockByDataSetAndPeriod( dataSet, period );
+
+        selectionTreeManager.clearSelectedOrganisationUnits();
+        selectionTreeManager.clearLockOnSelectedOrganisationUnits();
+
+        Set<OrganisationUnit> selectedUnits = convert( dataSet.getSources() );
+        if ( dataSetLock != null )
         {
-            Set<OrganisationUnit> organisationUnits = new HashSet<OrganisationUnit>();
-
-            for ( Source source : sources )
+            selectionTreeManager.setSelectedOrganisationUnits( selectedUnits );
+            Set<Source> sources = dataSetLock.getSources();
+            if ( sources != null )
             {
-                organisationUnits.add( (OrganisationUnit) source );
+                selectionTreeManager.setLockOnSelectedOrganisationUnits( convert( sources ) );
             }
-
-            return organisationUnits;
-        }
-    }
+        }
+        else
+        {
+            selectionTreeManager.setSelectedOrganisationUnits( selectedUnits );
+            DataSetLock dataSLock = new DataSetLock( dataSet, period );
+            dataSLock.setTimestamp( new Date() );
+            dataSLock.setStoredBy( storedBy );
+            dataSetLockService.addDataSetLock( dataSLock );
+            dataSet.setLocked( true );
+            dataSetService.updateDataSet( dataSet );
+        }
+        return SUCCESS;
+    }
+
+    // -------------------------------------------------------------------------
+    // Supportive methods
+    // -------------------------------------------------------------------------
+
+    private Set<OrganisationUnit> convert( Set<Source> sources )
+    {
+        Set<OrganisationUnit> organisationUnits = new HashSet<OrganisationUnit>();
+
+        for ( Source source : sources )
+        {
+            organisationUnits.add( (OrganisationUnit) source );
+        }
+
+        return organisationUnits;
+    }
+}

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/selectionedTreeInFrame.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/selectionedTreeInFrame.vm	2010-04-28 04:59:07 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/selectionedTreeInFrame.vm	2010-07-07 06:19:59 +0000
@@ -26,7 +26,7 @@
                       selectionTreeSelection.setMultipleSelectionAllowed( true );
                       selectionTreeSelection.setOnSelectFunction( treeClicked );
                       selectionTreeSelection.setListenerFunction( selectCompleted );
-					  selectionTree.clearSelectedOrganisationUnits();
+					  //selectionTree.clearSelectedOrganisationUnits();
                       selectionTree.buildSelectionTree();				  
                 </script>  			
                 <script type="text/javascript">