dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #26916
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13323: DataValue, rationalized the constructors
------------------------------------------------------------
revno: 13323
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-12-19 10:06:41 +0100
message:
DataValue, rationalized the constructors
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValue.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/FacilityReportingServiceImpl.java
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataValueController.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/SaveAggregateDataValueAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.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/datavalue/DataValue.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValue.java 2013-12-19 08:23:37 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValue.java 2013-12-19 09:06:41 +0000
@@ -93,13 +93,12 @@
{
}
- public DataValue( DataElement dataElement, Period period, OrganisationUnit source )
- {
- this.dataElement = dataElement;
- this.period = period;
- this.source = source;
- }
-
+ /**
+ * @param dataElement the data element.
+ * @param period the period.
+ * @param source the organisation unit.
+ * @param categoryOptionCombo the category option combo.
+ */
public DataValue( DataElement dataElement, Period period, OrganisationUnit source, DataElementCategoryOptionCombo categoryOptionCombo )
{
this.dataElement = dataElement;
@@ -108,46 +107,27 @@
this.categoryOptionCombo = categoryOptionCombo;
}
- public DataValue( DataElement dataElement, Period period, OrganisationUnit source, String value )
- {
- this.dataElement = dataElement;
- this.period = period;
- this.source = source;
- this.value = value;
- }
-
- public DataValue( DataElement dataElement, Period period, OrganisationUnit source, String value, DataElementCategoryOptionCombo categoryOptionCombo )
- {
- this.dataElement = dataElement;
- this.period = period;
- this.source = source;
- this.value = value;
- this.categoryOptionCombo = categoryOptionCombo;
- }
-
- public DataValue( DataElement dataElement, Period period, OrganisationUnit source, String value, String storedBy,
- Date timestamp, String comment )
- {
- this.dataElement = dataElement;
- this.period = period;
- this.source = source;
- this.value = value;
- this.storedBy = storedBy;
- this.timestamp = timestamp;
- this.comment = comment;
- }
-
- public DataValue( DataElement dataElement, Period period, OrganisationUnit source, String value, String storedBy,
- Date timestamp, String comment, DataElementCategoryOptionCombo categoryOptionCombo )
- {
- this.dataElement = dataElement;
- this.period = period;
- this.source = source;
- this.value = value;
- this.storedBy = storedBy;
- this.timestamp = timestamp;
- this.comment = comment;
- this.categoryOptionCombo = categoryOptionCombo;
+ /**
+ * @param dataElement the data element.
+ * @param period the period.
+ * @param source the organisation unit.
+ * @param categoryOptionCombo the category option combo.
+ * @param value the value.
+ * @param storedBy the user that stored this data value.
+ * @param timestamp the time of creation of this data value.
+ * @param comment the comment.
+ */
+ public DataValue( DataElement dataElement, Period period, OrganisationUnit source, DataElementCategoryOptionCombo categoryOptionCombo,
+ String value, String storedBy, Date timestamp, String comment )
+ {
+ this.dataElement = dataElement;
+ this.period = period;
+ this.source = source;
+ this.categoryOptionCombo = categoryOptionCombo;
+ this.value = value;
+ this.storedBy = storedBy;
+ this.timestamp = timestamp;
+ this.comment = comment;
}
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/FacilityReportingServiceImpl.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/FacilityReportingServiceImpl.java 2013-12-16 15:15:54 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/FacilityReportingServiceImpl.java 2013-12-19 09:06:41 +0000
@@ -419,8 +419,7 @@
if ( dataValue == null )
{
- dataValue = new org.hisp.dhis.datavalue.DataValue( dataElement, period, unit, value, "", new Date(), "",
- cateOptCombo );
+ dataValue = new org.hisp.dhis.datavalue.DataValue( dataElement, period, unit, cateOptCombo, value, "", new Date(), "" );
dataValueService.addDataValue( dataValue );
}
else
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataValueController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataValueController.java 2013-12-14 15:01:19 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataValueController.java 2013-12-19 09:06:41 +0000
@@ -159,7 +159,7 @@
if ( dataValue == null )
{
- dataValue = new DataValue( dataElement, period, organisationUnit, null, storedBy, now, null, categoryOptionCombo );
+ dataValue = new DataValue( dataElement, period, organisationUnit, categoryOptionCombo, null, storedBy, now, null );
if ( value != null )
{
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/SaveAggregateDataValueAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/SaveAggregateDataValueAction.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/SaveAggregateDataValueAction.java 2013-12-19 09:06:41 +0000
@@ -151,8 +151,7 @@
{
if ( dataValue == null )
{
- dataValue = new DataValue( dataElement, period, orgunit, "" + resultValue, "", new Date(), null,
- optionCombo );
+ dataValue = new DataValue( dataElement, period, orgunit, optionCombo, "" + resultValue, "", new Date(), null );
dataValueService.addDataValue( dataValue );
}
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.java 2013-12-16 17:25:44 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.java 2013-12-19 09:06:41 +0000
@@ -406,8 +406,7 @@
{
needsValidation = true;
- dataValue = new DataValue( dataElement, period, organisationUnit, value, storedBy, new Date(),
- null, optionCombo );
+ dataValue = new DataValue( dataElement, period, organisationUnit, optionCombo, value, storedBy, new Date(), null );
dataValueService.addDataValue( dataValue );
}
else