dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #12381
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3797: Impl dataset report without action chaining
------------------------------------------------------------
revno: 3797
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-05-30 22:54:54 +0200
message:
Impl dataset report without action chaining
removed:
dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateCustomDataSetReportAction.java
dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateDefaultDataSetReportAction.java
dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateSectionDataSetReportAction.java
modified:
dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateDataSetReportAction.java
dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/renderCustomDataSetReportForm.vm
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/renderDefaultDataSetReportForm.vm
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/renderSectionDataSetReportForm.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
=== removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateCustomDataSetReportAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateCustomDataSetReportAction.java 2011-05-30 19:32:17 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateCustomDataSetReportAction.java 1970-01-01 00:00:00 +0000
@@ -1,139 +0,0 @@
-package org.hisp.dhis.reporting.dataset.action;
-
-/*
- * Copyright (c) 2004-2010, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import org.hisp.dhis.dataset.DataSet;
-import org.hisp.dhis.datasetreport.DataSetReportService;
-import org.hisp.dhis.i18n.I18nFormat;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.period.Period;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Abyot Asalefew Gizaw
- * @version $Id$
- */
-public class GenerateCustomDataSetReportAction
- implements Action
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private DataSetReportService dataSetReportService;
-
- private I18nFormat format;
-
- // -------------------------------------------------------------------------
- // Input
- // -------------------------------------------------------------------------
-
- private OrganisationUnit selectedOrgunit;
-
- private DataSet selectedDataSet;
-
- private Period selectedPeriod;
-
- private boolean selectedUnitOnly;
-
- // -------------------------------------------------------------------------
- // Output
- // -------------------------------------------------------------------------
-
- private String customDataEntryFormCode;
-
- private String reportingUnit;
-
- private String reportingPeriod;
-
- // -----------------------------------------------------------------------
- // Getters && Setters
- // -----------------------------------------------------------------------
-
- public void setDataSetReportService( DataSetReportService dataSetReportService )
- {
- this.dataSetReportService = dataSetReportService;
- }
-
- public void setFormat( I18nFormat format )
- {
- this.format = format;
- }
-
- public String getCustomDataEntryFormCode()
- {
- return customDataEntryFormCode;
- }
-
- public String getReportingUnit()
- {
- return reportingUnit;
- }
-
- public String getReportingPeriod()
- {
- return reportingPeriod;
- }
-
- public void setSelectedOrgunit( OrganisationUnit selectedOrgunit )
- {
- this.selectedOrgunit = selectedOrgunit;
- }
-
- public void setSelectedDataSet( DataSet selectedDataSet )
- {
- this.selectedDataSet = selectedDataSet;
- }
-
- public void setSelectedPeriod( Period selectedPeriod )
- {
- this.selectedPeriod = selectedPeriod;
- }
-
- public void setSelectedUnitOnly( boolean selectedUnitOnly )
- {
- this.selectedUnitOnly = selectedUnitOnly;
- }
-
- // -----------------------------------------------------------------------
- // Action implementation
- // -----------------------------------------------------------------------
-
- public String execute()
- throws Exception
- {
- customDataEntryFormCode = dataSetReportService.getCustomDataSetReport( selectedDataSet, selectedOrgunit, selectedPeriod, selectedUnitOnly, format );
-
- reportingUnit = selectedOrgunit.getName();
-
- reportingPeriod = format.formatPeriod( selectedPeriod );
-
- return SUCCESS;
- }
-}
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateDataSetReportAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateDataSetReportAction.java 2011-04-01 11:19:55 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateDataSetReportAction.java 2011-05-30 20:54:54 +0000
@@ -27,113 +27,157 @@
package org.hisp.dhis.reporting.dataset.action;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.hisp.dhis.common.Grid;
import org.hisp.dhis.dataset.DataSet;
import org.hisp.dhis.dataset.DataSetService;
+import org.hisp.dhis.datasetreport.DataSetReportService;
+import org.hisp.dhis.i18n.I18n;
+import org.hisp.dhis.i18n.I18nFormat;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.oust.manager.SelectionTreeManager;
import org.hisp.dhis.period.Period;
import org.hisp.dhis.period.PeriodService;
import com.opensymphony.xwork2.Action;
+import com.opensymphony.xwork2.ActionContext;
+
+import static org.hisp.dhis.dataset.DataSet.*;
/**
* @author Chau Thu Tran
- * @version $Id GenerateDataSetReportAction.java Mar 09, 2011 9:02:43 AM $
+ * @author Lars Helge Overland
*/
public class GenerateDataSetReportAction
implements Action
{
- private final static String RESULT_CUSTOM = "customDataSetReport";
- private final static String RESULT_SECTION = "sectionDataSetReport";
- private final static String RESULT_DEFAULT = "defaultDataSetReport";
+ private static final String PARAM_PAGE = "page";
+
+ private static final Map<String, String> VIEW_MAP = new HashMap<String, String>() { {
+ put( TYPE_CUSTOM, "/dhis-web-reporting/renderCustomDataSetReportForm.vm" );
+ put( TYPE_SECTION, "/dhis-web-reporting/renderSectionDataSetReportForm.vm" );
+ put( TYPE_DEFAULT, "/dhis-web-reporting/renderDefaultDataSetReportForm.vm" );
+ } };
// -------------------------------------------------------------------------
- // Dependency
+ // Dependencies
// -------------------------------------------------------------------------
private SelectionTreeManager selectionTreeManager;
+ public void setSelectionTreeManager( SelectionTreeManager selectionTreeManager )
+ {
+ this.selectionTreeManager = selectionTreeManager;
+ }
+
+ private DataSetReportService dataSetReportService;
+
+ public void setDataSetReportService( DataSetReportService dataSetReportService )
+ {
+ this.dataSetReportService = dataSetReportService;
+ }
+
private DataSetService dataSetService;
+ public void setDataSetService( DataSetService dataSetService )
+ {
+ this.dataSetService = dataSetService;
+ }
+
private PeriodService periodService;
+ public void setPeriodService( PeriodService periodService )
+ {
+ this.periodService = periodService;
+ }
+
+ private I18nFormat format;
+
+ public void setFormat( I18nFormat format )
+ {
+ this.format = format;
+ }
+
+ private I18n i18n;
+
+ public void setI18n( I18n i18n )
+ {
+ this.i18n = i18n;
+ }
+
// -------------------------------------------------------------------------
// Input
// -------------------------------------------------------------------------
private Integer dataSetId;
+ public void setDataSetId( Integer dataSetId )
+ {
+ this.dataSetId = dataSetId;
+ }
+
private String periodId;
+ public void setPeriodId( String periodId )
+ {
+ this.periodId = periodId;
+ }
+
private boolean selectedUnitOnly;
+ public void setSelectedUnitOnly( boolean selectedUnitOnly )
+ {
+ this.selectedUnitOnly = selectedUnitOnly;
+ }
+
// -------------------------------------------------------------------------
// Output
// -------------------------------------------------------------------------
private OrganisationUnit selectedOrgunit;
- private DataSet selectedDataSet;
-
- private Period selectedPeriod;
-
- // -------------------------------------------------------------------------
- // Getters && Setters
- // -------------------------------------------------------------------------
-
- public Integer getDataSetId()
- {
- return dataSetId;
- }
-
- public boolean isSelectedUnitOnly()
- {
- return selectedUnitOnly;
- }
-
- public void setSelectedUnitOnly( boolean selectedUnitOnly )
- {
- this.selectedUnitOnly = selectedUnitOnly;
- }
-
- public void setSelectionTreeManager( SelectionTreeManager selectionTreeManager )
- {
- this.selectionTreeManager = selectionTreeManager;
- }
-
- public void setPeriodService( PeriodService periodService )
- {
- this.periodService = periodService;
- }
-
public OrganisationUnit getSelectedOrgunit()
{
return selectedOrgunit;
}
+ private DataSet selectedDataSet;
+
public DataSet getSelectedDataSet()
{
return selectedDataSet;
}
+ private Period selectedPeriod;
+
public Period getSelectedPeriod()
{
return selectedPeriod;
}
- public void setPeriodId( String periodId )
- {
- this.periodId = periodId;
- }
-
- public void setDataSetId( Integer dataSetId )
- {
- this.dataSetId = dataSetId;
- }
-
- public void setDataSetService( DataSetService dataSetService )
- {
- this.dataSetService = dataSetService;
+ private String customDataEntryFormCode;
+
+ public String getCustomDataEntryFormCode()
+ {
+ return customDataEntryFormCode;
+ }
+
+ private List<Grid> grids = new ArrayList<Grid>();
+
+ public List<Grid> getGrids()
+ {
+ return grids;
+ }
+
+ private Grid grid;
+
+ public Grid getGrid()
+ {
+ return grid;
}
// -------------------------------------------------------------------------
@@ -155,11 +199,23 @@
selectedPeriod = periodService.getPeriodByExternalId( periodId );
- if ( selectedDataSet.hasDataEntryForm() )
- {
- return RESULT_CUSTOM;
- }
-
- return selectedDataSet.hasSections() ? RESULT_SECTION : RESULT_DEFAULT;
+ String type = selectedDataSet.getDataSetType();
+
+ if ( TYPE_CUSTOM.equals( type ) )
+ {
+ customDataEntryFormCode = dataSetReportService.getCustomDataSetReport( selectedDataSet, selectedOrgunit, selectedPeriod, selectedUnitOnly, format );
+ }
+ else if ( TYPE_SECTION.equals( type ) )
+ {
+ grids = dataSetReportService.getSectionDataSetReport( selectedDataSet, selectedPeriod, selectedOrgunit, selectedUnitOnly, format, i18n );
+ }
+ else
+ {
+ grid = dataSetReportService.getDefaultDataSetReport( selectedDataSet, selectedPeriod, selectedOrgunit, selectedUnitOnly, format, i18n );
+ }
+
+ ActionContext.getContext().getActionInvocation().getStack().setValue( PARAM_PAGE, VIEW_MAP.get( type ) );
+
+ return SUCCESS;
}
}
=== removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateDefaultDataSetReportAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateDefaultDataSetReportAction.java 2011-04-01 11:19:55 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateDefaultDataSetReportAction.java 1970-01-01 00:00:00 +0000
@@ -1,147 +0,0 @@
-package org.hisp.dhis.reporting.dataset.action;
-
-/*
- * Copyright (c) 2004-2010, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import org.hisp.dhis.common.Grid;
-import org.hisp.dhis.dataset.DataSet;
-import org.hisp.dhis.datasetreport.DataSetReportService;
-import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.i18n.I18nFormat;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.period.Period;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Chau Thu Tran
- */
-public class GenerateDefaultDataSetReportAction
- implements Action
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private DataSetReportService dataSetReportService;
-
- // -------------------------------------------------------------------------
- // Input
- // -------------------------------------------------------------------------
-
- private OrganisationUnit selectedOrgunit;
-
- private DataSet selectedDataSet;
-
- private Period selectedPeriod;
-
- private boolean selectedUnitOnly;
-
- private I18nFormat format;
-
- private I18n i18n;
-
- // -------------------------------------------------------------------------
- // Output
- // -------------------------------------------------------------------------
-
- private Grid grid;
-
- private String reportingUnit;
-
- private String reportingPeriod;
-
- // -------------------------------------------------------------------------
- // Getters && Setters
- // -------------------------------------------------------------------------
-
- public void setDataSetReportService( DataSetReportService dataSetReportService )
- {
- this.dataSetReportService = dataSetReportService;
- }
-
- public void setSelectedOrgunit( OrganisationUnit selectedOrgunit )
- {
- this.selectedOrgunit = selectedOrgunit;
- }
-
- public void setSelectedDataSet( DataSet selectedDataSet )
- {
- this.selectedDataSet = selectedDataSet;
- }
-
- public void setSelectedPeriod( Period selectedPeriod )
- {
- this.selectedPeriod = selectedPeriod;
- }
-
- public String getReportingUnit()
- {
- return reportingUnit;
- }
-
- public String getReportingPeriod()
- {
- return reportingPeriod;
- }
-
- public void setI18n( I18n i18n )
- {
- this.i18n = i18n;
- }
-
- public void setFormat( I18nFormat format )
- {
- this.format = format;
- }
-
- public Grid getGrid()
- {
- return grid;
- }
-
- public void setSelectedUnitOnly( boolean selectedUnitOnly )
- {
- this.selectedUnitOnly = selectedUnitOnly;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- public String execute()
- throws Exception
- {
- grid = dataSetReportService.getDefaultDataSetReport( selectedDataSet, selectedPeriod, selectedOrgunit, selectedUnitOnly, format, i18n );
-
- reportingUnit = selectedOrgunit.getName();
-
- reportingPeriod = format.formatPeriod( selectedPeriod );
-
- return SUCCESS;
- }
-}
=== removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateSectionDataSetReportAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateSectionDataSetReportAction.java 2011-04-01 11:19:55 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateSectionDataSetReportAction.java 1970-01-01 00:00:00 +0000
@@ -1,149 +0,0 @@
-package org.hisp.dhis.reporting.dataset.action;
-
-/*
- * Copyright (c) 2004-2010, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.hisp.dhis.common.Grid;
-import org.hisp.dhis.dataset.DataSet;
-import org.hisp.dhis.datasetreport.DataSetReportService;
-import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.i18n.I18nFormat;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.period.Period;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Chau Thu Tran
- */
-public class GenerateSectionDataSetReportAction
- implements Action
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private DataSetReportService dataSetReportService;
-
- // -------------------------------------------------------------------------
- // Input
- // -------------------------------------------------------------------------
-
- private OrganisationUnit selectedOrgunit;
-
- private DataSet selectedDataSet;
-
- private Period selectedPeriod;
-
- private boolean selectedUnitOnly;
-
- private I18nFormat format;
-
- private I18n i18n;
-
- // -------------------------------------------------------------------------
- // Output
- // -------------------------------------------------------------------------
-
- private List<Grid> grids = new ArrayList<Grid>();
-
- private String reportingUnit;
-
- private String reportingPeriod;
-
- // -------------------------------------------------------------------------
- // Getters && Setters
- // -------------------------------------------------------------------------
-
- public void setDataSetReportService( DataSetReportService dataSetReportService )
- {
- this.dataSetReportService = dataSetReportService;
- }
-
- public String getReportingUnit()
- {
- return reportingUnit;
- }
-
- public String getReportingPeriod()
- {
- return reportingPeriod;
- }
-
- public List<Grid> getGrids()
- {
- return grids;
- }
-
- public void setI18n( I18n i18n )
- {
- this.i18n = i18n;
- }
-
- public void setFormat( I18nFormat format )
- {
- this.format = format;
- }
-
- public void setSelectedOrgunit( OrganisationUnit selectedOrgunit )
- {
- this.selectedOrgunit = selectedOrgunit;
- }
-
- public void setSelectedDataSet( DataSet selectedDataSet )
- {
- this.selectedDataSet = selectedDataSet;
- }
-
- public void setSelectedPeriod( Period selectedPeriod )
- {
- this.selectedPeriod = selectedPeriod;
- }
-
- public void setSelectedUnitOnly( boolean selectedUnitOnly )
- {
- this.selectedUnitOnly = selectedUnitOnly;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- public String execute()
- throws Exception
- {
- grids = dataSetReportService.getSectionDataSetReport( selectedDataSet, selectedPeriod, selectedOrgunit, selectedUnitOnly, format, i18n );
-
- reportingUnit = selectedOrgunit.getName();
- reportingPeriod = format.formatPeriod( selectedPeriod );
-
- return SUCCESS;
- }
-}
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml 2011-05-14 19:32:53 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml 2011-05-30 20:54:54 +0000
@@ -351,42 +351,15 @@
class="org.hisp.dhis.reporting.dataset.action.GenerateDataSetReportAction"
scope="prototype">
<property name="selectionTreeManager"
- ref="org.hisp.dhis.oust.manager.SelectionTreeManager"/>
+ ref="org.hisp.dhis.oust.manager.SelectionTreeManager"/>
+ <property name="dataSetReportService"
+ ref="org.hisp.dhis.datasetreport.DataSetReportService"/>
<property name="dataSetService"
ref="org.hisp.dhis.dataset.DataSetService"/>
<property name="periodService"
ref="org.hisp.dhis.period.PeriodService"/>
</bean>
-
- <bean id="org.hisp.dhis.reporting.dataset.action.GenerateCustomDataSetReportAction"
- class="org.hisp.dhis.reporting.dataset.action.GenerateCustomDataSetReportAction"
- scope="prototype">
- <property name="dataSetReportService"
- ref="org.hisp.dhis.datasetreport.DataSetReportService"/>
- </bean>
-
- <bean id="org.hisp.dhis.reporting.dataset.action.GenerateSectionDataSetReportAction"
- class="org.hisp.dhis.reporting.dataset.action.GenerateSectionDataSetReportAction"
- scope="prototype">
- <property name="dataSetReportService"
- ref="org.hisp.dhis.datasetreport.DataSetReportService"/>
- </bean>
-
- <bean id="org.hisp.dhis.reporting.dataset.action.GenerateDefaultDataSetReportAction"
- class="org.hisp.dhis.reporting.dataset.action.GenerateDefaultDataSetReportAction"
- scope="prototype">
- <property name="dataSetReportService"
- ref="org.hisp.dhis.datasetreport.DataSetReportService"/>
- </bean>
-
- <bean id="org.hisp.dhis.de.action.SectionFormAction" class="org.hisp.dhis.de.action.SectionFormAction" scope="prototype">
- <property name="dataValueService" ref="org.hisp.dhis.datavalue.DataValueService"/>
- <property name="standardCommentsManager" ref="org.hisp.dhis.de.comments.StandardCommentsManager"/>
- <property name="minMaxDataElementService" ref="org.hisp.dhis.minmax.MinMaxDataElementService"/>
- <property name="selectedStateManager" ref="org.hisp.dhis.de.state.SelectedStateManager"/>
- <property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService"/>
- </bean>
-
+
<!-- Data completeness -->
<bean id="org.hisp.dhis.reporting.completeness.action.GetDataCompletenessOptionsAction"
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml 2011-05-30 19:10:22 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml 2011-05-30 20:54:54 +0000
@@ -277,40 +277,11 @@
<interceptor-ref name="organisationUnitTreeStack"/>
</action>
- <action name="generateDataSetReport" class="org.hisp.dhis.reporting.dataset.action.GenerateDataSetReportAction">
- <result name="customDataSetReport" type="chain">generateCustomDataSetReport</result>
- <result name="sectionDataSetReport" type="chain">generateSectionDataSetReport</result>
- <result name="defaultDataSetReport" type="chain">generateDefaultDataSetReport</result>
- <result name="error" type="chain">showDataSetReportForm</result>
- </action>
-
- <action name="generateCustomDataSetReport" class="org.hisp.dhis.reporting.dataset.action.GenerateCustomDataSetReportAction">
- <result name="success" type="velocity">/main.vm</result>
- <result name="error" type="chain">showDataSetReportForm</result>
- <param name="page">/dhis-web-reporting/renderCustomDataSetReportForm.vm</param>
- <param name="menu">/dhis-web-reporting/menu.vm</param>
- <param name="javascripts">../dhis-web-commons/util/jquery.jqprint.0.3.js</param>
- <interceptor-ref name="organisationUnitTreeStack"/>
- </action>
-
- <action name="generateSectionDataSetReport" class="org.hisp.dhis.reporting.dataset.action.GenerateSectionDataSetReportAction">
- <result name="success" type="velocity">/main.vm</result>
- <result name="error" type="chain">showDataSetReportForm</result>
- <param name="page">/dhis-web-reporting/renderSectionDataSetReportForm.vm</param>
- <param name="menu">/dhis-web-reporting/menu.vm</param>
- <param name="javascripts">../dhis-web-commons/util/jquery.jqprint.0.3.js</param>
- <interceptor-ref name="organisationUnitTreeStack"/>
- </action>
-
- <action name="generateDefaultDataSetReport" class="org.hisp.dhis.reporting.dataset.action.GenerateDefaultDataSetReportAction">
- <result name="success" type="velocity">/main.vm</result>
- <result name="error" type="chain">showDataSetReportForm</result>
- <param name="page">/dhis-web-reporting/renderDefaultDataSetReportForm.vm</param>
- <param name="menu">/dhis-web-reporting/menu.vm</param>
- <param name="javascripts">../dhis-web-commons/util/jquery.jqprint.0.3.js</param>
- <interceptor-ref name="organisationUnitTreeStack"/>
- </action>
-
+ <action name="generateDataSetReport" class="org.hisp.dhis.reporting.dataset.action.GenerateDataSetReportAction">
+ <result name="success" type="velocity">/main.vm</result> <!-- Page param set in action -->
+ <param name="menu">/dhis-web-reporting/menu.vm</param>
+ </action>
+
<!-- Tally Sheet Forms Generator -->
<action name="tallySheetGenerator" class="org.hisp.dhis.reporting.tallysheet.action.SelectTallySheetAction">
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/renderCustomDataSetReportForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/renderCustomDataSetReportForm.vm 2011-03-20 14:46:44 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/renderCustomDataSetReportForm.vm 2011-05-30 20:54:54 +0000
@@ -1,5 +1,5 @@
-<h3>$i18n.getString('reporting_unit'): $reportingUnit $i18n.getString('reporting_period'): $reportingPeriod</h3>
+<h3>$i18n.getString('reporting_unit'): $encoder.htmlEncode( $selectedOrgunit.name ) $i18n.getString('reporting_period'): $format.formatPeriod( $selectedPeriod )</h3>
<p><input type="button" value="$i18n.getString( 'back' )" style="width:100px" onclick="javascript:window.location.href='showDataSetReportForm.action'"/></p>
<div>
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/renderDefaultDataSetReportForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/renderDefaultDataSetReportForm.vm 2011-03-20 14:46:44 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/renderDefaultDataSetReportForm.vm 2011-05-30 20:54:54 +0000
@@ -1,5 +1,5 @@
-<h3>$i18n.getString('reporting_unit'): $reportingUnit $i18n.getString('reporting_period'): $reportingPeriod</h3>
+<h3>$i18n.getString('reporting_unit'): $encoder.htmlEncode( $selectedOrgunit.name ) $i18n.getString('reporting_period'): $format.formatPeriod( $selectedPeriod )</h3>
<p><input type="button" value="$i18n.getString( 'back' )" style="width:100px" onclick="javascript:window.location.href='showDataSetReportForm.action'"/></p>
<div>
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/renderSectionDataSetReportForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/renderSectionDataSetReportForm.vm 2011-03-20 14:46:44 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/renderSectionDataSetReportForm.vm 2011-05-30 20:54:54 +0000
@@ -1,11 +1,10 @@
<style>
-.val
-{
+.val {
text-align:center;
}
</style>
-<h3>$i18n.getString('reporting_unit'): $reportingUnit $i18n.getString('reporting_period'): $reportingPeriod</h3>
+<h3>$i18n.getString('reporting_unit'): $encoder.htmlEncode( $selectedOrgunit.name ) $i18n.getString('reporting_period'): $format.formatPeriod( $selectedPeriod )</h3>
<p><input type="button" value="$i18n.getString( 'back' )" style="width:100px" onclick="javascript:window.location.href='showDataSetReportForm.action'"/></p>
#foreach( $grid in $grids )