=== 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 dataelements, indicators, and datasets. - * @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 @@ - - - - - - @@ -31,8 +25,6 @@ - - === 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 @@ - - - - - @@ -109,11 +103,6 @@ - - - - === 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 @@ plainTextError - - displayViewReportForm.action - - /main.vm 420 @@ -157,11 +153,6 @@ F_REPORTTABLE_ADD - - /dhis-web-commons/ajax/jsonResponseSuccess.vm - plainTextError - - /main.vm /dhis-web-reporting/inputReportParamsForm.vm @@ -182,12 +173,6 @@ plainTextError - - /dhis-web-commons/ajax/jsonResponseSuccess.vm - /dhis-web-commons/ajax/jsonResponseInput.vm - plainTextError - - /dhis-web-commons/ajax/jsonResponseSuccess.vm /dhis-web-commons/ajax/jsonResponseInput.vm === 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 @@ + @@ -16,24 +16,7 @@ - - #if ( $aggregationStrategy == "real_time" ) - - - - - - - - - - #end - + #if ( $!reportParams.isParamReportingMonth() ) @@ -86,12 +69,12 @@ === 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(); }
$i18n.getString( "method" )
- -
#if( $!reportParams.isSet() ) #if ( $mode == "table" ) - + #elseif ( $mode == "report" ) - +
- + #end #end