dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #15977
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5918: Removed support for generating tailored data marts before rendering reports/report tables. Will r...
------------------------------------------------------------
revno: 5918
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2012-02-12 13:21:49 +0100
message:
Removed support for generating tailored data marts before rendering reports/report tables. Will rely on another solution.
removed:
dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/ReportTableInternalProcess.java
dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/CreateTableAction.java
dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GetStatusAction.java
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTableService.java
dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/impl/DefaultReportTableService.java
dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml
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/inputReportParamsForm.vm
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/generateReport.js
--
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-api/src/main/java/org/hisp/dhis/reporttable/ReportTableService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTableService.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTableService.java 2012-02-12 12:21:49 +0000
@@ -45,20 +45,6 @@
final String MODE_REPORT_TABLE = "table";
/**
- * Populated data mart with the relevant aggregated data for this ReportTable.
- *
- * @param id the identifier.
- * @param mode the mode, can be <l>dataelements</i>, <i>indicators</i>, and <i>datasets</i>.
- * @param reportingPeriod the number of months back in time which will be used
- * as basis for the generation of relative periods.
- * @param organisationUnitId the identifier of the organisation unit of the
- * report parameter, bot parent organisation unit and organisation unit.
- * @param format the I18nFormat to use.
- */
- void populateReportTableDataMart( int id, String mode, Date reportingPeriod,
- Integer organisationUnitId, I18nFormat format );
-
- /**
* Saves a ReportTable.
*
* @param reportTable the ReportTable to save.
=== removed file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/ReportTableInternalProcess.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/ReportTableInternalProcess.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/ReportTableInternalProcess.java 1970-01-01 00:00:00 +0000
@@ -1,115 +0,0 @@
-package org.hisp.dhis.reporttable;
-
-/*
- * Copyright (c) 2004-2012, 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.Date;
-
-import org.amplecode.cave.process.SerialToGroup;
-import org.hisp.dhis.i18n.I18nFormat;
-import org.hisp.dhis.system.process.AbstractStatementInternalProcess;
-
-/**
- * @author Lars Helge Overland
- */
-public class ReportTableInternalProcess
- extends AbstractStatementInternalProcess implements SerialToGroup
-{
- public static final String ID = "internal-process-ReportTable";
- public static final String PROCESS_TYPE = "ReportTable";
-
- private static final String PROCESS_GROUP = "DataMartProcessGroup";
-
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private ReportTableService reportTableService;
-
- public void setReportTableService( ReportTableService reportTableService )
- {
- this.reportTableService = reportTableService;
- }
-
- // -------------------------------------------------------------------------
- // Properties
- // -------------------------------------------------------------------------
-
- private Integer id;
-
- public void setId( Integer id )
- {
- this.id = id;
- }
-
- private String mode;
-
- public void setMode( String mode )
- {
- this.mode = mode;
- }
-
- private Date reportingPeriod;
-
- public void setReportingPeriod( Date reportingPeriod )
- {
- this.reportingPeriod = reportingPeriod;
- }
-
- private Integer organisationUnitId;
-
- public void setOrganisationUnitId( Integer organisationUnitId )
- {
- this.organisationUnitId = organisationUnitId;
- }
-
- private I18nFormat format;
-
- public void setFormat( I18nFormat format )
- {
- this.format = format;
- }
-
- // -------------------------------------------------------------------------
- // SerialToGroup implementation
- // -------------------------------------------------------------------------
-
- public String getGroup()
- {
- return PROCESS_GROUP;
- }
-
- // -------------------------------------------------------------------------
- // AbstractStatementInternalProcess implementation
- // -------------------------------------------------------------------------
-
- @Override
- public void executeStatements()
- {
- reportTableService.populateReportTableDataMart( id, mode, reportingPeriod, organisationUnitId, format );
- }
-}
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/impl/DefaultReportTableService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/impl/DefaultReportTableService.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/impl/DefaultReportTableService.java 2012-02-12 12:21:49 +0000
@@ -38,7 +38,6 @@
import static org.hisp.dhis.reporttable.ReportTable.getColumnName;
import static org.hisp.dhis.reporttable.ReportTable.getIdentifier;
import static org.hisp.dhis.reporttable.ReportTable.getPrettyColumnName;
-import static org.hisp.dhis.system.util.ConversionUtils.getIdentifiers;
import java.util.ArrayList;
import java.util.Collection;
@@ -54,16 +53,10 @@
import org.hisp.dhis.common.GridHeader;
import org.hisp.dhis.common.IdentifiableObject;
import org.hisp.dhis.common.NameableObject;
-import org.hisp.dhis.completeness.DataSetCompletenessService;
-import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementCategoryOption;
-import org.hisp.dhis.datamart.DataMartService;
-import org.hisp.dhis.dataset.DataSet;
import org.hisp.dhis.i18n.I18nFormat;
-import org.hisp.dhis.indicator.Indicator;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.period.Period;
import org.hisp.dhis.period.PeriodService;
import org.hisp.dhis.report.ReportService;
import org.hisp.dhis.reporttable.ReportTable;
@@ -127,46 +120,10 @@
this.organisationUnitService = organisationUnitService;
}
- private DataMartService dataMartService;
-
- public void setDataMartService( DataMartService dataMartService )
- {
- this.dataMartService = dataMartService;
- }
-
- private DataSetCompletenessService completenessService;
-
- public void setCompletenessService( DataSetCompletenessService completenessService )
- {
- this.completenessService = completenessService;
- }
-
// -------------------------------------------------------------------------
// ReportTableService implementation
// -------------------------------------------------------------------------
- public void populateReportTableDataMart( int id, String mode, Date reportingPeriod, Integer organisationUnitId,
- I18nFormat format )
- {
- ReportTable reportTable = getReportTable( id, mode );
-
- reportTable = initDynamicMetaObjects( reportTable, reportingPeriod, organisationUnitId, format );
-
- if ( reportTable.hasDataElements() || reportTable.hasIndicators() )
- {
- dataMartService.export( getIdentifiers( DataElement.class, reportTable.getDataElements() ), getIdentifiers(
- Indicator.class, reportTable.getIndicators() ), getIdentifiers( Period.class, reportTable
- .getAllPeriods() ), getIdentifiers( OrganisationUnit.class, reportTable.getAllUnits() ) );
- }
-
- if ( reportTable.hasDataSets() )
- {
- completenessService.exportDataSetCompleteness( getIdentifiers( DataSet.class, reportTable.getDataSets() ),
- getIdentifiers( Period.class, reportTable.getAllPeriods() ), getIdentifiers( OrganisationUnit.class,
- reportTable.getAllUnits() ) );
- }
- }
-
public Grid getReportTableGrid( String uid, I18nFormat format, Date reportingPeriod, String organisationUnitUid )
{
ReportTable reportTable = getReportTable( uid );
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml 2012-02-05 13:28:15 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml 2012-02-12 12:21:49 +0000
@@ -7,12 +7,6 @@
<!-- ReportTable -->
- <bean id="internal-process-ReportTable" class="org.hisp.dhis.reporttable.ReportTableInternalProcess" scope="prototype">
- <property name="statementManager" ref="statementManager" />
- <property name="inMemoryStatementManager" ref="inMemoryStatementManager" />
- <property name="reportTableService" ref="org.hisp.dhis.reporttable.ReportTableService" />
- </bean>
-
<bean id="org.hisp.dhis.reporttable.jdbc.ReportTableManager" class="org.hisp.dhis.reporttable.jdbc.JDBCReportTableManager">
<property name="jdbcTemplate" ref="jdbcTemplate" />
<property name="aggregationService" ref="org.hisp.dhis.aggregation.AggregationService" />
@@ -31,8 +25,6 @@
<property name="reportService" ref="org.hisp.dhis.report.ReportService" />
<property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
<property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
- <property name="dataMartService" ref="org.hisp.dhis.datamart.DataMartService" />
- <property name="completenessService" ref="registrationDataCompletenessService" />
</bean>
<!-- Report -->
=== removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/CreateTableAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/CreateTableAction.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/CreateTableAction.java 1970-01-01 00:00:00 +0000
@@ -1,136 +0,0 @@
-package org.hisp.dhis.reporting.tablecreator.action;
-
-/*
- * Copyright (c) 2004-2012, 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 static org.hisp.dhis.reporttable.ReportTableInternalProcess.PROCESS_TYPE;
-import static org.hisp.dhis.util.InternalProcessUtil.PROCESS_KEY_REPORT;
-import static org.hisp.dhis.util.InternalProcessUtil.setCurrentRunningProcess;
-
-import java.util.Date;
-
-import org.amplecode.cave.process.ProcessCoordinator;
-import org.amplecode.cave.process.ProcessExecutor;
-import org.hisp.dhis.i18n.I18nFormat;
-import org.hisp.dhis.reporttable.ReportTableInternalProcess;
-import org.hisp.dhis.system.util.DateUtils;
-import org.hisp.dhis.user.CurrentUserService;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class CreateTableAction
- implements Action
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private ProcessCoordinator processCoordinator;
-
- public void setProcessCoordinator( ProcessCoordinator processCoordinator )
- {
- this.processCoordinator = processCoordinator;
- }
-
- private CurrentUserService currentUserService;
-
- public void setCurrentUserService( CurrentUserService currentUserService )
- {
- this.currentUserService = currentUserService;
- }
-
- private I18nFormat format;
-
- public void setFormat( I18nFormat format )
- {
- this.format = format;
- }
-
- // -------------------------------------------------------------------------
- // Input
- // -------------------------------------------------------------------------
-
- private Integer id;
-
- public void setId( Integer id )
- {
- this.id = id;
- }
-
- private String mode;
-
- public void setMode( String mode )
- {
- this.mode = mode;
- }
-
- private String reportingPeriod;
-
- public void setReportingPeriod( String reportingPeriod )
- {
- this.reportingPeriod = reportingPeriod;
- }
-
- private Integer organisationUnitId;
-
- public void setOrganisationUnitId( Integer organisationUnitId )
- {
- this.organisationUnitId = organisationUnitId;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- public String execute()
- throws Exception
- {
- String owner = currentUserService.getCurrentUsername();
-
- ProcessExecutor executor = processCoordinator.newProcess( PROCESS_TYPE, owner );
-
- ReportTableInternalProcess process = (ReportTableInternalProcess) executor.getProcess();
-
- Date date = reportingPeriod != null ? DateUtils.getMediumDate( reportingPeriod ) : new Date();
-
- process.setId( id );
- process.setMode( mode );
- process.setReportingPeriod( date );
- process.setOrganisationUnitId( organisationUnitId );
- process.setFormat( format );
-
- processCoordinator.requestProcessExecution( executor );
-
- setCurrentRunningProcess( PROCESS_KEY_REPORT, executor.getId() );
-
- return SUCCESS;
- }
-}
=== removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GetStatusAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GetStatusAction.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GetStatusAction.java 1970-01-01 00:00:00 +0000
@@ -1,109 +0,0 @@
-package org.hisp.dhis.reporting.tablecreator.action;
-
-/*
- * Copyright (c) 2004-2012, 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 static org.hisp.dhis.util.InternalProcessUtil.PROCESS_KEY_REPORT;
-import static org.hisp.dhis.util.InternalProcessUtil.getCurrentRunningProcess;
-import static org.hisp.dhis.util.InternalProcessUtil.processIsRunning;
-
-import org.amplecode.cave.process.ProcessCoordinator;
-import org.amplecode.cave.process.ProcessExecutor;
-import org.amplecode.cave.process.state.MessageState;
-import org.hisp.dhis.i18n.I18n;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class GetStatusAction
- implements Action
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private ProcessCoordinator processCoordinator;
-
- public void setProcessCoordinator( ProcessCoordinator processCoordinator )
- {
- this.processCoordinator = processCoordinator;
- }
-
- private I18n i18n;
-
- public void setI18n( I18n i18n )
- {
- this.i18n = i18n;
- }
-
- // -------------------------------------------------------------------------
- // Output
- // -------------------------------------------------------------------------
-
- private String message = "";
-
- public String getMessage()
- {
- return message;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- public String execute()
- {
- boolean finished = false;
-
- if ( processIsRunning( PROCESS_KEY_REPORT ) )
- {
- String id = getCurrentRunningProcess( PROCESS_KEY_REPORT );
-
- ProcessExecutor executor = processCoordinator.getProcess( id );
-
- if ( executor != null && executor.getProcess() != null && executor.getState() != null && executor.getState() instanceof MessageState )
- {
- MessageState state = (MessageState) executor.getState();
-
- message = i18n.getString( state.getMessage() );
-
- finished = state.isEnded();
- }
- }
- else
- {
- message = i18n.getString( "no_process_running" );
-
- finished = false;
- }
-
- return finished ? SUCCESS : INPUT;
- }
-}
=== 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 2012-02-05 13:28:15 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml 2012-02-12 12:21:49 +0000
@@ -83,12 +83,6 @@
<property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
</bean>
- <bean id="org.hisp.dhis.reporting.tablecreator.action.CreateTableAction" class="org.hisp.dhis.reporting.tablecreator.action.CreateTableAction"
- scope="prototype">
- <property name="processCoordinator" ref="processCoordinator" />
- <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
- </bean>
-
<bean id="org.hisp.dhis.reporting.tablecreator.action.GetReportParamsAction" class="org.hisp.dhis.reporting.tablecreator.action.GetReportParamsAction"
scope="prototype">
<property name="reportTableService" ref="org.hisp.dhis.reporttable.ReportTableService" />
@@ -109,11 +103,6 @@
<property name="reportTableService" ref="org.hisp.dhis.reporttable.ReportTableService" />
</bean>
- <bean id="org.hisp.dhis.reporting.tablecreator.action.GetStatusAction" class="org.hisp.dhis.reporting.tablecreator.action.GetStatusAction"
- scope="prototype">
- <property name="processCoordinator" ref="processCoordinator" />
- </bean>
-
<bean id="org.hisp.dhis.reporting.tablecreator.action.ValidateTableAction" class="org.hisp.dhis.reporting.tablecreator.action.ValidateTableAction"
scope="prototype">
<property name="reportTableService" ref="org.hisp.dhis.reporttable.ReportTableService" />
=== 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 2012-02-05 13:28:15 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml 2012-02-12 12:21:49 +0000
@@ -94,10 +94,6 @@
<param name="onExceptionReturn">plainTextError</param>
</action>
- <action name="createReportTable" class="org.hisp.dhis.reporting.tablecreator.action.CreateTableAction">
- <result name="success" type="redirect">displayViewReportForm.action</result>
- </action>
-
<action name="displayViewReportForm" class="org.hisp.dhis.reporting.reportviewer.action.GetAllReportsAction">
<result name="success" type="velocity">/main.vm</result>
<param name="menuTreeHeight">420</param>
@@ -157,11 +153,6 @@
<param name="requiredAuthorities">F_REPORTTABLE_ADD</param>
</action>
- <action name="createTable" class="org.hisp.dhis.reporting.tablecreator.action.CreateTableAction">
- <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
- <param name="onExceptionReturn">plainTextError</param>
- </action>
-
<action name="getReportParams" class="org.hisp.dhis.reporting.tablecreator.action.GetReportParamsAction">
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-reporting/inputReportParamsForm.vm</param>
@@ -182,12 +173,6 @@
<param name="onExceptionReturn">plainTextError</param>
</action>
- <action name="getStatus" class="org.hisp.dhis.reporting.tablecreator.action.GetStatusAction">
- <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
- <result name="input" type="velocity-json">/dhis-web-commons/ajax/jsonResponseInput.vm</result>
- <param name="onExceptionReturn">plainTextError</param>
- </action>
-
<action name="validateTable" class="org.hisp.dhis.reporting.tablecreator.action.ValidateTableAction">
<result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
<result name="input" type="velocity-json">/dhis-web-commons/ajax/jsonResponseInput.vm</result>
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/inputReportParamsForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/inputReportParamsForm.vm 2011-10-12 17:32:39 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/inputReportParamsForm.vm 2012-02-12 12:21:49 +0000
@@ -1,12 +1,12 @@
+
<script type="text/javascript">
jQuery(document).ready(function() {
#if( !$!reportParams.isSet() )
- generateReport( '' );
+ viewReport( '' );
#end
});
var i18n_process_completed = '$encoder.jsEscape( $i18n.getString( "process_completed" ), "'")';
- var i18n_please_wait = '$encoder.jsEscape( $i18n.getString( "please_wait" ), "'")';
var i18n_please_select_unit = '$encoder.jsEscape( $i18n.getString( "select_organisation_unit" ), "'")';
</script>
@@ -16,24 +16,7 @@
<input type="hidden" id="mode" name="mode" value="$!mode" />
<table>
- <!-- Data source -->
- #if ( $aggregationStrategy == "real_time" )
- <tr>
- <th>$i18n.getString( "method" )</th>
- </tr>
- <tr>
- <td>
- <select id="doDataMart" name="doDataMart" style="width:325px">
- <option value="true">$i18n.getString( "get_updated_data" )</a>
- <option value="false">$i18n.getString( "use_existing_data" )</a>
- </select>
- </td>
- </tr>
- <tr>
- <td colspan="4" style="height:10px"></td>
- </tr>
- #end
-
+
<!-- Reporting month -->
#if ( $!reportParams.isParamReportingMonth() )
@@ -86,12 +69,12 @@
<td>
#if( $!reportParams.isSet() )
#if ( $mode == "table" )
- <input type="button" value="$i18n.getString( 'get_report' )" onclick="generateReport( '' )" style="width:140px" />
+ <input type="button" value="$i18n.getString( 'get_report' )" onclick="viewReport( '' )" style="width:140px" />
<input type="button" value="$i18n.getString( 'back' )" onclick="javascript:window.location.href='displayManageTableForm.action'" style="width:140px" />
#elseif ( $mode == "report" )
- <input type="button" value="$i18n.getString( 'get_report' )" onclick="generateReport( 'pdf' )" style="width:140px" />
+ <input type="button" value="$i18n.getString( 'get_report' )" onclick="viewReport( 'pdf' )" style="width:140px" />
<input type="button" value="$i18n.getString( 'back' )" onclick="javascript:window.location.href='displayViewReportForm.action'" style="width:140px" /><br>
- <input type="button" value="$i18n.getString( 'get_report_as_xls' )" onclick="generateReport( 'xls' )" style="width:140px" />
+ <input type="button" value="$i18n.getString( 'get_report_as_xls' )" onclick="viewReport( 'xls' )" style="width:140px" />
#end
#end
</td>
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/generateReport.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/generateReport.js 2011-10-11 14:54:46 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/generateReport.js 2012-02-12 12:21:49 +0000
@@ -1,8 +1,6 @@
var MODE_REPORT = "report";
var MODE_TABLE = "table";
-var reportType;
-
// -----------------------------------------------------------------------------
// Report params
// -----------------------------------------------------------------------------
@@ -33,47 +31,15 @@
// Report
// -----------------------------------------------------------------------------
-function generateReport( type )
+function viewReport( type )
{
- reportType = type != null && type != "" ? type : "pdf";
+ var reportType = type != null && type != "" ? type : "pdf";
if ( validationError() )
{
return false;
}
-
- setWaitMessage( i18n_please_wait );
-
- var doDataMart = ( $( "#doDataMart" ).length && $( "#doDataMart" ).val() == "true" );
-
- if ( doDataMart )
- {
- $.get( "createTable.action?" + getUrlParams(), getReportStatus );
- }
- else
- {
- viewReport();
- }
-}
-
-function getReportStatus()
-{
- $.get( "getStatus.action", function( json )
- {
- if ( json.response == "success" ) // Finished
- {
- setMessage( i18n_process_completed );
- viewReport();
- }
- else
- {
- setTimeout( "getReportStatus();", 1500 );
- }
- } );
-}
-
-function viewReport( urlParams )
-{
+
var mode = $( "#mode" ).val();
setMessage( i18n_process_completed );
@@ -82,8 +48,7 @@
{
window.location.href = "renderReport.action?type=" + reportType + "&" + getUrlParams();
}
- else
- // MODE_TABLE
+ else // MODE_TABLE
{
window.location.href = "exportTable.action?type=html&" + getUrlParams();
}