dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #37228
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19051: add href to schema endpoints
------------------------------------------------------------
revno: 19051
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-04-29 13:16:55 +0700
message:
add href to schema endpoints
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/Property.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/Schema.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-28 08:57:55 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/Property.java 2015-04-29 06:16:55 +0000
@@ -233,7 +233,7 @@
private String href;
/**
- * Used by linkService to link to the API endpoint containing this type.
+ * Used by LinkService to link to the API endpoint containing this type.
*/
private String apiEndpoint;
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/Schema.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/Schema.java 2015-04-15 02:30:33 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/Schema.java 2015-04-29 06:16:55 +0000
@@ -114,6 +114,11 @@
private String apiEndpoint;
/**
+ * Used by LinkService to link to the Schema describing this type (if reference).
+ */
+ private String href;
+
+ /**
* Is this class considered metadata, this is mainly used for our metadata importer/exporter.
*/
private boolean metadata = true;
@@ -280,6 +285,18 @@
@JsonProperty
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+ public String getHref()
+ {
+ return href;
+ }
+
+ public void setHref( String href )
+ {
+ this.href = href;
+ }
+
+ @JsonProperty
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public boolean isMetadata()
{
return metadata;
=== 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:56:02 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/service/DefaultLinkService.java 2015-04-29 06:16:55 +0000
@@ -143,6 +143,8 @@
@Override
public void generateSchemaLinks( Schema schema, String hrefBase )
{
+ schema.setHref( hrefBase + "/schemas/" + schema.getSingular() );
+
for ( Property property : schema.getProperties() )
{
if ( PropertyType.REFERENCE == property.getPropertyType() )