dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #16001
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5942: Changed AggregatedValue from interface to abstract class and merged common properties
------------------------------------------------------------
revno: 5942
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-02-13 18:18:22 +0100
message:
Changed AggregatedValue from interface to abstract class and merged common properties
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/AggregatedValue.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/completeness/DataSetCompletenessResult.java
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/error.html
--
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-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedDataValue.java 2012-02-13 17:18:22 +0000
@@ -27,43 +27,20 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import java.io.Serializable;
-
import org.hisp.dhis.common.AggregatedValue;
/**
* @author Lars Helge Overland
*/
public class AggregatedDataValue
- implements AggregatedValue, Serializable
+ extends AggregatedValue
{
- /**
- * Determines if a de-serialized file is compatible with this class.
- */
- private static final long serialVersionUID = -6569434956128470844L;
-
private int dataElementId;
private int categoryOptionComboId;
- private int periodId;
-
- private int periodTypeId;
-
- private int organisationUnitId;
-
- private int organisationUnitGroupId;
-
- private int level;
-
- private double value;
-
private transient String dataElementName;
- private transient String periodName;
-
- private transient String organisationUnitName;
-
// ----------------------------------------------------------------------
// Constructors
// ----------------------------------------------------------------------
@@ -78,8 +55,8 @@
* @param periodId period id
* @param periodTypeId period type id
* @param organisationUnitId organisation unit id
- * @param level level
- * @param value value
+ * @param level level level
+ * @param value value value
*/
public AggregatedDataValue( int dataElementId, int categoryOptionComboId, int periodId,
int periodTypeId, int organisationUnitId, int level, double value )
@@ -161,66 +138,6 @@
this.categoryOptionComboId = categoryOptionComboId;
}
- public int getLevel()
- {
- return level;
- }
-
- public void setLevel( int level )
- {
- this.level = level;
- }
-
- public int getOrganisationUnitId()
- {
- return organisationUnitId;
- }
-
- public void setOrganisationUnitId( int organisationUnitId )
- {
- this.organisationUnitId = organisationUnitId;
- }
-
- public int getOrganisationUnitGroupId()
- {
- return organisationUnitGroupId;
- }
-
- public void setOrganisationUnitGroupId( int organisationUnitGroupId )
- {
- this.organisationUnitGroupId = organisationUnitGroupId;
- }
-
- public int getPeriodId()
- {
- return periodId;
- }
-
- public void setPeriodId( int periodId )
- {
- this.periodId = periodId;
- }
-
- public int getPeriodTypeId()
- {
- return periodTypeId;
- }
-
- public void setPeriodTypeId( int periodTypeId )
- {
- this.periodTypeId = periodTypeId;
- }
-
- public double getValue()
- {
- return value;
- }
-
- public void setValue( double value )
- {
- this.value = value;
- }
-
public String getDataElementName()
{
return dataElementName;
@@ -231,26 +148,6 @@
this.dataElementName = dataElementName;
}
- public String getPeriodName()
- {
- return periodName;
- }
-
- public void setPeriodName( String periodName )
- {
- this.periodName = periodName;
- }
-
- public String getOrganisationUnitName()
- {
- return organisationUnitName;
- }
-
- public void setOrganisationUnitName( String organisationUnitName )
- {
- this.organisationUnitName = organisationUnitName;
- }
-
// ----------------------------------------------------------------------
// hashCode and equals
// ----------------------------------------------------------------------
=== 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-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedIndicatorValue.java 2012-02-13 17:18:22 +0000
@@ -27,49 +27,26 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import java.io.Serializable;
-
import org.hisp.dhis.common.AggregatedValue;
/**
* @author Lars Helge Overland
*/
public class AggregatedIndicatorValue
- implements AggregatedValue, Serializable
+ extends AggregatedValue
{
- /**
- * Determines if a de-serialized file is compatible with this class.
- */
- private static final long serialVersionUID = -26851210554553790L;
-
private int indicatorId;
- private int periodId;
-
- private int periodTypeId;
-
- private int organisationUnitId;
-
- private int organisationUnitGroupId;
-
- private int level;
-
private String annualized;
private double factor;
- private double value;
-
private double numeratorValue;
private double denominatorValue;
private transient String indicatorName;
- private transient String periodName;
-
- private transient String organisationUnitName;
-
// ----------------------------------------------------------------------
// Constructors
// ----------------------------------------------------------------------
@@ -158,16 +135,6 @@
// ----------------------------------------------------------------------
// Getters and setters
// ----------------------------------------------------------------------
-
- public double getDenominatorValue()
- {
- return denominatorValue;
- }
-
- public void setDenominatorValue( double denominatorValue )
- {
- this.denominatorValue = denominatorValue;
- }
public int getIndicatorId()
{
@@ -189,6 +156,16 @@
this.level = level;
}
+ public double getDenominatorValue()
+ {
+ return denominatorValue;
+ }
+
+ public void setDenominatorValue( double denominatorValue )
+ {
+ this.denominatorValue = denominatorValue;
+ }
+
public String getAnnualized()
{
return annualized;
@@ -219,56 +196,6 @@
this.numeratorValue = numeratorValue;
}
- public int getOrganisationUnitId()
- {
- return organisationUnitId;
- }
-
- public void setOrganisationUnitId( int organisationUnitId )
- {
- this.organisationUnitId = organisationUnitId;
- }
-
- public int getOrganisationUnitGroupId()
- {
- return organisationUnitGroupId;
- }
-
- public void setOrganisationUnitGroupId( int organisationUnitGroupId )
- {
- this.organisationUnitGroupId = organisationUnitGroupId;
- }
-
- public int getPeriodId()
- {
- return periodId;
- }
-
- public void setPeriodId( int periodId )
- {
- this.periodId = periodId;
- }
-
- public int getPeriodTypeId()
- {
- return periodTypeId;
- }
-
- public void setPeriodTypeId( int periodTypeId )
- {
- this.periodTypeId = periodTypeId;
- }
-
- public double getValue()
- {
- return value;
- }
-
- public void setValue( double value )
- {
- this.value = value;
- }
-
public String getIndicatorName()
{
return indicatorName;
@@ -279,26 +206,6 @@
this.indicatorName = indicatorName;
}
- public String getPeriodName()
- {
- return periodName;
- }
-
- public void setPeriodName( String periodName )
- {
- this.periodName = periodName;
- }
-
- public String getOrganisationUnitName()
- {
- return organisationUnitName;
- }
-
- public void setOrganisationUnitName( String organisationUnitName )
- {
- this.organisationUnitName = organisationUnitName;
- }
-
// ----------------------------------------------------------------------
// hashCode and equals
// ----------------------------------------------------------------------
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/AggregatedValue.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/AggregatedValue.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/AggregatedValue.java 2012-02-13 17:18:22 +0000
@@ -30,17 +30,129 @@
/**
* @author Lars Helge Overland
*/
-public interface AggregatedValue
+public abstract class AggregatedValue
{
- final Double ZERO = 0d;
-
- int getElementId();
-
- int getPeriodId();
-
- int getOrganisationUnitId();
-
- int getOrganisationUnitGroupId();
-
- double getValue();
+ public static final Double ZERO = 0d;
+
+ // ----------------------------------------------------------------------
+ // Properties
+ // ----------------------------------------------------------------------
+
+ protected int periodId;
+
+ protected int periodTypeId;
+
+ protected int organisationUnitId;
+
+ protected int organisationUnitGroupId;
+
+ protected int level;
+
+ protected double value;
+
+ protected transient String periodName;
+
+ protected transient String organisationUnitName;
+
+ protected transient double trendValue;
+
+ // ----------------------------------------------------------------------
+ // Abstract methods
+ // ----------------------------------------------------------------------
+
+ public abstract int getElementId();
+
+ // ----------------------------------------------------------------------
+ // Getters and setters
+ // ----------------------------------------------------------------------
+
+ public int getPeriodId()
+ {
+ return periodId;
+ }
+
+ public void setPeriodId( int periodId )
+ {
+ this.periodId = periodId;
+ }
+
+ public int getPeriodTypeId()
+ {
+ return periodTypeId;
+ }
+
+ public void setPeriodTypeId( int periodTypeId )
+ {
+ this.periodTypeId = periodTypeId;
+ }
+
+ public int getOrganisationUnitId()
+ {
+ return organisationUnitId;
+ }
+
+ public void setOrganisationUnitId( int organisationUnitId )
+ {
+ this.organisationUnitId = organisationUnitId;
+ }
+
+ public int getOrganisationUnitGroupId()
+ {
+ return organisationUnitGroupId;
+ }
+
+ public void setOrganisationUnitGroupId( int organisationUnitGroupId )
+ {
+ this.organisationUnitGroupId = organisationUnitGroupId;
+ }
+
+ public int getLevel()
+ {
+ return level;
+ }
+
+ public void setLevel( int level )
+ {
+ this.level = level;
+ }
+
+ public double getValue()
+ {
+ return value;
+ }
+
+ public void setValue( double value )
+ {
+ this.value = value;
+ }
+
+ public String getPeriodName()
+ {
+ return periodName;
+ }
+
+ public void setPeriodName( String periodName )
+ {
+ this.periodName = periodName;
+ }
+
+ public String getOrganisationUnitName()
+ {
+ return organisationUnitName;
+ }
+
+ public void setOrganisationUnitName( String organisationUnitName )
+ {
+ this.organisationUnitName = organisationUnitName;
+ }
+
+ public double getTrendValue()
+ {
+ return trendValue;
+ }
+
+ public void setTrendValue( double trendValue )
+ {
+ this.trendValue = trendValue;
+ }
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/completeness/DataSetCompletenessResult.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/completeness/DataSetCompletenessResult.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/completeness/DataSetCompletenessResult.java 2012-02-13 17:18:22 +0000
@@ -27,36 +27,21 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import java.io.Serializable;
-
import org.hisp.dhis.common.AggregatedValue;
/**
* @author Lars Helge Overland
- * @version $Id$
*/
public class DataSetCompletenessResult
- implements AggregatedValue, Serializable
+ extends AggregatedValue
{
- /**
- * Determines if a de-serialized file is compatible with this class.
- */
- private static final long serialVersionUID = 8726709312489400802L;
-
// -------------------------------------------------------------------------
// Properties 1
+ // Inherit periodId, periodName, organisationUnitId, organisationUnitGroupId
// -------------------------------------------------------------------------
private int dataSetId;
- private int periodId;
-
- private String periodName;
-
- private int organisationUnitId;
-
- private int organisationUnitGroupId;
-
// -------------------------------------------------------------------------
// Properties 2
// -------------------------------------------------------------------------
@@ -221,46 +206,6 @@
this.dataSetId = dataSetId;
}
- public int getPeriodId()
- {
- return periodId;
- }
-
- public void setPeriodId( int periodId )
- {
- this.periodId = periodId;
- }
-
- public String getPeriodName()
- {
- return periodName;
- }
-
- public void setPeriodName( String periodName )
- {
- this.periodName = periodName;
- }
-
- public int getOrganisationUnitId()
- {
- return organisationUnitId;
- }
-
- public void setOrganisationUnitId( int organisationUnitId )
- {
- this.organisationUnitId = organisationUnitId;
- }
-
- public int getOrganisationUnitGroupId()
- {
- return organisationUnitGroupId;
- }
-
- public void setOrganisationUnitGroupId( int organisationUnitGroupId )
- {
- this.organisationUnitGroupId = organisationUnitGroupId;
- }
-
// -------------------------------------------------------------------------
// Getters and setters 2
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/error.html'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/error.html 2011-04-06 16:03:34 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/error.html 2012-02-13 17:18:22 +0000
@@ -52,10 +52,9 @@
<body>
<div id="horizon">
<div id="content">
- <div id="logo"><img src="../images/logo_banner.png" alt="" /></div>
<div class="bodytext">
<span class="headline">Oops, something went wrong</span><br>
- Do not panic... We recorded it in the log
+ Do not panic, we have recorded it in the log
</div>
</div>
</div>