← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16247: Data entry, void exploding indicators before loading to client as this is now handled on client. ...

 

------------------------------------------------------------
revno: 16247
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2014-07-26 19:33:42 +0200
message:
  Data entry, void exploding indicators before loading to client as this is now handled on client. Reduces size of transfer.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/expression/ExpressionService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/GetMetaDataAction.java


--
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/expression/ExpressionService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/expression/ExpressionService.java	2014-07-16 15:29:27 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/expression/ExpressionService.java	2014-07-26 17:33:42 +0000
@@ -291,6 +291,12 @@
     void explodeAndSubstituteExpressions( Collection<Indicator> indicators, Integer days );
 
     /**
+     * Substitutes potential constant and days in the numerator and denominator
+     * on all indicators in the given collection.
+     */
+    void substituteExpressions( Collection<Indicator> indicators, Integer days );
+    
+    /**
      * Populates the explodedNumerator and explodedDenominator property on all
      * indicators in the given collection. This method uses
      * explodeExpression( String ) internally to generate the exploded expressions.

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.java	2014-07-16 15:29:27 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.java	2014-07-26 17:33:42 +0000
@@ -595,14 +595,23 @@
     {
         if ( indicators != null && !indicators.isEmpty() )
         {
+            substituteExpressions( indicators, days );
+
+            explodeExpressions( indicators );
+        }
+    }
+
+    @Transactional
+    public void substituteExpressions( Collection<Indicator> indicators, Integer days )
+    {
+        if ( indicators != null && !indicators.isEmpty() )
+        {
             for ( Indicator indicator : indicators )
             {
                 indicator.setExplodedNumerator( substituteExpression( indicator.getNumerator(), days ) );
                 indicator.setExplodedDenominator( substituteExpression( indicator.getDenominator(), days ) );
             }
-
-            explodeExpressions( indicators );
-        }
+        }                
     }
     
     @Transactional

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/GetMetaDataAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/GetMetaDataAction.java	2014-03-27 06:07:15 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/GetMetaDataAction.java	2014-07-26 17:33:42 +0000
@@ -236,7 +236,7 @@
 
         indicators = indicatorService.getIndicatorsWithDataSets();
 
-        expressionService.explodeAndSubstituteExpressions( indicators, null );
+        expressionService.substituteExpressions( indicators, null );
 
         OrganisationUnitDataSetAssociationSet organisationUnitSet = organisationUnitService.getOrganisationUnitDataSetAssociationSet();