dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #02419
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 811: change generate report use ajax loader
------------------------------------------------------------
revno: 811
committer: Tran Thanh Tri <Tran Thanh Tri@compaq>
branch nick: trunk
timestamp: Thu 2009-10-01 15:28:21 +0700
message:
change generate report use ajax loader
added:
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/DowloadExcelAction.java
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelItem.java
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/GenerateReportExcelCategoryAction.java
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/GenerateReportExcelNormalAction.java
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/GenerateReportExcelOrganizationGroupListingAction.java
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/GenerateReportExcelPeriodColumnListingAction.java
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/GenerateReportExcelSupport.java
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/SelectionManager.java
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/struts.xml
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/export.js
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/listDataElementGroup.vm
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/reportparams.vm
dhis-2/dhis-web/dhis-web-portal/pom.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 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelItem.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelItem.java 2009-09-15 13:18:11 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelItem.java 2009-10-01 08:28:21 +0000
@@ -184,7 +184,7 @@
public static class TYPE
{
- public static final String DATAELEMENT = "dataelement";
+ public static final String DATAELEMENT = "dataelement";
public static final String ORGANISATION = "organisation";
public static final String INDICATOR = "indicator";
public static final String CALCULATION = "calculation";
=== added file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/DowloadExcelAction.java'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/DowloadExcelAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/DowloadExcelAction.java 2009-10-01 08:28:21 +0000
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2004-2007, 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.
+ */
+package org.hisp.dhis.reportexcel.export.action;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Tran Thanh Tri
+ * @version $Id$
+ */
+public class DowloadExcelAction
+ implements Action
+{
+
+ private SelectionManager selectionManager;
+
+ private String outputXLS;
+
+ private InputStream inputStream;
+
+ public String getOutputXLS()
+ {
+ return outputXLS;
+ }
+
+ public InputStream getInputStream()
+ {
+ return inputStream;
+ }
+
+ public void setSelectionManager( SelectionManager selectionManager )
+ {
+ this.selectionManager = selectionManager;
+ }
+
+ public String execute()
+ throws Exception
+ {
+ File outputReportFile = new File(selectionManager.getReportExcelOutput());
+
+ outputXLS = outputReportFile.getName();
+
+ inputStream = new BufferedInputStream( new FileInputStream( outputReportFile ) );
+
+ return SUCCESS;
+ }
+
+}
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/GenerateReportExcelCategoryAction.java'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/GenerateReportExcelCategoryAction.java 2009-09-18 04:37:50 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/GenerateReportExcelCategoryAction.java 2009-10-01 08:28:21 +0000
@@ -26,8 +26,6 @@
*/
package org.hisp.dhis.reportexcel.export.action;
-import java.io.BufferedInputStream;
-import java.io.FileInputStream;
import java.util.Collection;
import jxl.write.WritableSheet;
@@ -75,16 +73,8 @@
this.generateOutPutFile( organisationUnit, reportExcelItems, reportExcel, sheet );
}
-
- outputReportWorkbook.write();
-
- outputReportWorkbook.close();
-
- outputXLS = outputReportFile.getName();
-
- inputStream = new BufferedInputStream( new FileInputStream( outputReportFile ) );
-
- outputReportFile.delete();
+
+ this.complete();
statementManager.destroy();
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/GenerateReportExcelNormalAction.java'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/GenerateReportExcelNormalAction.java 2009-09-17 07:12:56 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/GenerateReportExcelNormalAction.java 2009-10-01 08:28:21 +0000
@@ -26,8 +26,6 @@
*/
package org.hisp.dhis.reportexcel.export.action;
-import java.io.BufferedInputStream;
-import java.io.FileInputStream;
import java.util.Collection;
import jxl.write.WritableSheet;
@@ -71,19 +69,9 @@
this.generateOutPutFile( organisationUnit, reportExcelItems, sheet );
- }
-
- outputReportWorkbook.write();
-
- outputReportWorkbook.close();
-
- outputXLS = outputReportFile.getName();
-
- inputStream = new BufferedInputStream( new FileInputStream( outputReportFile ) );
-
- outputReportFile.delete();
-
- statementManager.destroy();
+ }
+
+ this.complete();
return SUCCESS;
}
@@ -109,7 +97,7 @@
ExcelUtils.writeValue( reportItem.getRow(), reportItem.getColumn(), String.valueOf( value ),
ExcelUtils.NUMBER, sheet, number );
}
- }
+ }
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/GenerateReportExcelOrganizationGroupListingAction.java'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/GenerateReportExcelOrganizationGroupListingAction.java 2009-09-18 02:04:21 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/GenerateReportExcelOrganizationGroupListingAction.java 2009-10-01 08:28:21 +0000
@@ -26,8 +26,6 @@
*/
package org.hisp.dhis.reportexcel.export.action;
-import java.io.BufferedInputStream;
-import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@@ -75,18 +73,10 @@
this.generateOutPutFile( reportExcel, reportExcelItems, organisationUnit, sheet );
- }
-
- outputReportWorkbook.write();
-
- outputReportWorkbook.close();
-
- outputXLS = outputReportFile.getName();
-
- inputStream = new BufferedInputStream( new FileInputStream( outputReportFile ) );
-
- outputReportFile.delete();
-
+ }
+
+ this.complete();
+
statementManager.destroy();
return SUCCESS;
@@ -119,9 +109,10 @@
ExcelUtils.TEXT, sheet, this.textChapterLeft );
}
else if ( reportItem.getItemType().equalsIgnoreCase( ReportExcelItem.TYPE.SERIAL )
- && (!organisationUnits.isEmpty()) ){
- ExcelUtils.writeValue( rowBegin, reportItem.getColumn(), chappter[chapperNo],
- ExcelUtils.TEXT, sheet, this.textChapterLeft );
+ && (!organisationUnits.isEmpty()) )
+ {
+ ExcelUtils.writeValue( rowBegin, reportItem.getColumn(), chappter[chapperNo], ExcelUtils.TEXT,
+ sheet, this.textChapterLeft );
}
chapperNo++;
rowBegin++;
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/GenerateReportExcelPeriodColumnListingAction.java'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/GenerateReportExcelPeriodColumnListingAction.java 2009-09-18 07:09:19 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/GenerateReportExcelPeriodColumnListingAction.java 2009-10-01 08:28:21 +0000
@@ -27,8 +27,6 @@
package org.hisp.dhis.reportexcel.export.action;
-import java.io.BufferedInputStream;
-import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
@@ -93,15 +91,7 @@
}
- outputReportWorkbook.write();
-
- outputReportWorkbook.close();
-
- outputXLS = outputReportFile.getName();
-
- inputStream = new BufferedInputStream( new FileInputStream( outputReportFile ) );
-
- outputReportFile.delete();
+ this.complete();
statementManager.destroy();
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/GenerateReportExcelSupport.java'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/GenerateReportExcelSupport.java 2009-09-18 07:09:19 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/GenerateReportExcelSupport.java 2009-10-01 08:28:21 +0000
@@ -73,7 +73,6 @@
import org.hisp.dhis.system.util.MathUtils;
import org.hisp.dhis.user.CurrentUserService;
-
import com.opensymphony.xwork2.Action;
/**
@@ -85,10 +84,10 @@
{
private static final String NULL_REPLACEMENT = "0";
-
- protected static final String[] chappter = {"I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX",
- "X","XI","XII", "XIII", "XIV", "XV", "XVI", "XVII", "XVIII", "XIX", "XX", "XXI", "XXII",
- "XXIII", "XXIV", "XXV","XXVI", "XXVII", "XXVIII", "XXIX", "XXX"};
+
+ protected static final String[] chappter = { "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI",
+ "XII", "XIII", "XIV", "XV", "XVI", "XVII", "XVIII", "XIX", "XX", "XXI", "XXII", "XXIII", "XXIV", "XXV", "XXVI",
+ "XXVII", "XXVIII", "XXIX", "XXX" };
// -------------------------------------------
// Dependency
@@ -408,6 +407,16 @@
}
+ public void complete()
+ throws IOException, WriteException
+ {
+ outputReportWorkbook.write();
+
+ outputReportWorkbook.close();
+
+ selectionManager.setReportExcelOutput( outputReportFile.getPath() );
+ }
+
protected String generateIndicatorExpression( ReportExcelItem reportItem, Date startDate, Date endDate,
OrganisationUnit organisationUnit )
{
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/SelectionManager.java'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/SelectionManager.java 2009-09-17 07:12:56 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/SelectionManager.java 2009-10-01 08:28:21 +0000
@@ -43,38 +43,40 @@
private static final String SELETED_PERIOD = "SELETED_PERIOD";
- private static final String SELETED_REPORT_EXCEL = "SELETED_REPORT_EXCEL";
-
- private static final String SELECTED_REPORT_EXCEL_ID = "SELECTED_REPORT_EXCEL_ID";
+ private static final String SELETED_REPORT_EXCEL = "SELETED_REPORT_EXCEL";
+
+ private static final String SELECTED_REPORT_EXCEL_ID = "SELECTED_REPORT_EXCEL_ID";
+
+ private static final String REPORTEXCEL_OUTPUT = "REPORTEXCEL_OUTPUT";
public Period getSelectedPeriod()
{
return (Period) getSession().get( SELETED_PERIOD );
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings( "unchecked" )
public void setSelectedPeriod( Period period )
{
getSession().put( SELETED_PERIOD, period );
}
-
+
public ReportExcel getSelectedReportExcel()
{
return (ReportExcel) getSession().get( SELETED_REPORT_EXCEL );
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings( "unchecked" )
public void setSelectedReportExcel( ReportExcel reportExcel )
{
getSession().put( SELETED_REPORT_EXCEL, reportExcel );
}
-
- @SuppressWarnings("unchecked")
+
+ @SuppressWarnings( "unchecked" )
public void setSelectedReportExcelId( Integer id )
{
getSession().put( SELECTED_REPORT_EXCEL_ID, id );
}
-
+
public Integer getSelectedReportExcelId()
{
return (Integer) getSession().get( SELECTED_REPORT_EXCEL_ID );
@@ -97,4 +99,15 @@
return ActionContext.getContext().getSession();
}
+ @SuppressWarnings( "unchecked" )
+ public void setReportExcelOutput( String path )
+ {
+ getSession().put( REPORTEXCEL_OUTPUT, path );
+ }
+
+ public String getReportExcelOutput()
+ {
+ return (String) getSession().get( REPORTEXCEL_OUTPUT );
+ }
+
}
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml 2009-09-30 07:03:26 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml 2009-10-01 08:28:21 +0000
@@ -329,6 +329,13 @@
<property name="selectionManager"
ref="org.hisp.dhis.reportexcel.export.action.SelectionManager" />
</bean>
+
+ <bean id="org.hisp.dhis.reportexcel.export.action.DowloadExcelAction"
+ class="org.hisp.dhis.reportexcel.export.action.DowloadExcelAction"
+ scope="prototype">
+ <property name="selectionManager"
+ ref="org.hisp.dhis.reportexcel.export.action.SelectionManager" />
+ </bean>
<bean
id="org.hisp.dhis.reportexcel.export.action.GetReportExcelsByGroupAction"
@@ -457,7 +464,7 @@
<property name="selectionManager"
ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
<property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
- </bean>
+ </bean>
<bean
id="org.hisp.dhis.reportexcel.dataentrystatus.action.AddDataEntryStatusAction"
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/struts.xml 2009-09-30 07:03:26 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/struts.xml 2009-10-01 08:28:21 +0000
@@ -36,7 +36,7 @@
<result name="success" type="redirect">administration.action
</result>
<param name="requiredAuthorities">F_EXCEL_REPORT_ADMINISTRATION</param>
- </action>
+ </action>
<action name="openAdministrator"
class="org.hisp.dhis.reportexcel.configuration.action.NoAction">
@@ -44,7 +44,7 @@
<param name="page">/dhis-web-excel-reporting/viewAdministrator.vm</param>
<param name="menu">/dhis-web-excel-reporting/menu.vm</param>
<param name="requiredAuthorities">F_EXCEL_REPORT_ADMINISTRATION</param>
- </action>
+ </action>
<!-- REPORT EXCEL CORE ACTION -->
@@ -398,52 +398,52 @@
class="org.hisp.dhis.reportexcel.export.action.GetMonthlyPeriodsAction">
<result name="success" type="velocity-xml">
/dhis-web-excel-reporting/responsePeriods.vm</result>
- </action>
+ </action>
+
+ <!-- Generate Report By Ajax -->
<action name="generateReportExcel"
class="org.hisp.dhis.reportexcel.export.action.GenerateReportExcelFlowAction">
- <result name="CATEGORY" type="chain">generateReportExcelCategory
+ <result name="CATEGORY" type="chain">
+ generateReportExcelCategoryAjax
</result>
- <result name="NORMAL" type="chain">generateReportExcelNormal
+ <result name="NORMAL" type="chain">
+ generateReportExcelNormalAjax
</result>
<result name="ORGANIZATION_GROUP_LISTING" type="chain">
- generateReportExcelOrganizationGroupListing</result>
+ generateReportExcelOrganizationGroupListingAjax
+ </result>
<result name="PERIOD_COLUMN_LISTING" type="chain">
- generateReportExcelPeriodColumnListing</result>
+ generateReportExcelPeriodColumnListingAjax
+ </result>
</action>
- <action name="generateReportExcelCategory"
+ <action name="generateReportExcelCategoryAjax"
class="org.hisp.dhis.reportexcel.export.action.GenerateReportExcelCategoryAction">
- <result name="success" type="stream">
- <param name="contentType">application/vnd.ms-excel</param>
- <param name="inputName">inputStream</param>
- <param name="contentDisposition">filename="${outputXLS}"</param>
- <param name="bufferSize">1024</param>
- </result>
+ <result name="success" type="velocity-xml">
+ /dhis-web-excel-reporting/responseSuccess.vm</result>
</action>
- <action name="generateReportExcelNormal"
+ <action name="generateReportExcelNormalAjax"
class="org.hisp.dhis.reportexcel.export.action.GenerateReportExcelNormalAction">
- <result name="success" type="stream">
- <param name="contentType">application/vnd.ms-excel</param>
- <param name="inputName">inputStream</param>
- <param name="contentDisposition">filename="${outputXLS}"</param>
- <param name="bufferSize">1024</param>
- </result>
+ <result name="success" type="velocity-xml">
+ /dhis-web-excel-reporting/responseSuccess.vm</result>
</action>
- <action name="generateReportExcelOrganizationGroupListing"
+ <action name="generateReportExcelOrganizationGroupListingAjax"
class="org.hisp.dhis.reportexcel.export.action.GenerateReportExcelOrganizationGroupListingAction">
- <result name="success" type="stream">
- <param name="contentType">application/vnd.ms-excel</param>
- <param name="inputName">inputStream</param>
- <param name="contentDisposition">filename="${outputXLS}"</param>
- <param name="bufferSize">1024</param>
- </result>
+ <result name="success" type="velocity-xml">
+ /dhis-web-excel-reporting/responseSuccess.vm</result>
</action>
- <action name="generateReportExcelPeriodColumnListing"
+ <action name="generateReportExcelPeriodColumnListingAjax"
class="org.hisp.dhis.reportexcel.export.action.GenerateReportExcelPeriodColumnListingAction">
+ <result name="success" type="velocity-xml">
+ /dhis-web-excel-reporting/responseSuccess.vm</result>
+ </action>
+
+ <action name="downloadExcelOutput"
+ class="org.hisp.dhis.reportexcel.export.action.DowloadExcelAction">
<result name="success" type="stream">
<param name="contentType">application/vnd.ms-excel</param>
<param name="inputName">inputStream</param>
@@ -452,7 +452,6 @@
</result>
</action>
-
<!-- DATA ENTRY STATUS ACTION -->
<action name="viewDataEntryStatus"
@@ -558,7 +557,7 @@
<!-- Preview report actions -->
-
+
<action name="validateGenerateReport"
class="org.hisp.dhis.reportexcel.export.action.ValidateGenerateReportAction">
<result name="success" type="velocity-xml">
@@ -566,16 +565,17 @@
<result name="error" type="velocity-xml">
/dhis-web-excel-reporting/responseError.vm</result>
</action>
-
+
<action name="openPreviewReport"
class="org.hisp.dhis.reportexcel.preview.action.OpenPreviewReportAction">
<result name="success" type="velocity">/popup.vm</result>
- <result name="input" type="velocity-xml">/dhis-web-excel-reporting/responseError.vm</result>
+ <result name="input" type="velocity-xml">
+ /dhis-web-excel-reporting/responseError.vm</result>
<param name="page">/dhis-web-excel-reporting/viewReportPreview.vm</param>
<param name="stylesheets">style/previewStyle.css</param>
<param name="javascripts">javascript/preview.js</param>
</action>
-
+
<action name="previewReportExcel"
class="org.hisp.dhis.reportexcel.export.action.GenerateReportExcelFlowAction">
<result name="CATEGORY" type="chain">
@@ -594,31 +594,37 @@
<action name="generatePreviewReportExcelCategory"
class="org.hisp.dhis.reportexcel.preview.action.GeneratePreviewReportExcelCategoryAction">
- <result name="success" type="chain">exportXMLChain</result>
+ <result name="success" type="chain">exportXMLChain
+ </result>
</action>
<action name="generatePreviewReportExcelNormal"
class="org.hisp.dhis.reportexcel.preview.action.GeneratePreviewReportExcelNormalAction">
- <result name="success" type="chain">exportXMLChain</result>
+ <result name="success" type="chain">exportXMLChain
+ </result>
</action>
<action name="generatePreviewReportExcelOrganizationGroupListing"
class="org.hisp.dhis.reportexcel.preview.action.GeneratePreviewReportExcelOrganizationGroupListingAction">
- <result name="success" type="chain">exportXMLChain</result>
+ <result name="success" type="chain">exportXMLChain
+ </result>
</action>
<action name="generatePreviewReportExcelPeriodColumnListing"
class="org.hisp.dhis.reportexcel.preview.action.GeneratePreviewReportExcelPeriodColumnListingAction">
- <result name="success" type="chain">exportXMLChain</result>
+ <result name="success" type="chain">exportXMLChain
+ </result>
</action>
-
- <action name="exportXMLChain"
+
+ <action name="exportXMLChain"
class="org.hisp.dhis.reportexcel.preview.action.ExportXMLAction">
- <result name="success" type="velocity-xml">/dhis-web-excel-reporting/responseReportPreview.vm</result>
- <result name="error" type="velocity-xml">/dhis-web-excel-reporting/responseError.vm</result>
+ <result name="success" type="velocity-xml">
+ /dhis-web-excel-reporting/responseReportPreview.vm</result>
+ <result name="error" type="velocity-xml">
+ /dhis-web-excel-reporting/responseError.vm</result>
<param name="stylesheets">style/previewStyle.css</param>
<param name="javascripts">javascript/preview.js</param>
</action>
-
+
</package>
</struts>
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/export.js'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/export.js 2009-09-30 07:03:26 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/export.js 2009-10-01 08:28:21 +0000
@@ -49,11 +49,16 @@
}
function generateReportExcel() {
-
- var reportId = $('#report').val();
- var periodId = $('#period').val();
- window.location = "generateReportExcel.action?reportId=" + reportId + "&periodId=" + periodId + "&reportType=category";
+ $("#loading").showAtCenter( true );
+ $.post("generateReportExcelAjax.action",{
+ reportId:$('#report').val(),
+ periodId:$('#period').val()
+ },function(data){
+ window.location = "downloadExcelOutput.action";
+ deleteDivEffect();
+ $("#loading").hide();
+ },'xml');
}
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/listDataElementGroup.vm'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/listDataElementGroup.vm 2009-09-25 06:10:21 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/listDataElementGroup.vm 2009-10-01 08:28:21 +0000
@@ -40,7 +40,7 @@
<form name="dataElementGroups" method="post">
<input type="hidden" name="id" value="$report.id"/>
<input type="hidden" name="dataElementGroupOrderId" id="dataElementGroupOrderId"/>
-<div id="dataElementGroups" style="position:fixed;display:none;width:700px;z-index:10001;background-color: white;border: medium solid silver;height:350px;padding:20px;">
+<div id="dataElementGroups" style="position:fixed;display:none;width:1000px;z-index:10001;background-color: white;border: medium solid silver;height:350px;padding:20px;">
<div id="close" style="position:absolute;top:2px;right:2px;cursor: pointer;color:red;" onclick="hideById('dataElementGroups');deleteDivEffect();">[x]</div>
<table>
<tr>
@@ -54,16 +54,16 @@
</table>
<br/><br/>
+ <div style="width:100%;overflow:auto">
<table width="100%">
<tr>
- <td>
+ <td colspan="3">
<select id="availableDataElementGroups" onchange="getDataElementsByGroup(this.value)" style="min-width:300px"></select>
- </td>
- <td></td>
+ </td>
</tr>
<tr>
<td>
- <select id="availableDataElements" multiple size=13 style="min-width:300px"></select>
+ <select id="availableDataElements" multiple size=13 style="min-width:300px" ondblclick="moveSelectedById('availableDataElements','selectedDataElements');"></select>
</td>
<td align="center">
<input type="button" value=">" onclick="moveSelectedById('availableDataElements','selectedDataElements');" style="width:50px"/><br>
@@ -72,10 +72,12 @@
<input type="button" value="<<" onclick="moveAllById('selectedDataElements' , 'availableDataElements' );" style="width:50px"/>
</td>
<td>
- <select id="selectedDataElements" name="dataElementIds" multiple size=13 style="min-width:300px"></select>
+ <select id="selectedDataElements" name="dataElementIds" multiple size=13 style="min-width:300px" ondblclick="moveSelectedById('selectedDataElements' , 'availableDataElements' );" ></select>
</td>
</tr>
</table>
+ </div>
+
<p align=center>
<input type="button" value="$i18n.getString( 'save' )" style="width:130px" onclick="submitDataElementGroupOrder()">
</p>
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/reportparams.vm'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/reportparams.vm 2009-09-30 07:03:26 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/reportparams.vm 2009-10-01 08:28:21 +0000
@@ -45,9 +45,13 @@
<hr>
<p>
<input type="button" value='$i18n.getString( "preview_report" )' onclick="javascript: generic_type = 'preview'; validateGenerateReport('$!i18n.getString("please_wait")');" #if(!$organisationUnit) disabled #end/>
-<input type="button" value='$i18n.getString( "generate_report" )' onclick="javascript: generic_type = ''; validateGenerateReport('$!i18n.getString("please_wait")');" #if(!$organisationUnit) disabled #end/>
+<input type="button" id="generate_report" value='$i18n.getString( "generate_report" )' onclick="generateReportExcel();" #if(!$organisationUnit) disabled #end/>
+
</p>
-<span id="info" style="display:none;top:70px;right:5px;position:fixed;" onclick="hideById(this.id)"></span>
+<span id="info" style="display:none;top:70px;right:5px;position:fixed;" onclick="hideById(this.id)">
+
+</span>
+<span id="loading" style="display:none;position:fixed;"><img src="../images/ajax-loader.gif" /></span>
<script>
#if($organisationUnit)
=== modified file 'dhis-2/dhis-web/dhis-web-portal/pom.xml'
--- dhis-2/dhis-web/dhis-web-portal/pom.xml 2009-09-28 19:33:22 +0000
+++ dhis-2/dhis-web/dhis-web-portal/pom.xml 2009-10-01 08:28:21 +0000
@@ -113,15 +113,14 @@
<artifactId>dhis-web-mapping</artifactId>
<version>${version}</version>
<type>war</type>
- </dependency>
- <!--
+ </dependency>
<dependency>
<groupId>org.hisp.dhis</groupId>
<artifactId>dhis-web-excel-reporting</artifactId>
<version>${version}</version>
<type>war</type>
</dependency>
- -->
+
<!-- India modules -->