← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2061: Minor simplification in dataentry

 

------------------------------------------------------------
revno: 2061
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2010-11-15 17:58:13 +0100
message:
  Minor simplification in dataentry
modified:
  dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataprune/jdbc/JdbcDataPruneStore.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SelectAction.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/DefaultSelectedStateManager.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/SelectedStateManager.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-administration/src/main/java/org/hisp/dhis/dataprune/jdbc/JdbcDataPruneStore.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataprune/jdbc/JdbcDataPruneStore.java	2010-11-12 01:49:04 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataprune/jdbc/JdbcDataPruneStore.java	2010-11-15 16:58:13 +0000
@@ -39,7 +39,6 @@
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.system.util.ConversionUtils;
 import org.hisp.dhis.system.util.TextUtils;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.jdbc.core.JdbcTemplate;
 
 /**

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SelectAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SelectAction.java	2010-11-12 08:09:09 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SelectAction.java	2010-11-15 16:58:13 +0000
@@ -242,9 +242,6 @@
 
         if ( organisationUnit == null )
         {
-            selectedDataSetId = null;
-            selectedPeriodIndex = null;
-
             selectedStateManager.clearSelectedDataSet();
             selectedStateManager.clearSelectedPeriod();
 
@@ -255,7 +252,7 @@
         // Load and sort DataSets
         // ---------------------------------------------------------------------
 
-        dataSets = selectedStateManager.loadDataSetsForSelectedOrgUnit( organisationUnit );
+        dataSets = selectedStateManager.loadDataSetsForSelectedOrgUnit();
 
         Collections.sort( dataSets, new DataSetNameComparator() );
 

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/DefaultSelectedStateManager.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/DefaultSelectedStateManager.java	2010-09-24 06:12:10 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/DefaultSelectedStateManager.java	2010-11-15 16:58:13 +0000
@@ -115,12 +115,18 @@
     // OrganisationUnit
     // -------------------------------------------------------------------------
     
-
     public OrganisationUnit getSelectedOrganisationUnit()
     {
         return selectionManager.getSelectedOrganisationUnit();
     }
 
+    public void clear()
+    {
+        clearSelectedDataSet();
+        clearSelectedPeriod();
+        selectionManager.clearSelectedOrganisationUnits();
+    }
+    
     // -------------------------------------------------------------------------
     // DataSet
     // -------------------------------------------------------------------------
@@ -142,9 +148,9 @@
         getSession().remove( SESSION_KEY_SELECTED_DATASET_ID );
     }
 
-    public List<DataSet> loadDataSetsForSelectedOrgUnit( OrganisationUnit organisationUnit )
+    public List<DataSet> loadDataSetsForSelectedOrgUnit()
     {
-        List<DataSet> dataSets = new ArrayList<DataSet>( dataSetService.getDataSetsBySource( organisationUnit ) );
+        List<DataSet> dataSets = new ArrayList<DataSet>( dataSetService.getDataSetsBySource( getSelectedOrganisationUnit() ) );
 
         // ---------------------------------------------------------------------
         // Retain only DataSets from current user's authority groups

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/SelectedStateManager.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/SelectedStateManager.java	2010-09-24 06:12:10 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/SelectedStateManager.java	2010-11-15 16:58:13 +0000
@@ -39,6 +39,8 @@
  */
 public interface SelectedStateManager
 {
+    void clear();
+    
     // -------------------------------------------------------------------------
     // OrganisationUnit
     // -------------------------------------------------------------------------
@@ -55,7 +57,7 @@
 
     void clearSelectedDataSet();
     
-    List<DataSet> loadDataSetsForSelectedOrgUnit( OrganisationUnit organisationUnit );    
+    List<DataSet> loadDataSetsForSelectedOrgUnit();    
 
     // -------------------------------------------------------------------------
     // Period