dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #21333
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10059: Pivot table, changed document title. Analytics, improved exception handling.
------------------------------------------------------------
revno: 10059
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-03-07 22:00:55 +0100
message:
Pivot table, changed document title. Analytics, improved exception handling.
modified:
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/AnalyticsService.java
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java
dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/index.html
dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.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-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/AnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/AnalyticsService.java 2013-02-21 15:21:16 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/AnalyticsService.java 2013-03-07 21:00:55 +0000
@@ -35,14 +35,11 @@
public interface AnalyticsService
{
- Grid getAggregatedDataValues( DataQueryParams params )
- throws IllegalQueryException, Exception;
+ Grid getAggregatedDataValues( DataQueryParams params );
- Map<String, Double> getAggregatedDataValueMap( DataQueryParams params )
- throws IllegalQueryException, Exception;
+ Map<String, Double> getAggregatedDataValueMap( DataQueryParams params );
- Map<String, Double> getAggregatedCompletenessValueMap( DataQueryParams params )
- throws IllegalQueryException, Exception;
+ Map<String, Double> getAggregatedCompletenessValueMap( DataQueryParams params );
DataQueryParams getFromUrl( Set<String> dimensionParams, Set<String> filterParams,
AggregationType aggregationType, String measureCriteria, I18nFormat format );
=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java 2013-03-07 15:02:47 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java 2013-03-07 21:00:55 +0000
@@ -93,6 +93,7 @@
import org.hisp.dhis.period.comparator.PeriodComparator;
import org.hisp.dhis.system.grid.ListGrid;
import org.hisp.dhis.system.util.ConversionUtils;
+import org.hisp.dhis.system.util.DebugUtils;
import org.hisp.dhis.system.util.ListUtils;
import org.hisp.dhis.system.util.MathUtils;
import org.hisp.dhis.system.util.SystemUtils;
@@ -145,11 +146,8 @@
// Implementation
// -------------------------------------------------------------------------
- public Grid getAggregatedDataValues( DataQueryParams params )
- throws IllegalQueryException, Exception
+ public Grid getAggregatedDataValues( DataQueryParams params )
{
- log.info( "Query: " + params );
-
queryPlanner.validate( params );
params.conform();
@@ -326,19 +324,16 @@
}
public Map<String, Double> getAggregatedDataValueMap( DataQueryParams params )
- throws IllegalQueryException, Exception
{
return getAggregatedValueMap( params, ANALYTICS_TABLE_NAME );
}
public Map<String, Double> getAggregatedCompletenessValueMap( DataQueryParams params )
- throws IllegalQueryException, Exception
{
return getAggregatedValueMap( params, COMPLETENESS_TABLE_NAME );
}
private Map<String, Double> getAggregatedCompletenessTargetMap( DataQueryParams params )
- throws IllegalQueryException, Exception
{
return getAggregatedValueMap( params, COMPLETENESS_TARGET_TABLE_NAME );
}
@@ -348,8 +343,7 @@
* dimension key is a concatenation of the identifiers in for the dimensions
* separated by "-".
*/
- private Map<String, Double> getAggregatedValueMap( DataQueryParams params, String tableName )
- throws IllegalQueryException, Exception
+ private Map<String, Double> getAggregatedValueMap( DataQueryParams params, String tableName )
{
queryPlanner.validate( params );
@@ -372,11 +366,21 @@
for ( Future<Map<String, Double>> future : futures )
{
- Map<String, Double> taskValues = future.get();
-
- if ( taskValues != null )
- {
- map.putAll( taskValues );
+ try
+ {
+ Map<String, Double> taskValues = future.get();
+
+ if ( taskValues != null )
+ {
+ map.putAll( taskValues );
+ }
+ }
+ catch ( Exception ex )
+ {
+ log.error( DebugUtils.getStackTrace( ex ) );
+ log.error( DebugUtils.getStackTrace( ex.getCause() ) );
+
+ throw new RuntimeException( "Error during execution of aggregation query task", ex );
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/index.html'
--- dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/index.html 2013-01-17 13:13:00 +0000
+++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/index.html 2013-03-07 21:00:55 +0000
@@ -2,7 +2,7 @@
<html>
<head>
- <title>Web pivot</title>
+ <title>Pivot Table</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
=== modified file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js 2013-03-07 14:46:14 +0000
+++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js 2013-03-07 21:00:55 +0000
@@ -2973,11 +2973,11 @@
html = '';
html += '<div style="padding:20px">';
- html += '<div style="font-size:14px; padding-bottom:8px">Creating a table</div>';
+ html += '<div style="font-size:14px; padding-bottom:8px">Creating a pivot table</div>';
html += '<div style="' + liStyle + '">- Select items from any of the dimensions in the left menu</div>';
html += '<div style="' + liStyle + '">- Click "Layout" to arrange your dimensions on table rows and columns</div>';
html += '<div style="' + liStyle + '">- Click "<b>Update</b>" to create your table</div>';
- html += '<div style="font-size:14px; padding-top:20px; padding-bottom:8px">Working with a table</div>';
+ html += '<div style="font-size:14px; padding-top:20px; padding-bottom:8px">Working with a pivot table</div>';
html += '<div style="' + liStyle + '">- Click "Options" to hide sub-totals or empty rows, adjust font size and more</div>';
html += '<div style="' + liStyle + '">- Click "Favorites" to save your table for later use</div>';
html += '<div style="' + liStyle + '">- Click "Download" to save table data to your computer</div>';