dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #31591
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16124: Annotations for TrackedEntityAttributeDimension and TrackedEntityDataElementDimension
------------------------------------------------------------
revno: 16124
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-07-15 00:09:24 +0200
message:
Annotations for TrackedEntityAttributeDimension and TrackedEntityDataElementDimension
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseAnalyticalObject.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventchart/EventChart.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventreport/EventReport.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeDimension.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityDataElementDimension.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/common/BaseAnalyticalObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseAnalyticalObject.java 2014-07-13 14:34:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseAnalyticalObject.java 2014-07-14 22:09:24 +0000
@@ -974,7 +974,10 @@
this.organisationUnitGroups = organisationUnitGroups;
}
- //TODO json annotations
+ @JsonProperty
+ @JsonView( { DetailedView.class, ExportView.class } )
+ @JacksonXmlElementWrapper( localName = "categoryOptionGroups", namespace = DxfNamespaces.DXF_2_0 )
+ @JacksonXmlProperty( localName = "categoryOptionGroup", namespace = DxfNamespaces.DXF_2_0 )
public List<CategoryOptionGroup> getCategoryOptionGroups()
{
return categoryOptionGroups;
@@ -985,6 +988,10 @@
this.categoryOptionGroups = categoryOptionGroups;
}
+ @JsonProperty
+ @JsonView( { DetailedView.class, ExportView.class } )
+ @JacksonXmlElementWrapper( localName = "attributeDimensions", namespace = DxfNamespaces.DXF_2_0 )
+ @JacksonXmlProperty( localName = "attributeDimension", namespace = DxfNamespaces.DXF_2_0 )
public List<TrackedEntityAttributeDimension> getAttributeDimensions()
{
return attributeDimensions;
@@ -995,6 +1002,10 @@
this.attributeDimensions = attributeDimensions;
}
+ @JsonProperty
+ @JsonView( { DetailedView.class, ExportView.class } )
+ @JacksonXmlElementWrapper( localName = "attributeDimensions", namespace = DxfNamespaces.DXF_2_0 )
+ @JacksonXmlProperty( localName = "attributeDimension", namespace = DxfNamespaces.DXF_2_0 )
public List<TrackedEntityDataElementDimension> getDataElementDimensions()
{
return dataElementDimensions;
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventchart/EventChart.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventchart/EventChart.java 2014-07-13 13:53:40 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventchart/EventChart.java 2014-07-14 22:09:24 +0000
@@ -54,10 +54,12 @@
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
/**
* @author Jan Henrik Overland
*/
+@JacksonXmlRootElement( localName = "eventChart", namespace = DxfNamespaces.DXF_2_0 )
public class EventChart
extends BaseChart
{
=== 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-05-28 16:54:51 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventreport/EventReport.java 2014-07-14 22:09:24 +0000
@@ -33,6 +33,8 @@
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+
import org.hisp.dhis.common.BaseAnalyticalObject;
import org.hisp.dhis.common.BaseIdentifiableObject;
import org.hisp.dhis.common.DxfNamespaces;
@@ -53,6 +55,7 @@
/**
* @author Lars Helge Overland
*/
+@JacksonXmlRootElement( localName = "eventReport", namespace = DxfNamespaces.DXF_2_0 )
public class EventReport
extends BaseAnalyticalObject
{
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeDimension.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeDimension.java 2014-07-12 21:07:29 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeDimension.java 2014-07-14 22:09:24 +0000
@@ -28,9 +28,21 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import org.hisp.dhis.common.BaseIdentifiableObject;
+import org.hisp.dhis.common.DxfNamespaces;
+import org.hisp.dhis.common.view.DetailedView;
+import org.hisp.dhis.common.view.ExportView;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonView;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+
/**
* @author Lars Helge Overland
*/
+@JacksonXmlRootElement( localName = "attributeDimension", namespace = DxfNamespaces.DXF_2_0 )
public class TrackedEntityAttributeDimension
{
private int id;
@@ -89,6 +101,10 @@
this.id = id;
}
+ @JsonProperty
+ @JsonSerialize( as = BaseIdentifiableObject.class )
+ @JsonView( {DetailedView.class, ExportView.class} )
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
public TrackedEntityAttribute getAttribute()
{
return attribute;
@@ -99,6 +115,9 @@
this.attribute = attribute;
}
+ @JsonProperty
+ @JsonView( {DetailedView.class, ExportView.class} )
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
public String getFilter()
{
return filter;
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityDataElementDimension.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityDataElementDimension.java 2014-07-12 21:07:29 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityDataElementDimension.java 2014-07-14 22:09:24 +0000
@@ -27,11 +27,24 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
+import org.hisp.dhis.common.BaseIdentifiableObject;
+import org.hisp.dhis.common.DxfNamespaces;
+import org.hisp.dhis.common.view.DetailedView;
+import org.hisp.dhis.common.view.ExportView;
+
import org.hisp.dhis.dataelement.DataElement;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonView;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+
/**
* @author Lars Helge Overland
*/
+@JacksonXmlRootElement( localName = "dataElementDimension", namespace = DxfNamespaces.DXF_2_0 )
public class TrackedEntityDataElementDimension
{
private int id;
@@ -90,6 +103,10 @@
this.id = id;
}
+ @JsonProperty
+ @JsonSerialize( as = BaseIdentifiableObject.class )
+ @JsonView( {DetailedView.class, ExportView.class} )
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
public DataElement getDataElement()
{
return dataElement;
@@ -100,6 +117,9 @@
this.dataElement = dataElement;
}
+ @JsonProperty
+ @JsonView( {DetailedView.class, ExportView.class} )
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
public String getFilter()
{
return filter;
@@ -109,5 +129,4 @@
{
this.filter = filter;
}
-
}