dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #04726
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1578: Improved state handling in internal processes.
------------------------------------------------------------
revno: 1578
committer: Lars Helge Oeverland <larshelge@xxxxxxxxx>
branch nick: trunk
timestamp: Mon 2010-03-08 15:50:40 +0100
message:
Improved state handling in internal processes.
modified:
dhis-2/dhis-options/src/main/resources/help_content.xml
dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/DataMartInternalProcess.java
dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/engine/DefaultDataMartEngine.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ImportInternalProcess.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ImportPreviewInternalProcess.java
dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/completeness/DataSetCompletenessInternalProcess.java
dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/completeness/jdbc/JDBCDataSetCompletenessStore.java
dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/ReportTableInternalProcess.java
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/process/AbstractStatementInternalProcess.java
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/i18n/translate.vm
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/popup.vm
dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties
dhis-2/dhis-web/dhis-web-importexport/src/main/resources/org/hisp/dhis/importexport/i18n_module.properties
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editCustomValues.vm
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/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-options/src/main/resources/help_content.xml'
--- dhis-2/dhis-options/src/main/resources/help_content.xml 2010-03-01 13:40:08 +0000
+++ dhis-2/dhis-options/src/main/resources/help_content.xml 2010-03-08 14:50:40 +0000
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<book>
<chapter>
<title>Data elements and indicators</title>
@@ -394,7 +394,7 @@
</section>
</section>
<section id="dataDictionary">
- <title>Data dictionary</title>
+ <title>Data dictionaries</title>
<para>Data dictionaries are used to group data elements and indicators during filtering operations. They are useful for combining related groups of data elements and indicators according to the programs to which they belong. For instance a data dictionary called "MCH" could be created, and all maternal and child health data elements and indicators could be added to the dictionary. The data dictionary can be access by choosing Maintenance->Data elements and indicators->Data dictionary. The following screen will be displayed in the browser. </para>
<screenshot>
<mediaobject>
@@ -404,7 +404,12 @@
</mediaobject>
</screenshot>
<para>Provide a name for the data dictionary in the "Name" field and a description of its contents. Data elements and indicators can be added or removed from the dictionary. Click "Save" if you are creating a new data dictionary or "Add" if you are editing the contents of an existing data dictionary. </para>
- </section>
+ </section>
+ <section id="translation">
+ <title>Translations</title>
+ <para>DHIS 2 provides functionality for translations of data element, data element group, indicator, indicator group, and data element category names. These elements can be translated to any number of locales. A locale represents a specific geographical, political, or cultural region. </para>
+ <para>To add a translation click the Translate icon next to the element you would like to translate. Start by selecting the desired locale from the Locale select box. If your locale is not in the list you need to add it first. Fill in locale language and locale country code. The locale language is a lower-case, two-letter valid ISO Language Code. The locale country is a upper-case, two-letter valid ISO Country Code. Then in the Translate section, select your locale, then enter values for the avaliable element properties. You can select the reference locale, that is the locale the current element is displayed in, from the select box to the right. Translations can be enabled by selecting the desired locale under Database Language under User Settings in the Settings module.</para>
+ </section>
</chapter>
<chapter>
<title>Data Administration</title>
=== modified file 'dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/DataMartInternalProcess.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/DataMartInternalProcess.java 2010-03-04 11:55:58 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/DataMartInternalProcess.java 2010-03-08 14:50:40 +0000
@@ -122,6 +122,18 @@
{
dataMartEngine.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds, getState() );
}
+
+ @Override
+ protected String getStartMessage()
+ {
+ return "export_process_started";
+ }
+
+ @Override
+ protected String getSuccessMessage()
+ {
+ return "export_process_done";
+ }
@Override
protected String getErrorMessage()
=== modified file 'dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/engine/DefaultDataMartEngine.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/engine/DefaultDataMartEngine.java 2010-03-04 11:55:58 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/engine/DefaultDataMartEngine.java 2010-03-08 14:50:40 +0000
@@ -186,10 +186,6 @@
{
int count = 0;
- state.setMessage( "export_process_started" );
-
- log.info( "Export process started" );
-
TimeUtils.start();
state.setMessage( "deleting_existing_aggregated_data" );
@@ -326,8 +322,6 @@
TimeUtils.stop();
- state.setMessage( "export_process_done" );
-
aggregationCache.clearCache();
return count;
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ImportInternalProcess.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ImportInternalProcess.java 2010-03-04 11:55:58 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ImportInternalProcess.java 2010-03-08 14:50:40 +0000
@@ -30,8 +30,6 @@
import java.io.InputStream;
import org.amplecode.cave.process.SerialToGroup;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.hisp.dhis.system.process.AbstractStatementInternalProcess;
/**
@@ -42,7 +40,6 @@
extends AbstractStatementInternalProcess implements SerialToGroup
{
private static final String PROCESS_GROUP = "ImportProcessGroup";
- private static final Log log = LogFactory.getLog( ImportInternalProcess.class );
// -------------------------------------------------------------------------
// Properties
@@ -89,13 +86,19 @@
public void executeStatements()
throws Exception
{
- getState().setMessage( "import_process_started" );
- log.info( "Import process started" );
-
importService.importData( params, inputStream, getState() );
-
- getState().setMessage( "import_process_done" );
- log.info( "Import process done" );
+ }
+
+ @Override
+ protected String getStartMessage()
+ {
+ return "import_process_started";
+ }
+
+ @Override
+ protected String getSuccessMessage()
+ {
+ return "import_process_done";
}
@Override
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ImportPreviewInternalProcess.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ImportPreviewInternalProcess.java 2010-03-04 11:55:58 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ImportPreviewInternalProcess.java 2010-03-08 14:50:40 +0000
@@ -28,8 +28,6 @@
*/
import org.amplecode.cave.process.SerialToGroup;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.hisp.dhis.system.process.AbstractStatementInternalProcess;
/**
@@ -40,7 +38,6 @@
extends AbstractStatementInternalProcess implements SerialToGroup
{
private static final String PROCESS_GROUP = "ImportProcessGroup";
- private static final Log log = LogFactory.getLog( ImportPreviewInternalProcess.class );
// -------------------------------------------------------------------------
// Dependencies
@@ -69,12 +66,19 @@
public void executeStatements()
throws Exception
{
- getState().setMessage( "preview_process_started" );
- log.info( "Preview process started" );
-
- importObjectService.importAll();
-
- log.info( "Preview process completed" );
+ importObjectService.importAll();
+ }
+
+ @Override
+ protected String getStartMessage()
+ {
+ return "preview_process_started";
+ }
+
+ @Override
+ protected String getSuccessMessage()
+ {
+ return "preview_process_done";
}
@Override
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/completeness/DataSetCompletenessInternalProcess.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/completeness/DataSetCompletenessInternalProcess.java 2010-03-04 11:55:58 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/completeness/DataSetCompletenessInternalProcess.java 2010-03-08 14:50:40 +0000
@@ -104,10 +104,22 @@
{
completenessService.exportDataSetCompleteness( dataSetIds, periodIds, organisationUnitIds, reportTableId );
}
+
+ @Override
+ protected String getStartMessage()
+ {
+ return "data_completeness_process_started";
+ }
+
+ @Override
+ protected String getSuccessMessage()
+ {
+ return "data_completeness_process_done";
+ }
@Override
public String getErrorMessage()
{
- return "export_process_failed";
+ return "data_completeness_process_failed";
}
}
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/completeness/jdbc/JDBCDataSetCompletenessStore.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/completeness/jdbc/JDBCDataSetCompletenessStore.java 2010-02-02 13:28:31 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/completeness/jdbc/JDBCDataSetCompletenessStore.java 2010-03-08 14:50:40 +0000
@@ -120,6 +120,8 @@
"GROUP BY sourceid ) AS completed " +
"WHERE completed.no = " + compulsoryElements;
+ System.out.println( sql );
+
return statementManager.getHolder().queryForInteger( sql );
}
}
=== modified 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 2010-03-04 11:55:58 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/ReportTableInternalProcess.java 2010-03-08 14:50:40 +0000
@@ -118,6 +118,18 @@
{
reportTableService.createReportTables( id, mode, reportingPeriod, parentOrganisationUnitId, organisationUnitId, format );
}
+
+ @Override
+ protected String getStartMessage()
+ {
+ return "report_table_process_started";
+ }
+
+ @Override
+ protected String getSuccessMessage()
+ {
+ return "report_table_process_done";
+ }
@Override
public String getErrorMessage()
=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/process/AbstractStatementInternalProcess.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/process/AbstractStatementInternalProcess.java 2010-03-04 12:22:49 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/process/AbstractStatementInternalProcess.java 2010-03-08 14:50:40 +0000
@@ -79,21 +79,29 @@
statementManager.initialise();
+ getState().setMessage( getStartMessage() );
+
+ log.info( "Internal process started" );
+
try
{
executeStatements();
+
+ getState().setMessage( getSuccessMessage() );
+
+ log.info( "Internal process completed successfully" );
}
catch ( Exception ex )
{
getState().setMessage( getErrorMessage() );
- log.error( ex );
+ log.error( "Internal process failed", ex );
log.error( DebugUtils.getStackTrace( ex ) );
ex.printStackTrace();
}
finally
- {
+ {
statementManager.destroy();
}
}
@@ -104,8 +112,9 @@
protected abstract void executeStatements()
throws Exception;
- /**
- * Returns a user friendly error message.
- */
+ protected abstract String getStartMessage();
+
+ protected abstract String getSuccessMessage();
+
protected abstract String getErrorMessage();
}
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/i18n/translate.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/i18n/translate.vm 2009-11-08 21:25:09 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/i18n/translate.vm 2010-03-08 14:50:40 +0000
@@ -1,6 +1,6 @@
<form id="translateForm" action="translate.action" method="post">
-<h3>$i18n.getString( "translation_translate" )</h3>
+<h3>$i18n.getString( "translation_translate" ) #openHelp( "translation" )</h3>
<div>
<input type="hidden" id="id" name="id" value="$objectId">
@@ -49,7 +49,7 @@
</tr>
</table>
</form>
-<h3>$i18n.getString( "translation_addlocale") #openHelp( "dhis-web-commons.locale" )</h3>
+<h3>$i18n.getString( "translation_addlocale")</h3>
<table>
<tr>
<th colspan="2">Details</th>
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/popup.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/popup.vm 2010-02-28 03:32:13 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/popup.vm 2010-03-08 14:50:40 +0000
@@ -18,9 +18,6 @@
#foreach( $stylesheet in $stylesheets )
<link rel="stylesheet" type="text/css" href="$stylesheet">
#end
-
-
-
</head>
<body>
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties 2010-02-25 18:35:33 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties 2010-03-08 14:50:40 +0000
@@ -235,17 +235,6 @@
yes_no = Yes/No
number = NumberWS
-#-- Help ----------------------------------------------------------------------#
-
-help.dhis-web-reporting.datacompleteness.general = Data completeness
-help.dhis-web-reporting.datacompleteness.general.content = The data completeness reporting functionality provides information on the degree of completeness of the reported data, based on user registrations of completely filled data sets.
-
-help.dhis-web-maintenance-dataset.datasetcustomvalue = Custom values
-help.dhis-web-maintenance-dataset.datasetcustomvalue.content = <b>Purpose</b><br>Custom Values are predefied data entry values. Custom Values appear in the form of a drop down box, where you can select a value from the list for the current Data Element.<p><b>How to manage Custom Values</b><br>You will see four selection areas and number of buttons to manage Custom Values. First box <b>"Available Data Elements"</b> lists all Data Elements for selected Data Set. Second box <b>"Available Category Options"</b> will list Available Category Options upon selection of Data Element from first box. If Data Element has only <b>default</b> Category Option, it will be automatically selected and any Custom Value selected for it will be listed in box four - <b>"Selected Custom Values"</b>. Box three - <b>Suggested Custom Values</b> will list possible values from existing Custom Values as user types new Custom Value text. Adding/Deleting are explained in their respective help content next to control. All actions will produce message, messages are shown at the end of form and their background colour will change depending on failure or success of action. System prevents errors by providing useful messages.
-
-help.dhis-web-commons.locale = Add locale
-help.dhis-web-commons.locale.content = A Locale object represents a specific geographical, political, or cultural region. The language is a lower-case, two-letter valid ISO Language Code. The country is a upper-case, two-letter valid ISO Country Code. You can later add translations for a registered locale.
-
#-- User account ----------------------------------------------------------------------#
update_user = Update user
=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/resources/org/hisp/dhis/importexport/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/resources/org/hisp/dhis/importexport/i18n_module.properties 2010-03-04 11:55:58 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/resources/org/hisp/dhis/importexport/i18n_module.properties 2010-03-08 14:50:40 +0000
@@ -436,6 +436,7 @@
routine_data_contains_values_out_of_range = Routine data values out of range (2^31) exist
semi_permanent_data_contains_values_out_of_range = Semi-permanent data value out of range (2^31) exist
preview_process_started = Preview process started
+preview_process_done = Preview process done
configuration = Configuration
intro_DHIS14_xml_import = Do an import from an XML based format. DHIS 1.4 is the predecessor of DHIS 2.
intro_DHIS14_file_import = Do an import from an Access data file. DHIS 1.4 is the predecessor of DHIS 2.
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editCustomValues.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editCustomValues.vm 2009-11-03 09:05:08 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editCustomValues.vm 2010-03-08 14:50:40 +0000
@@ -704,8 +704,7 @@
<td><input type="text" name="newCustomValue" id="newCustomValue" onkeydown="findSimilar()" maxlength="160" style="min-width:25em" size="60"/>
</td>
<td>
- <button type="button" onclick="addNew()">$i18n.getString( "add_new_custom_value" )</button>
- #openHelp( "dhis-web-maintenance-dataset.datasetcustomvalue" )
+ <button type="button" onclick="addNew()">$i18n.getString( "add_new_custom_value" )</button>
</td>
</tr>
</tbody>
=== 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-03-04 11:55:58 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties 2010-03-08 14:50:40 +0000
@@ -278,8 +278,13 @@
configuration = Configuration
based_on_subjective = Based on complete data set registrations
based_on_objective = Based on compulsory data elements
+report_table_process_started = Report table process started
+report_table_process_done = Report table process done
report_table_process_failed = Report table process failed - See log for details
export_process_failed = Export process failed - See log for details
+data_completeness_process_started = Data completeness process started
+data_completeness_process_done = Data completeness process done
+data_completeness_process_failed = Data completeness process failed - See log for details
intro_standard_report = View and add standard reports. These reports can be based on report tables and can be designed in BIRT or JasperReports.
intro_dataset_report = View data set reports. These reports are based on data entry screens and will produce a report with aggregated data.
intro_static_report = View and add static reports. These reports can be uploaded documents or URLs on the web.
=== 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-02-02 13:21:02 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDataCompletenessForm.vm 2010-03-08 14:50:40 +0000
@@ -17,8 +17,7 @@
<td></td>
<td valign="bottom">
<input type="button" value="$i18n.getString( 'configuration' )" style="width:150px"
- onclick="window.location.href='displayConfigureDataCompletenessForm.action'">
- #openHelp( "dhis-web-reporting.datacompleteness.general" )<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
type="button" value="$i18n.getString( 'generate_workbook' )" style="width:150px"