dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #37151
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19004: add apiEndpoint to Property class
------------------------------------------------------------
revno: 19004
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-04-24 13:48:37 +0700
message:
add apiEndpoint to Property class
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/Property.java
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/service/DefaultLinkService.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/schema/Property.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/Property.java 2015-04-24 06:42:41 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/Property.java 2015-04-24 06:48:37 +0000
@@ -232,6 +232,11 @@
*/
private String href;
+ /**
+ * Used by linkService to link to the API endpoint containing this type.
+ */
+ private String apiEndpoint;
+
public Property()
{
}
@@ -656,6 +661,18 @@
this.href = href;
}
+ @JsonProperty
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+ public String getApiEndpoint()
+ {
+ return apiEndpoint;
+ }
+
+ public void setApiEndpoint( String apiEndpoint )
+ {
+ this.apiEndpoint = apiEndpoint;
+ }
+
public String key()
{
return isCollection() ? collectionName : name;
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/service/DefaultLinkService.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/service/DefaultLinkService.java 2015-04-24 06:42:41 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/service/DefaultLinkService.java 2015-04-24 06:48:37 +0000
@@ -150,6 +150,11 @@
if ( property.is( PropertyType.REFERENCE ) )
{
property.setHref( hrefBase + "/schemas/" + klassSchema.getSingular() );
+
+ if ( klassSchema.haveApiEndpoint() )
+ {
+ property.setApiEndpoint( hrefBase + klassSchema.getApiEndpoint() );
+ }
}
}
}