← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3932: Remove chain from Report Module

 

------------------------------------------------------------
revno: 3932
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2011-06-17 16:23:09 +0530
message:
  Remove chain from Report Module
modified:
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/reportmanagement/action/DefineReportAssociationsAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/reportmanagement/action/SetupAssociationsTreeAction.java
  local/in/dhis-web-reports-national/src/main/resources/META-INF/dhis/beans.xml
  local/in/dhis-web-reports-national/src/main/resources/struts.xml


--
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 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/reportmanagement/action/DefineReportAssociationsAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/reportmanagement/action/DefineReportAssociationsAction.java	2011-04-27 17:15:13 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/reportmanagement/action/DefineReportAssociationsAction.java	2011-06-17 10:53:09 +0000
@@ -1,8 +1,6 @@
 package org.hisp.dhis.reports.reportmanagement.action;
 
-import java.util.Collection;
 import java.util.HashSet;
-import java.util.Set;
 
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.oust.manager.SelectionTreeManager;
@@ -56,6 +54,16 @@
     public String execute()
         throws Exception
     {
+        Report_in report = reportService.getReport( reportId );
+       
+
+        report.updateOrganisationUnits( new HashSet<OrganisationUnit>( selectionTreeManager.getReloadedSelectedOrganisationUnits() ) );
+        
+        reportService.updateReport( report );
+
+        
+        /*
+        
         Collection<OrganisationUnit> rootUnits = selectionTreeManager.getRootOrganisationUnits();
 
         Set<OrganisationUnit> unitsInTheTree = new HashSet<OrganisationUnit>();
@@ -75,7 +83,7 @@
         report.setSources( assignedSources );
 
         reportService.updateReport( report );
-
+        */
         return SUCCESS;
     }
 
@@ -83,6 +91,7 @@
     // Supportive methods
     // -------------------------------------------------------------------------
 
+    /*
     private void getUnitsInTheTree( Collection<OrganisationUnit> rootUnits, Set<OrganisationUnit> unitsInTheTree )
     {
         for ( OrganisationUnit root : rootUnits )
@@ -91,4 +100,5 @@
             getUnitsInTheTree( root.getChildren(), unitsInTheTree );
         }
     }
+    */
 }

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/reportmanagement/action/SetupAssociationsTreeAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/reportmanagement/action/SetupAssociationsTreeAction.java	2011-04-27 17:15:13 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/reportmanagement/action/SetupAssociationsTreeAction.java	2011-06-17 10:53:09 +0000
@@ -1,10 +1,5 @@
 package org.hisp.dhis.reports.reportmanagement.action;
 
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.oust.manager.SelectionTreeManager;
 import org.hisp.dhis.reports.ReportService;
 import org.hisp.dhis.reports.Report_in;

=== modified file 'local/in/dhis-web-reports-national/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-web-reports-national/src/main/resources/META-INF/dhis/beans.xml	2011-06-15 06:10:53 +0000
+++ local/in/dhis-web-reports-national/src/main/resources/META-INF/dhis/beans.xml	2011-06-17 10:53:09 +0000
@@ -66,7 +66,7 @@
     </bean>
     
     <!-- Report Association -->
-    <bean
+<!--    <bean
         id="org.hisp.dhis.reports.reportmanagement.action.GetNumberOfLevelsAction"
         class="org.hisp.dhis.reports.reportmanagement.action.GetNumberOfLevelsAction"
         scope="prototype">
@@ -76,7 +76,7 @@
         <property name="organisationUnitGroupService"
             ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService">
         </property>
-    </bean>
+    </bean>-->
     <bean
         id="org.hisp.dhis.reports.reportmanagement.action.SetupAssociationsTreeAction"
         class="org.hisp.dhis.reports.reportmanagement.action.SetupAssociationsTreeAction"
@@ -96,9 +96,8 @@
         </property>
         <property name="reportService" ref="org.hisp.dhis.reports.ReportService">
         </property>
-        
     </bean>
-    <bean id="org.hisp.dhis.reports.reportmanagement.action.UnselectAllAction"
+<!--    <bean id="org.hisp.dhis.reports.reportmanagement.action.UnselectAllAction"
         class="org.hisp.dhis.reports.reportmanagement.action.UnselectAllAction"
         scope="prototype">
         <property name="selectionTreeManager"
@@ -138,7 +137,7 @@
         <property name="organisationUnitGroupService"
             ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService">
         </property>
-    </bean>
+    </bean>-->
     
     <!-- Report Deletion -->
     <bean id="org.hisp.dhis.reports.reportmanagement.action.DelReportAction"

=== modified file 'local/in/dhis-web-reports-national/src/main/resources/struts.xml'
--- local/in/dhis-web-reports-national/src/main/resources/struts.xml	2011-06-15 06:10:53 +0000
+++ local/in/dhis-web-reports-national/src/main/resources/struts.xml	2011-06-17 10:53:09 +0000
@@ -59,7 +59,6 @@
             <result name="input" type="velocity-xml">/dhis-web-reports/responseReportManagementInput.vm</result>
             <param name="onExceptionReturn">plainTextError</param>
         </action>
-        
         <!-- Get Report details -->
         <action name="getReport"
             class="org.hisp.dhis.reports.reportmanagement.action.GetReportAction">
@@ -68,7 +67,7 @@
         </action>
         
         <!-- Report Association -->
-        <action name="defineReportAssociationsForm"
+<!--    <action name="defineReportAssociationsForm"
             class="org.hisp.dhis.reports.reportmanagement.action.GetNumberOfLevelsAction">
             <result name="success" type="chain">defineReportAssociationsFormChain</result>
         </action>
@@ -78,8 +77,14 @@
             <param name="menu">/dhis-web-reports/menu.vm</param>
             <param name="page">/dhis-web-reports/reportAssociations.vm</param>
             <param name="javascripts">../dhis-web-commons/oust/oust.js,javascript/reportManagementAssociations.js</param>
-        </action>
-        
+        </action>-->
+        <action name="defineReportAssociationsForm"
+            class="org.hisp.dhis.reports.reportmanagement.action.SetupAssociationsTreeAction">
+            <result name="success" type="velocity">/main.vm</result>
+            <param name="menu">/dhis-web-reports/menu.vm</param>
+            <param name="page">/dhis-web-reports/reportAssociations.vm</param>
+            <param name="javascripts">../dhis-web-commons/oust/oust.js,javascript/reportManagementAssociations.js</param>
+		</action>		
         <!-- Report Association save -->
         <action name="defineReportAssociations"
             class="org.hisp.dhis.reports.reportmanagement.action.DefineReportAssociationsAction">
@@ -87,33 +92,33 @@
         </action>
         
         <!-- Report Association Remove All -->
-        <action name="unselectAll"
+<!--        <action name="unselectAll"
             class="org.hisp.dhis.reports.reportmanagement.action.UnselectAllAction">
             <result name="success" type="chain">getNumberOfLevelsSelectLevelChain</result>
-        </action>
+        </action>-->
         
         <!-- Report Association select/unselect All at Level -->
-        <action name="selectLevel"
+<!--        <action name="selectLevel"
             class="org.hisp.dhis.reports.reportmanagement.action.SelectLevelAction">
             <result name="success" type="chain">getNumberOfLevelsSelectLevelChain</result>
         </action>
         <action name="unselectLevel"
             class="org.hisp.dhis.reports.reportmanagement.action.UnselectLevelAction">
             <result name="success" type="chain">getNumberOfLevelsSelectLevelChain</result>
-        </action>
+        </action>-->
         
         <!-- Report Association select/unselect All at Group -->
-        <action name="selectgroup"
+<!--        <action name="selectgroup"
             class="org.hisp.dhis.reports.reportmanagement.action.SelectGroupAction">
             <result name="success" type="chain">getNumberOfLevelsSelectLevelChain</result>
         </action>
         <action name="unselectgroup"
             class="org.hisp.dhis.reports.reportmanagement.action.UnselectGroupAction">
             <result name="success" type="chain">getNumberOfLevelsSelectLevelChain</result>
-        </action>
+        </action>-->
         
         <!-- Chain for Associations -->
-        <action name="getNumberOfLevelsSelectLevelChain"
+<!--        <action name="getNumberOfLevelsSelectLevelChain"
             class="org.hisp.dhis.reports.reportmanagement.action.GetNumberOfLevelsAction">
             <result name="success" type="chain">getReportSelectLevelChain</result>
         </action>
@@ -123,7 +128,7 @@
             <param name="menu">/dhis-web-reports/menu.vm</param>
             <param name="page">/dhis-web-reports/reportAssociations.vm</param>
             <param name="javascripts">../dhis-web-commons/oust/oust.js,javascript/reportManagementAssociations.js</param>
-        </action>
+        </action>-->
         
         <!-- Report Deletion -->
         <action name="delReport"