dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #28877
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14499: EventReport, new property dataType
------------------------------------------------------------
revno: 14499
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-03-27 17:08:29 +0100
message:
EventReport, new property dataType
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventreport/EventReport.java
dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/eventreport/EventReport.hbm.xml
dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/eventreport/EventReportServiceTest.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/eventreport/EventReport.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventreport/EventReport.java 2014-03-27 15:40:52 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventreport/EventReport.java 2014-03-27 16:08:29 +0000
@@ -57,6 +57,9 @@
public class EventReport
extends BaseAnalyticalObject
{
+ public static final String DATA_TYPE_AGGREGATED_VALUES = "aggregated_values";
+ public static final String DATA_TYPE_INDIVIDUAL_CASES = "individual_cases";
+
/**
* Program. Required.
*/
@@ -78,6 +81,11 @@
private Date endDate;
/**
+ * Type of data, can be aggregated values and individual cases.
+ */
+ private String dataType;
+
+ /**
* Dimensions to crosstabulate / use as columns.
*/
private List<String> columnDimensions = new ArrayList<String>();
@@ -209,6 +217,19 @@
}
@JsonProperty
+ @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+ public String getDataType()
+ {
+ return dataType;
+ }
+
+ public void setDataType( String dataType )
+ {
+ this.dataType = dataType;
+ }
+
+ @JsonProperty
@JsonView( {DetailedView.class, ExportView.class} )
@JacksonXmlElementWrapper( localName = "columnDimensions", namespace = DxfNamespaces.DXF_2_0)
@JacksonXmlProperty( localName = "column", namespace = DxfNamespaces.DXF_2_0)
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/eventreport/EventReport.hbm.xml'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/eventreport/EventReport.hbm.xml 2014-03-27 13:53:54 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/eventreport/EventReport.hbm.xml 2014-03-27 16:08:29 +0000
@@ -81,6 +81,8 @@
<property name="endDate" />
+ <property name="dataType" not-null="true" />
+
<list name="columnDimensions" table="eventreport_columns">
<cache usage="read-write" />
<key column="eventreportid" foreign-key="fk_eventreport_columns_eventreportid" />
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/eventreport/EventReportServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/eventreport/EventReportServiceTest.java 2014-03-27 14:54:30 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/eventreport/EventReportServiceTest.java 2014-03-27 16:08:29 +0000
@@ -62,10 +62,13 @@
{
EventReport erA = new EventReport( "erA" );
erA.setProgram( prA );
+ erA.setDataType( EventReport.DATA_TYPE_AGGREGATED_VALUES );
EventReport erB = new EventReport( "erB" );
erB.setProgram( prA );
+ erB.setDataType( EventReport.DATA_TYPE_AGGREGATED_VALUES );
EventReport erC = new EventReport( "erC" );
erC.setProgram( prA );
+ erC.setDataType( EventReport.DATA_TYPE_AGGREGATED_VALUES );
int idA = eventReportService.saveEventReport( erA );
int idB = eventReportService.saveEventReport( erB );
@@ -81,10 +84,13 @@
{
EventReport erA = new EventReport( "erA" );
erA.setProgram( prA );
+ erA.setDataType( EventReport.DATA_TYPE_AGGREGATED_VALUES );
EventReport erB = new EventReport( "erB" );
erB.setProgram( prA );
+ erB.setDataType( EventReport.DATA_TYPE_AGGREGATED_VALUES );
EventReport erC = new EventReport( "erC" );
erC.setProgram( prA );
+ erC.setDataType( EventReport.DATA_TYPE_AGGREGATED_VALUES );
int idA = eventReportService.saveEventReport( erA );
int idB = eventReportService.saveEventReport( erB );