← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5568: Clean up Aggregated*Value constructors

 

------------------------------------------------------------
revno: 5568
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-12-22 23:18:22 +0100
message:
  Clean up Aggregated*Value constructors
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedDataValue.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedIndicatorValue.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/adapter/DashboardContentXmlAdapter.java
  dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableGridTest.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/aggregation/AggregatedDataValue.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedDataValue.java	2011-12-19 16:44:56 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedDataValue.java	2011-12-22 22:18:22 +0000
@@ -28,7 +28,6 @@
  */
 
 import java.io.Serializable;
-import java.util.Date;
 
 import org.hisp.dhis.common.AggregatedValue;
 
@@ -59,8 +58,6 @@
     
     private double value;
 
-    private Date modified;
-    
     private transient String dataElementName;
     
     private transient String periodName;
@@ -84,7 +81,8 @@
      * @param level level
      * @param value value
      */
-    public AggregatedDataValue( int dataElementId, int categoryOptionComboId, int periodId, int periodTypeId, int organisationUnitId, int level, double value ) 
+    public AggregatedDataValue( int dataElementId, int categoryOptionComboId, int periodId, 
+        int periodTypeId, int organisationUnitId, int level, double value ) 
     {
         this.dataElementId = dataElementId;
         this.categoryOptionComboId = categoryOptionComboId;
@@ -93,7 +91,6 @@
         this.organisationUnitId = organisationUnitId;
         this.level = level;
         this.value = value;
-        this.modified = new Date();
     }
 
     /**
@@ -102,20 +99,21 @@
      * @param periodId period id
      * @param periodTypeId period type id
      * @param organisationUnitId organisation unit id
+     * @param organisationUnitGroupId organisation unit group id
      * @param level level
      * @param value value
-     * @param timestamp modification timestamp
      */
-    public AggregatedDataValue( int dataElementId, int categoryOptionComboId, int periodId, int periodTypeId, int organisationUnitId, int level, double value, Date timestamp )
+    public AggregatedDataValue( int dataElementId, int categoryOptionComboId, int periodId, 
+        int periodTypeId, int organisationUnitId, int organisationUnitGroupId, int level, double value ) 
     {
         this.dataElementId = dataElementId;
         this.categoryOptionComboId = categoryOptionComboId;
         this.periodId = periodId;
         this.periodTypeId = periodTypeId;
         this.organisationUnitId = organisationUnitId;
+        this.organisationUnitGroupId = organisationUnitGroupId;
         this.level = level;
         this.value = value;
-        this.modified = timestamp;
     }
 
     // ----------------------------------------------------------------------
@@ -223,16 +221,6 @@
         this.value = value;
     }
 
-    public Date getModified()
-    {
-        return modified;
-    }
-
-    public void setModified( Date modified )
-    {
-        this.modified = modified;
-    }
-
     public String getDataElementName()
     {
         return dataElementName;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedIndicatorValue.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedIndicatorValue.java	2011-12-19 16:44:56 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedIndicatorValue.java	2011-12-22 22:18:22 +0000
@@ -28,7 +28,6 @@
  */
 
 import java.io.Serializable;
-import java.util.Date;
 
 import org.hisp.dhis.common.AggregatedValue;
 
@@ -65,8 +64,6 @@
     
     private double denominatorValue;
 
-    private Date modified;
-    
     private transient String indicatorName;
     
     private transient String periodName;
@@ -93,18 +90,18 @@
      * @param denominatorValue denominator value
      */
     public AggregatedIndicatorValue( int indicatorId, int periodId, int periodTypeId, int organisationUnitId, 
-        int level, double factor, double value, double numeratorValue, double denominatorValue )
+        int level, String annualized, double factor, double value, double numeratorValue, double denominatorValue )
     {
         this.indicatorId = indicatorId;
         this.periodId = periodId;
         this.periodTypeId = periodTypeId;
         this.organisationUnitId = organisationUnitId;
         this.level = level;
+        this.annualized = annualized;
         this.factor = factor;
         this.value = value;
         this.numeratorValue = numeratorValue;
         this.denominatorValue = denominatorValue;
-        this.modified = new Date();
     }
 
     /**
@@ -112,26 +109,27 @@
      * @param periodId period id
      * @param periodTypeId period type id
      * @param organisationUnitId organisation unit id
+     * @param organisationUnitGroupId organisation unit group id
      * @param level level
      * @param factor factor
      * @param value value
      * @param numeratorValue numerator value
      * @param denominatorValue denominator value
-     * @param timestamp modification timestamp
      */
-    public AggregatedIndicatorValue( int indicatorId, int periodId, int periodTypeId, int organisationUnitId,
-        int level, double factor, double value, double numeratorValue, double denominatorValue, Date timestamp )
+    public AggregatedIndicatorValue( int indicatorId, int periodId, int periodTypeId, int organisationUnitId, 
+        int organisationUnitGroupId, int level, String annualized, double factor, double value, double numeratorValue, double denominatorValue )
     {
         this.indicatorId = indicatorId;
         this.periodId = periodId;
         this.periodTypeId = periodTypeId;
         this.organisationUnitId = organisationUnitId;
+        this.organisationUnitGroupId = organisationUnitGroupId;
         this.level = level;
+        this.annualized = annualized;
         this.factor = factor;
         this.value = value;
         this.numeratorValue = numeratorValue;
         this.denominatorValue = denominatorValue;
-        this.modified = timestamp;
     }
 
     // ----------------------------------------------------------------------
@@ -271,16 +269,6 @@
         this.value = value;
     }
 
-    public Date getModified()
-    {
-        return modified;
-    }
-
-    public void setModified( Date modified )
-    {
-        this.modified = modified;
-    }
-
     public String getIndicatorName()
     {
         return indicatorName;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/adapter/DashboardContentXmlAdapter.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/adapter/DashboardContentXmlAdapter.java	2011-12-22 14:06:50 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/adapter/DashboardContentXmlAdapter.java	2011-12-22 22:18:22 +0000
@@ -37,7 +37,7 @@
  */
 public class DashboardContentXmlAdapter extends XmlAdapter<BaseIdentifiableObject, DashboardContent>
 {
-    private BaseIdentifiableObjectXmlAdapter baseIdentifiableObjectXmlAdapter = new BaseIdentifiableObjectXmlAdapter();
+    //private BaseIdentifiableObjectXmlAdapter baseIdentifiableObjectXmlAdapter = new BaseIdentifiableObjectXmlAdapter();
 
     @Override
     public DashboardContent unmarshal( BaseIdentifiableObject identifiableObject ) throws Exception

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableGridTest.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableGridTest.java	2011-12-22 21:05:20 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableGridTest.java	2011-12-22 22:18:22 +0000
@@ -316,14 +316,14 @@
         
         BatchHandler<AggregatedIndicatorValue> indicatorValueBatchHandler = batchHandlerFactory.createBatchHandler( AggregatedIndicatorValueBatchHandler.class ).init();
         
-        indicatorValueBatchHandler.addObject( new AggregatedIndicatorValue( indicatorIdA, periodIdA, 8, unitIdA, 8, 1, 11, 0, 0 ) );
-        indicatorValueBatchHandler.addObject( new AggregatedIndicatorValue( indicatorIdA, periodIdA, 8, unitIdB, 8, 1, 12, 0, 0 ) );
-        indicatorValueBatchHandler.addObject( new AggregatedIndicatorValue( indicatorIdA, periodIdB, 8, unitIdA, 8, 1, 13, 0, 0 ) );
-        indicatorValueBatchHandler.addObject( new AggregatedIndicatorValue( indicatorIdA, periodIdB, 8, unitIdB, 8, 1, 14, 0, 0 ) );
-        indicatorValueBatchHandler.addObject( new AggregatedIndicatorValue( indicatorIdB, periodIdA, 8, unitIdA, 8, 1, 15, 0, 0 ) );
-        indicatorValueBatchHandler.addObject( new AggregatedIndicatorValue( indicatorIdB, periodIdA, 8, unitIdB, 8, 1, 16, 0, 0 ) );
-        indicatorValueBatchHandler.addObject( new AggregatedIndicatorValue( indicatorIdB, periodIdB, 8, unitIdA, 8, 1, 17, 0, 0 ) );
-        indicatorValueBatchHandler.addObject( new AggregatedIndicatorValue( indicatorIdB, periodIdB, 8, unitIdB, 8, 1, 18, 0, 0 ) );
+        indicatorValueBatchHandler.addObject( new AggregatedIndicatorValue( indicatorIdA, periodIdA, 8, unitIdA, 8, "", 1, 11, 0, 0 ) );
+        indicatorValueBatchHandler.addObject( new AggregatedIndicatorValue( indicatorIdA, periodIdA, 8, unitIdB, 8, "", 1, 12, 0, 0 ) );
+        indicatorValueBatchHandler.addObject( new AggregatedIndicatorValue( indicatorIdA, periodIdB, 8, unitIdA, 8, "", 1, 13, 0, 0 ) );
+        indicatorValueBatchHandler.addObject( new AggregatedIndicatorValue( indicatorIdA, periodIdB, 8, unitIdB, 8, "", 1, 14, 0, 0 ) );
+        indicatorValueBatchHandler.addObject( new AggregatedIndicatorValue( indicatorIdB, periodIdA, 8, unitIdA, 8, "", 1, 15, 0, 0 ) );
+        indicatorValueBatchHandler.addObject( new AggregatedIndicatorValue( indicatorIdB, periodIdA, 8, unitIdB, 8, "", 1, 16, 0, 0 ) );
+        indicatorValueBatchHandler.addObject( new AggregatedIndicatorValue( indicatorIdB, periodIdB, 8, unitIdA, 8, "", 1, 17, 0, 0 ) );
+        indicatorValueBatchHandler.addObject( new AggregatedIndicatorValue( indicatorIdB, periodIdB, 8, unitIdB, 8, "", 1, 18, 0, 0 ) );
         
         indicatorValueBatchHandler.flush();