← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4143: Made Indicator-DataSet association bi-directional. Loading indicator formulas at page init in dat...

 

Merge authors:
  Lars Helge Øverland (larshelge)
------------------------------------------------------------
revno: 4143 [merge]
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-07-14 12:42:15 +0200
message:
  Made Indicator-DataSet association bi-directional. Loading indicator formulas at page init in data entry
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorStore.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/DefaultIndicatorService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/IndicatorDeletionHandler.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/hibernate/HibernateIndicatorStore.java
  dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/Indicator.hbm.xml
  dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/ehcache.xml
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/LoadPeriodsAction.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/PageInitAction.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/responsePeriods.vm
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.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-api/src/main/java/org/hisp/dhis/indicator/Indicator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java	2011-05-30 18:34:15 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java	2011-07-14 10:31:16 +0000
@@ -32,6 +32,7 @@
 import java.util.Set;
 
 import org.hisp.dhis.common.AbstractNameableObject;
+import org.hisp.dhis.dataset.DataSet;
 
 /**
  * @author Lars Helge Overland
@@ -71,7 +72,9 @@
 
     private Date lastUpdated;
     
-    private Set<IndicatorGroup> groups =  new HashSet<IndicatorGroup>();
+    private Set<IndicatorGroup> groups = new HashSet<IndicatorGroup>();
+    
+    private Set<DataSet> dataSets = new HashSet<DataSet>();
     
     // -------------------------------------------------------------------------
     // Logic
@@ -292,4 +295,14 @@
     {
         this.groups = groups;
     }
+
+    public Set<DataSet> getDataSets()
+    {
+        return dataSets;
+    }
+
+    public void setDataSets( Set<DataSet> dataSets )
+    {
+        this.dataSets = dataSets;
+    }
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorService.java	2011-05-20 08:01:23 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorService.java	2011-07-14 10:31:16 +0000
@@ -64,6 +64,8 @@
     Collection<Indicator> getIndicatorsWithGroupSets();
     
     Collection<Indicator> getIndicatorsWithoutGroups();
+    
+    Collection<Indicator> getIndicatorsWithDataSets();
 
     int getIndicatorCountByName( String name );
     

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorStore.java	2011-05-20 08:01:23 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorStore.java	2011-07-14 10:31:16 +0000
@@ -58,6 +58,8 @@
     Collection<Indicator> getIndicatorsWithGroupSets();
     
     Collection<Indicator> getIndicatorsWithoutGroups();
+    
+    Collection<Indicator> getIndicatorsWithDataSets();
 
     int getIndicatorCountByName( String name );
     

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/DefaultIndicatorService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/DefaultIndicatorService.java	2011-05-20 08:01:23 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/DefaultIndicatorService.java	2011-07-14 10:31:16 +0000
@@ -175,6 +175,11 @@
     {
         return i18n( i18nService, indicatorStore.getIndicatorsWithoutGroups() );
     }
+    
+    public Collection<Indicator> getIndicatorsWithDataSets()
+    {
+        return i18n( i18nService, indicatorStore.getIndicatorsWithDataSets() );
+    }
 
     public int getIndicatorCount()
     {

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/IndicatorDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/IndicatorDeletionHandler.java	2011-07-01 05:21:03 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/IndicatorDeletionHandler.java	2011-07-14 10:31:16 +0000
@@ -32,6 +32,7 @@
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
+import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.expression.ExpressionService;
 import org.hisp.dhis.system.deletion.DeletionHandler;
 
@@ -107,6 +108,18 @@
             }
         }
     }
+    
+    @Override
+    public void deleteDataSet( DataSet dataSet )
+    {
+        for ( Indicator indicator : indicatorService.getAllIndicators() )
+        {
+            if ( indicator.getDataSets().remove( dataSet ) )
+            {
+                indicatorService.updateIndicator( indicator );
+            }
+        }
+    }
 
     @Override
     public boolean allowDeleteDataElement( DataElement dataElement )

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/hibernate/HibernateIndicatorStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/hibernate/HibernateIndicatorStore.java	2011-06-07 05:46:18 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/hibernate/HibernateIndicatorStore.java	2011-07-14 10:31:16 +0000
@@ -158,6 +158,14 @@
         return sessionFactory.getCurrentSession().createQuery( hql ).list();
     }
 
+    @SuppressWarnings( "unchecked" )
+    public Collection<Indicator> getIndicatorsWithDataSets()
+    {
+        final String hql = "from Indicator d where d.dataSets.size > 0";
+
+        return sessionFactory.getCurrentSession().createQuery( hql ).list();
+    }
+
     public int getIndicatorCount()
     {
         return getCount();

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/Indicator.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/Indicator.hbm.xml	2011-07-13 09:35:32 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/Indicator.hbm.xml	2011-07-14 10:31:16 +0000
@@ -63,5 +63,10 @@
       <many-to-many class="org.hisp.dhis.indicator.IndicatorGroup" column="indicatorgroupid" />
     </set>
 
+    <set name="dataSets" table="datasetindicators" inverse="true">
+      <cache usage="read-write" />
+      <key column="indicatorid" />
+      <many-to-many class="org.hisp.dhis.dataset.DataSet" column="datasetid" />
+    </set>
   </class>
 </hibernate-mapping>

=== modified file 'dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/ehcache.xml'
--- dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/ehcache.xml	2011-06-29 15:25:19 +0000
+++ dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/ehcache.xml	2011-07-14 10:31:16 +0000
@@ -149,12 +149,12 @@
   <cache name="org.hisp.dhis.dataset.DataSet.sections"
     maxElementsInMemory="400"/>
   
+  <cache name="org.hisp.dhis.dataelement.DataElement.groups"
+    maxElementsInMemory="400"/>
+  
   <cache name="org.hisp.dhis.dataelement.DataElement.dataSets"
     maxElementsInMemory="400"/>
   
-  <cache name="org.hisp.dhis.dataelement.DataElement.groups"
-    maxElementsInMemory="400"/>
-  
   <cache name="org.hisp.dhis.dataelement.DataElementGroup.members"
     maxElementsInMemory="400"/>
   
@@ -164,6 +164,9 @@
   <cache name="org.hisp.dhis.indicator.Indicator.groups"
     maxElementsInMemory="400"/>
   
+  <cache name="org.hisp.dhis.indicator.Indicator.dataSets"
+    maxElementsInMemory="400"/>
+  
   <cache name="org.hisp.dhis.indicator.IndicatorGroup.members"
     maxElementsInMemory="400"/>
   

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/LoadPeriodsAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/LoadPeriodsAction.java	2011-07-14 08:39:01 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/LoadPeriodsAction.java	2011-07-14 10:34:09 +0000
@@ -29,15 +29,12 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashSet;
 import java.util.List;
 
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
 import org.hisp.dhis.de.state.SelectedStateManager;
-import org.hisp.dhis.expression.ExpressionService;
 import org.hisp.dhis.i18n.I18nFormat;
-import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.period.Period;
 
 import com.opensymphony.xwork2.Action;
@@ -73,13 +70,6 @@
         this.format = format;
     }
     
-    private ExpressionService expressionService;
-
-    public void setExpressionService( ExpressionService expressionService )
-    {
-        this.expressionService = expressionService;
-    }
-
     // -------------------------------------------------------------------------
     // Input
     // -------------------------------------------------------------------------
@@ -108,14 +98,7 @@
     {
         return periodValid;
     }
-        
-    private Collection<Indicator> indicators = new HashSet<Indicator>();
-
-    public Collection<Indicator> getIndicators()
-    {
-        return indicators;
-    }
-
+    
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -153,18 +136,6 @@
             {
                 period.setName( format.formatPeriod( period ) );
             }
-
-            // -----------------------------------------------------------------
-            // Explode and add indicators from data set
-            // -----------------------------------------------------------------
-
-            for ( Indicator indicator : selectedDataSet.getIndicators() )
-            {
-                indicator.setExplodedNumerator( expressionService.explodeExpression( indicator.getNumerator() ) );
-                indicator.setExplodedDenominator( expressionService.explodeExpression( indicator.getDenominator() ) );
-                
-                indicators.add( indicator );
-            }
             
             // -----------------------------------------------------------------
             // Clear display mode when loading new data set

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/PageInitAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/PageInitAction.java	2011-07-14 08:39:01 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/PageInitAction.java	2011-07-14 10:31:16 +0000
@@ -32,6 +32,9 @@
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.de.state.SelectedStateManager;
+import org.hisp.dhis.expression.ExpressionService;
+import org.hisp.dhis.indicator.Indicator;
+import org.hisp.dhis.indicator.IndicatorService;
 
 import com.opensymphony.xwork2.Action;
 
@@ -59,6 +62,20 @@
         this.dataElementService = dataElementService;
     }
 
+    private IndicatorService indicatorService;
+
+    public void setIndicatorService( IndicatorService indicatorService )
+    {
+        this.indicatorService = indicatorService;
+    }
+    
+    private ExpressionService expressionService;
+
+    public void setExpressionService( ExpressionService expressionService )
+    {
+        this.expressionService = expressionService;
+    }
+
     // -------------------------------------------------------------------------
     // Output
     // -------------------------------------------------------------------------
@@ -69,6 +86,13 @@
     {
         return significantZeros;
     }
+    
+    private Collection<Indicator> indicators;
+
+    public Collection<Indicator> getIndicators()
+    {
+        return indicators;
+    }
 
     // -------------------------------------------------------------------------
     // Action implementation
@@ -82,6 +106,14 @@
 
         significantZeros = dataElementService.getDataElementsByZeroIsSignificant( true );
         
+        indicators = indicatorService.getIndicatorsWithDataSets();
+        
+        for ( Indicator indicator : indicators )
+        {
+            indicator.setExplodedNumerator( expressionService.explodeExpression( indicator.getNumerator() ) );
+            indicator.setExplodedDenominator( expressionService.explodeExpression( indicator.getDenominator() ) );
+        }
+        
         return SUCCESS;
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/META-INF/dhis/beans.xml	2011-07-14 08:39:01 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/META-INF/dhis/beans.xml	2011-07-14 10:34:09 +0000
@@ -22,6 +22,8 @@
     scope="prototype">
     <property name="selectedStateManager" ref="org.hisp.dhis.de.state.SelectedStateManager" />
     <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+	<property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService" />
+	<property name="expressionService" ref="org.hisp.dhis.expression.ExpressionService" />
   </bean>
 
   <bean id="org.hisp.dhis.de.action.GetDataValuesForDataSetAction" class="org.hisp.dhis.de.action.GetDataValuesForDataSetAction"
@@ -38,7 +40,6 @@
   <bean id="org.hisp.dhis.de.action.LoadPeriodsAction" class="org.hisp.dhis.de.action.LoadPeriodsAction" scope="prototype">
     <property name="selectedStateManager" ref="org.hisp.dhis.de.state.SelectedStateManager" />
     <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
-    <property name="expressionService" ref="org.hisp.dhis.expression.ExpressionService" />
   </bean>
 
   <bean id="org.hisp.dhis.de.action.LoadNextPreviousPeriodsAction" class="org.hisp.dhis.de.action.LoadNextPreviousPeriodsAction"

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js	2011-07-14 08:39:01 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js	2011-07-14 10:31:16 +0000
@@ -241,6 +241,6 @@
 
     function markValue( color )
     {
-        $( '#' + dataElementId + '-' + optionComboId + '-val' ).css( "background-color", color );
+        $( '#' + dataElementId + '-' + optionComboId + '-val' ).css( 'background-color', color );
     }
 }
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2011-07-14 08:39:01 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2011-07-14 10:31:16 +0000
@@ -150,8 +150,6 @@
 
         $.getJSON( url, function( json )
         {
-            indicatorFormulas = json.indicatorFormulas;
-
             addOptionById( 'selectedPeriodIndex', '-1', '[ ' + i18n_select_period + ' ]' );
 
             for ( i in json.periods )
@@ -291,6 +289,10 @@
 				$( valFieldId ).css( 'background-color', COLOR_ORANGE );
 			}
 		} );
+		
+		// Update indicator values in form
+		
+		updateIndicators();
 	} );
 }
 
@@ -334,7 +336,6 @@
 {
     addEventListeners();
     enable( 'validationButton' );
-    updateIndicators();
     dataEntryFormIsLoaded = true;
     hideLoader();
 }

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/responsePeriods.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/responsePeriods.vm	2011-07-14 08:39:01 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/responsePeriods.vm	2011-07-14 10:34:09 +0000
@@ -9,10 +9,5 @@
     "externalId": "$!{period.externalId}"
   }#if( $velocityCount < $size1 ),#end
 #end ],
-#set( $size3 = $indicators.size() )
-  "indicatorFormulas": {
-#foreach( $indicator in $indicators )
-  "${indicator.id}": "($!{indicator.explodedNumerator})/($!{indicator.explodedDenominator})*($!{indicator.indicatorType.factor})"#if( $velocityCount < $size3 ),#end
-#end },
   "periodValid": ${periodValid}
 }

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm	2011-07-14 08:39:01 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm	2011-07-14 10:31:16 +0000
@@ -1,27 +1,32 @@
 <script type="text/javascript">
-	var i18n_select_data_set = '$encoder.jsEscape( $i18n.getString( "select_data_set" ) , "'")';
-	var i18n_select_period = '$encoder.jsEscape( $i18n.getString( "select_period" ) , "'")';
-	var i18n_register_complete_dataset_success = '$encoder.jsEscape( $i18n.getString( "register_complete_dataset_success" ) , "'")';
-	var i18n_register_complete_dataset_failed = '$encoder.jsEscape( $i18n.getString( "register_complete_dataset_failed" ) , "'")';
-	var i18n_undo_register_complete_dataset_success = '$encoder.jsEscape( $i18n.getString( "undo_register_complete_dataset_success" ) , "'")';
-    var i18n_value_of_data_element_less = '$encoder.jsEscape( $i18n.getString( "value_of_data_element_less" ) , "'")';
-    var i18n_value_of_data_element_greater = '$encoder.jsEscape( $i18n.getString( "value_of_data_element_greater" ) , "'")';
-    var i18n_value_too_long = '$encoder.jsEscape( $i18n.getString( "value_is_too_long" ) , "'")';
-	var i18n_value_must_integer = '$encoder.jsEscape( $i18n.getString( "value_must_integer" ) , "'")';
-	var i18n_value_must_number = '$encoder.jsEscape( $i18n.getString( "value_must_number" ) , "'")';
-	var i18n_value_must_positive_integer = '$encoder.jsEscape( $i18n.getString( "value_must_positive_integer" ) , "'")';
-	var i18n_value_must_negative_integer = '$encoder.jsEscape( $i18n.getString( "value_must_negative_integer" ) , "'")';
-	var i18n_field_unallowed_save_zero = '$encoder.jsEscape( $i18n.getString( "field_unallowed_save_zero" ) , "'")';
-	var i18n_saving_value_failed_status_code = '$encoder.jsEscape( $i18n.getString( "saving_value_failed_status_code" ) , "'")';
-    var i18n_saving_comment_failed_status_code = '$encoder.jsEscape( $i18n.getString( "saving_comment_failed_status_code" ) , "'")';
-    var i18n_saving_minmax_failed_error_code = '$encoder.jsEscape( $i18n.getString( "saving_minmax_failed_error_code" ) , "'")';
-    var i18n_confirm_complete = '$encoder.jsEscape( $i18n.getString( "confirm_complete" ) , "'")';
-    var i18n_confirm_undo = '$encoder.jsEscape( $i18n.getString( "confirm_undo" ) , "'")';
-    var i18n_no_response_from_server = '$encoder.jsEscape( $i18n.getString( "no_response_from_server" ) , "'")';
-    
-    significantZeros = [
-    #set( $size = $significantZeros.size() )
-    #foreach( $dataElement in $significantZeros )${dataElement.id}#if( $velocityCount < $size ),#end #end ];
+var i18n_select_data_set = '$encoder.jsEscape( $i18n.getString( "select_data_set" ) , "'")';
+var i18n_select_period = '$encoder.jsEscape( $i18n.getString( "select_period" ) , "'")';
+var i18n_register_complete_dataset_success = '$encoder.jsEscape( $i18n.getString( "register_complete_dataset_success" ) , "'")';
+var i18n_register_complete_dataset_failed = '$encoder.jsEscape( $i18n.getString( "register_complete_dataset_failed" ) , "'")';
+var i18n_undo_register_complete_dataset_success = '$encoder.jsEscape( $i18n.getString( "undo_register_complete_dataset_success" ) , "'")';
+var i18n_value_of_data_element_less = '$encoder.jsEscape( $i18n.getString( "value_of_data_element_less" ) , "'")';
+var i18n_value_of_data_element_greater = '$encoder.jsEscape( $i18n.getString( "value_of_data_element_greater" ) , "'")';
+var i18n_value_too_long = '$encoder.jsEscape( $i18n.getString( "value_is_too_long" ) , "'")';
+var i18n_value_must_integer = '$encoder.jsEscape( $i18n.getString( "value_must_integer" ) , "'")';
+var i18n_value_must_number = '$encoder.jsEscape( $i18n.getString( "value_must_number" ) , "'")';
+var i18n_value_must_positive_integer = '$encoder.jsEscape( $i18n.getString( "value_must_positive_integer" ) , "'")';
+var i18n_value_must_negative_integer = '$encoder.jsEscape( $i18n.getString( "value_must_negative_integer" ) , "'")';
+var i18n_field_unallowed_save_zero = '$encoder.jsEscape( $i18n.getString( "field_unallowed_save_zero" ) , "'")';
+var i18n_saving_value_failed_status_code = '$encoder.jsEscape( $i18n.getString( "saving_value_failed_status_code" ) , "'")';
+var i18n_saving_comment_failed_status_code = '$encoder.jsEscape( $i18n.getString( "saving_comment_failed_status_code" ) , "'")';
+var i18n_saving_minmax_failed_error_code = '$encoder.jsEscape( $i18n.getString( "saving_minmax_failed_error_code" ) , "'")';
+var i18n_confirm_complete = '$encoder.jsEscape( $i18n.getString( "confirm_complete" ) , "'")';
+var i18n_confirm_undo = '$encoder.jsEscape( $i18n.getString( "confirm_undo" ) , "'")';
+var i18n_no_response_from_server = '$encoder.jsEscape( $i18n.getString( "no_response_from_server" ) , "'")';
+
+significantZeros = [
+#set( $size1 = $significantZeros.size() )
+#foreach( $dataElement in $significantZeros )
+${dataElement.id}#if( $velocityCount < $size1 ),#end #end ];
+
+#foreach( $indicator in $indicators )
+indicatorFormulas['${indicator.id}'] = '($!{indicator.explodedNumerator})/($!{indicator.explodedDenominator})*($!{indicator.indicatorType.factor})';
+#end
 </script>
 
 <h3>$i18n.getString( "data_entry" ) #openHelp( "dataEntry" )</h3>