dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #30284
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15373: expose trackedEntityInstanceReminders on ProgramStage
------------------------------------------------------------
revno: 15373
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-05-23 13:48:56 +0200
message:
expose trackedEntityInstanceReminders on ProgramStage
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceReminder.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/program/ProgramStage.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java 2014-05-23 11:33:51 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java 2014-05-23 11:48:56 +0000
@@ -34,7 +34,6 @@
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.BaseIdentifiableObject;
import org.hisp.dhis.common.DxfNamespaces;
import org.hisp.dhis.common.view.DetailedView;
@@ -166,6 +165,10 @@
this.remindCompleted = remindCompleted;
}
+ @JsonProperty( value = "trackedEntityInstanceReminders" )
+ @JsonView( { DetailedView.class, ExportView.class } )
+ @JacksonXmlElementWrapper( localName = "trackedEntityInstanceReminders", namespace = DxfNamespaces.DXF_2_0 )
+ @JacksonXmlProperty( localName = "trackedEntityInstanceReminder", namespace = DxfNamespaces.DXF_2_0 )
public Set<TrackedEntityInstanceReminder> getReminders()
{
return reminders;
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceReminder.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceReminder.java 2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceReminder.java 2014-05-23 11:48:56 +0000
@@ -28,13 +28,22 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+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;
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.common.view.WithoutOrganisationUnitsView;
import org.hisp.dhis.user.UserGroup;
/**
* @author Chau Thu Tran
- * @version TrackedEntityInstanceReminder.java 1:07:58 PM Sep 18, 2012 $
*/
+@JacksonXmlRootElement( localName = "trackedEntityInstanceReminder", namespace = DxfNamespaces.DXF_2_0 )
public class TrackedEntityInstanceReminder
extends BaseIdentifiableObject
{
@@ -85,7 +94,7 @@
public static final int MESSAGE_TYPE_DHIS_MESSAGE = 2;
public static final int MESSAGE_TYPE_BOTH = 3;
-
+
private Integer daysAllowedSendMessage;
private String templateMessage;
@@ -127,12 +136,13 @@
this.messageType = messageType;
}
- // TODO implement hashcode and equals
-
// -------------------------------------------------------------------------
// Getter && Setter
// -------------------------------------------------------------------------
-
+
+ @JsonProperty
+ @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public Integer getDaysAllowedSendMessage()
{
return daysAllowedSendMessage;
@@ -143,6 +153,9 @@
this.daysAllowedSendMessage = daysAllowedSendMessage;
}
+ @JsonProperty
+ @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public String getTemplateMessage()
{
return templateMessage;
@@ -153,6 +166,9 @@
this.templateMessage = templateMessage;
}
+ @JsonProperty
+ @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public String getDateToCompare()
{
return dateToCompare;
@@ -163,6 +179,9 @@
this.dateToCompare = dateToCompare;
}
+ @JsonProperty
+ @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public Integer getSendTo()
{
return sendTo;
@@ -173,6 +192,9 @@
this.sendTo = sendTo;
}
+ @JsonProperty
+ @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public Integer getWhenToSend()
{
return whenToSend;
@@ -183,6 +205,10 @@
this.whenToSend = whenToSend;
}
+ @JsonProperty
+ @JsonSerialize( as = BaseIdentifiableObject.class )
+ @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public UserGroup getUserGroup()
{
return userGroup;
@@ -193,6 +219,9 @@
this.userGroup = userGroup;
}
+ @JsonProperty
+ @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public Integer getMessageType()
{
return messageType;