dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #07424
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2111: Fix bug <637996> An Exception in Data Completeness Report
------------------------------------------------------------
revno: 2111
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: trunk
timestamp: Wed 2010-09-15 11:01:07 +0700
message:
Fix bug <637996> An Exception in Data Completeness Report
added:
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/dataCompletenessPDFError.vm
modified:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module_vi_VN.properties
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataBrowserError.vm
dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/completeness/action/GetDataCompletenessPDFAction.java
dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties
dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module_vi_VN.properties
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/viewDataCompletenessForm.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
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties 2010-09-07 07:47:42 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties 2010-09-15 04:01:07 +0000
@@ -300,4 +300,6 @@
organisation_unit_groups = Organisation unit groups
users = Users
remove_values_success = Remove values successfully
-no_hits = Hit(s)
\ No newline at end of file
+no_hits = Hit(s)
+error_occurred = An error has occurred.
+select_organisationunit = You must select an OrganisationUnit from the tree.
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module_vi_VN.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module_vi_VN.properties 2010-09-07 07:47:42 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module_vi_VN.properties 2010-09-15 04:01:07 +0000
@@ -276,4 +276,6 @@
view_tables_created = C\u00e1c b\u1ea3ng View \u0111\u01b0\u1ee3c t\u1ea1o
there_is_no_view_created = Kh\u00f4ng c\u00f3 b\u1ea3ng View n\u00e0o \u0111\u01b0\u1ee3c t\u1ea1o
organisation_unit_groups = Nh\u00f3m c\u00e1c \u0111\u01a1n v\u1ecb
-no_hits = l\u1ea7n nh\u1eadp
\ No newline at end of file
+no_hits = l\u1ea7n nh\u1eadp
+error_occurred = L\u1ed7i trong qu\u00e1 tr\u00ecnh tr\u00ecnh duy\u1ec7t d\u1eef li\u1ec7u.
+select_organisationunit = Vui l\u00f2ng ch\u1ecdn m\u1ed9t \u0111\u01a1n v\u1ecb trong c\u00e2y \u0111\u01a1n v\u1ecb.
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataBrowserError.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataBrowserError.vm 2009-08-24 13:55:25 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataBrowserError.vm 2010-09-15 04:01:07 +0000
@@ -1,9 +1,9 @@
-An error has occurred.
+$encoder.htmlEncode( $i18n.getString( "error_occurred" ) )
#if ( !$selectedUnit )
<br/>
<br/>
- You must select an OrganisationUnit from the tree.
+ $encoder.htmlEncode( $i18n.getString( "select_organisationunit" ) )
#end
-<a href="javascript: history.go(-1)">Back</a><br/>
\ No newline at end of file
+<a href="javascript: history.go(-1)">$encoder.htmlEncode( $i18n.getString( "back" ) )</a><br/>
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/completeness/action/GetDataCompletenessPDFAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/completeness/action/GetDataCompletenessPDFAction.java 2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/completeness/action/GetDataCompletenessPDFAction.java 2010-09-15 04:01:07 +0000
@@ -50,8 +50,9 @@
implements Action
{
private static final String KEY_DATA_COMPLETENESS = "dataSetCompletenessResults";
+
private static final String KEY_DATA_COMPLETENESS_DATASET = "dataSetCompletenessDataSet";
-
+
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
@@ -62,14 +63,14 @@
{
this.pdfService = pdfService;
}
-
+
private SelectionTreeManager selectionTreeManager;
public void setSelectionTreeManager( SelectionTreeManager selectionTreeManager )
{
this.selectionTreeManager = selectionTreeManager;
}
-
+
private I18n i18n;
public void setI18n( I18n i18n )
@@ -81,13 +82,15 @@
// Output
// -------------------------------------------------------------------------
+ private OrganisationUnit unit;
+
private InputStream inputStream;
public InputStream getInputStream()
{
return inputStream;
}
-
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -96,19 +99,24 @@
public String execute()
throws Exception
{
- Collection<DataSetCompletenessResult> results =
- (Collection<DataSetCompletenessResult>) SessionUtils.getSessionVar( KEY_DATA_COMPLETENESS );
-
+ Collection<DataSetCompletenessResult> results = (Collection<DataSetCompletenessResult>) SessionUtils
+ .getSessionVar( KEY_DATA_COMPLETENESS );
+
DataSet dataSet = (DataSet) SessionUtils.getSessionVar( KEY_DATA_COMPLETENESS_DATASET );
-
- OrganisationUnit unit = selectionTreeManager.getSelectedOrganisationUnit();
-
+
+ unit = selectionTreeManager.getSelectedOrganisationUnit();
+
+ if ( unit == null )
+ {
+ return ERROR;
+ }
+
ByteArrayOutputStream out = new ByteArrayOutputStream();
-
+
pdfService.writeDataSetCompletenessResult( results, out, i18n, unit, dataSet );
inputStream = new ByteArrayInputStream( out.toByteArray() );
-
+
return SUCCESS;
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties 2010-08-31 09:21:17 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties 2010-09-15 04:01:07 +0000
@@ -317,4 +317,6 @@
numerator_aggregation_operator = Numerator aggregation type
denominator_aggregation_operator = Denomirator aggregation type
numerator_formula = Numerator formula
-denominator_formula = Denominator formula
\ No newline at end of file
+denominator_formula = Denominator formula
+error_occurred = An error has occurred.
+select_organisationunit = You must select an OrganisationUnit from the tree.
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module_vi_VN.properties'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module_vi_VN.properties 2010-08-31 09:21:17 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module_vi_VN.properties 2010-09-15 04:01:07 +0000
@@ -163,4 +163,6 @@
numerator_aggregation_operator = Ki\u1ec3u s\u1ed1 li\u1ec7u t\u1ed5ng h\u1ee3p cho t\u1eed s\u1ed1
denominator_aggregation_operator = Ki\u1ec3u s\u1ed1 li\u1ec7u t\u1ed5ng h\u1ee3p cho m\u1eabu s\u1ed1
numerator_formula = C\u00f4ng th\u1ee9c t\u1eed s\u1ed1
-denominator_formula = C\u00f4ng th\u1ee9c m\u1eabu s\u1ed1
\ No newline at end of file
+denominator_formula = C\u00f4ng th\u1ee9c m\u1eabu s\u1ed1
+error_occurred = L\u1ed7i trong qu\u00e1 tr\u00ecnh tr\u00ecnh duy\u1ec7t d\u1eef li\u1ec7u.
+select_organisationunit = Vui l\u00f2ng ch\u1ecdn m\u1ed9t \u0111\u01a1n v\u1ecb trong c\u00e2y \u0111\u01a1n v\u1ecb.
\ No newline at end of file
=== 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 2010-07-25 13:53:50 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml 2010-09-15 04:01:07 +0000
@@ -333,8 +333,16 @@
<param name="contentDisposition">filename="DataCompletenessReport.pdf"</param>
<param name="bufferSize">10240</param>
</result>
+ <result name="error" type="redirect">dataCompletenessPDFError.action</result>
</action>
+ <action name="dataCompletenessPDFError" class="org.hisp.dhis.reporting.action.NoAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-reporting/dataCompletenessPDFError.vm</param>
+ <param name="menu">/dhis-web-reporting/menu.vm</param>
+ </action>
+
+
<action name="getDataCompletenessWorkbook" class="org.hisp.dhis.reporting.completeness.action.GetDataCompletenessWorkbookAction">
<result name="success" type="stream">
<param name="contentType">application/vnd.ms-excel</param>
=== added file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/dataCompletenessPDFError.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/dataCompletenessPDFError.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/dataCompletenessPDFError.vm 2010-09-15 04:01:07 +0000
@@ -0,0 +1,9 @@
+$encoder.htmlEncode( $i18n.getString( "error_occurred" ) )
+
+#if ( !$unit )
+ <br/>
+ <br/>
+ $encoder.htmlEncode( $i18n.getString( "select_organisationunit" ) )
+#end
+
+<a href="javascript: history.go(-1)">$encoder.htmlEncode( $i18n.getString( "back" ) )</a><br/>
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDataCompletenessForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDataCompletenessForm.vm 2010-09-04 13:07:00 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDataCompletenessForm.vm 2010-09-15 04:01:07 +0000
@@ -18,17 +18,17 @@
<td></td>
<td valign="bottom">
<input type="button" value="$i18n.getString( 'configuration' )" style="width:150px"
- onclick="window.location.href='displayConfigureDataCompletenessForm.action'"><br>
+ onclick="window.location.href='displayConfigureDataCompletenessForm.action'"/><br>
<input type="button" value="$i18n.getString( 'generate_pdf' )" style="width:150px"
- onclick="window.location.href='getDataCompletenessPDF.action'"><input
+ onclick="window.location.href='getDataCompletenessPDF.action'"/><input
type="button" value="$i18n.getString( 'generate_workbook' )" style="width:150px"
- onclick="window.location.href='getDataCompletenessWorkbook.action'"><br><br>
+ onclick="window.location.href='getDataCompletenessWorkbook.action'"/><br><br>
- <input type="radio" name="criteria" id="registrationRadio" value="registration" checked="checked" onclick="displayCompleteness()">
+ <input type="radio" name="criteria" id="registrationRadio" value="registration" checked="checked" onclick="displayCompleteness()"/>
<label for="registrationRadio">$i18n.getString( 'based_on_registration' )</label><br>
- <input type="radio" name="criteria" id="compulsoryRadio" value="compulsory" onclick="displayCompleteness()">
+ <input type="radio" name="criteria" id="compulsoryRadio" value="compulsory" onclick="displayCompleteness()"/>
<label for="compulsoryRadio">$i18n.getString( 'based_on_compulsory' )</label><br>
- <input type="radio" name="criteria" id="ratioRadio" value="ratio" onclick="displayCompleteness()">
+ <input type="radio" name="criteria" id="ratioRadio" value="ratio" onclick="displayCompleteness()"/>
<label for="ratioRadio">$i18n.getString( 'based_on_ratio' )</label><br><br>
<!-- DataSet -->
@@ -42,8 +42,8 @@
<!-- PeriodType -->
- <input type="button" style="width:50px" value="$i18n.getString( 'prev' )" onclick="getAvailablePeriods( 'periodType', 'periodId', 'periodId', '-1' )"><input
- type="button" style="width:50px" value="$i18n.getString( 'next' )" onclick="getAvailablePeriods( 'periodType', 'periodId', 'periodId', '1' )">
+ <input type="button" style="width:50px" value="$i18n.getString( 'prev' )" onclick="getAvailablePeriods( 'periodType', 'periodId', 'periodId', '-1' )"/>
+ <input type="button" style="width:50px" value="$i18n.getString( 'next' )" onclick="getAvailablePeriods( 'periodType', 'periodId', 'periodId', '1' )"/>
<select id="periodType" name="periodType" style="min-width:222px" onchange="getAvailablePeriods( 'periodType', 'periodId', 'periodId', '0' )">
<option value="">[ $i18n.getString( "select_period_type_all" ) ]</option>
#foreach ( $type in $periodTypes )