dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #26523
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13128: Exposed the creator of an interpretation in the web api
------------------------------------------------------------
revno: 13128
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-12-03 17:18:51 +0100
message:
Exposed the creator of an interpretation in the web api
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/interpretation/Interpretation.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/interpretation/Interpretation.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/interpretation/Interpretation.java 2013-10-03 14:24:37 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/interpretation/Interpretation.java 2013-12-03 16:18:51 +0000
@@ -47,6 +47,7 @@
import org.hisp.dhis.period.Period;
import org.hisp.dhis.period.PeriodType;
import org.hisp.dhis.reporttable.ReportTable;
+import org.hisp.dhis.user.User;
import org.hisp.dhis.user.UserGroupAccess;
import java.util.ArrayList;
@@ -129,6 +130,21 @@
// Logic
// -------------------------------------------------------------------------
+ /**
+ * Overriding getUser in order to expose user in web api. Sharing is not enabled
+ * for interpretations but "user" is used for representing the creator. Must
+ * be removed when sharing is enabled for this class.
+ */
+ @Override
+ @JsonProperty
+ @JsonSerialize( as = BaseIdentifiableObject.class )
+ @JsonView( { DetailedView.class, ExportView.class } )
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+ public User getUser()
+ {
+ return user;
+ }
+
@JsonProperty
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public String getType()