dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #18281
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7651: updated to jackson 2.0.4, this means that the generated xml no longer includes the namespace alia...
------------------------------------------------------------
revno: 7651
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-07-20 12:15:43 +0200
message:
updated to jackson 2.0.4, this means that the generated xml no longer includes the namespace alias if its not needed (rather its provided as the default namespace for <metaData />). Changed the link attribute to be href instead, to provide alignment with current REST best practices.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseCollection.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseLinkableObject.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/LinkableObject.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/adapter/BaseIdentifiableObjectXmlAdapter.java
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/ResourceController.java
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/WebMetaData.java
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/WebUtils.java
dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/identifiable-row.xsl
dhis-2/pom.xml
--
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/BaseCollection.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseCollection.java 2012-03-27 17:38:48 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseCollection.java 2012-07-20 10:15:43 +0000
@@ -79,14 +79,14 @@
@JsonProperty
@JacksonXmlProperty( isAttribute = true, namespace = Dxf2Namespace.NAMESPACE )
- public String getLink()
+ public String getHref()
{
if ( linkableObject == null )
{
return null;
}
- return linkableObject.getLink();
+ return linkableObject.getHref();
}
/**
@@ -94,11 +94,11 @@
*
* @param link
*/
- public void setLink( String link )
+ public void setHref( String link )
{
if ( linkableObject != null )
{
- linkableObject.setLink( link );
+ linkableObject.setHref( link );
}
}
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseLinkableObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseLinkableObject.java 2012-04-08 20:23:29 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseLinkableObject.java 2012-07-20 10:15:43 +0000
@@ -42,17 +42,17 @@
* As part of the serializing process, this field can be set to indicate a link to this
* identifiable object (will be used on the web layer for navigating the REST API)
*/
- private transient String link;
+ private transient String href;
@JsonProperty
@JacksonXmlProperty( isAttribute = true )
- public String getLink()
+ public String getHref()
{
- return link;
+ return href;
}
- public void setLink( String link )
+ public void setHref( String href )
{
- this.link = link;
+ this.href = href;
}
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/LinkableObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/LinkableObject.java 2012-01-19 03:59:07 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/LinkableObject.java 2012-07-20 10:15:43 +0000
@@ -32,7 +32,7 @@
*/
public interface LinkableObject
{
- String getLink();
+ String getHref();
- void setLink( String link );
+ void setHref( String link );
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/adapter/BaseIdentifiableObjectXmlAdapter.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/adapter/BaseIdentifiableObjectXmlAdapter.java 2011-12-09 18:08:05 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/adapter/BaseIdentifiableObjectXmlAdapter.java 2012-07-20 10:15:43 +0000
@@ -52,7 +52,7 @@
bio.setUid( baseIdentifiableObject.getUid() );
bio.setName( baseIdentifiableObject.getName() );
bio.setLastUpdated( baseIdentifiableObject.getLastUpdated() );
- bio.setLink( baseIdentifiableObject.getLink() );
+ bio.setHref( baseIdentifiableObject.getHref() );
return bio;
}
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/ResourceController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/ResourceController.java 2012-06-06 16:37:56 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/ResourceController.java 2012-07-20 10:15:43 +0000
@@ -61,7 +61,7 @@
{
for ( Resource resource : resources.getResources() )
{
- resource.setLink( WebUtils.getPath( resource.getClazz() ) );
+ resource.setHref( WebUtils.getPath( resource.getClazz() ) );
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/WebMetaData.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/WebMetaData.java 2012-05-27 21:50:00 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/WebMetaData.java 2012-07-20 10:15:43 +0000
@@ -65,14 +65,14 @@
return null;
}
- return linkableObject.getLink();
+ return linkableObject.getHref();
}
public void setLink( String link )
{
if ( linkableObject != null )
{
- linkableObject.setLink( link );
+ linkableObject.setHref( link );
}
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/WebUtils.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/WebUtils.java 2012-07-13 20:45:06 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/WebUtils.java 2012-07-20 10:15:43 +0000
@@ -110,7 +110,7 @@
@SuppressWarnings( "unchecked" )
public static void generateLinks( IdentifiableObject identifiableObject )
{
- identifiableObject.setLink( getPathWithUid( identifiableObject ) );
+ identifiableObject.setHref( getPathWithUid( identifiableObject ) );
Collection<Field> fields = ReflectionUtils.collectFields( identifiableObject.getClass(), alwaysTrue );
@@ -123,7 +123,7 @@
if ( object != null )
{
IdentifiableObject idObject = (IdentifiableObject) object;
- idObject.setLink( getPathWithUid( idObject ) );
+ idObject.setHref( getPathWithUid( idObject ) );
}
}
else if ( ReflectionUtils.isCollection( field.getName(), identifiableObject, IdentifiableObject.class ) )
@@ -138,7 +138,7 @@
{
if ( object != null )
{
- object.setLink( getPathWithUid( object ) );
+ object.setHref( getPathWithUid( object ) );
}
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/identifiable-row.xsl'
--- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/identifiable-row.xsl 2012-04-08 20:23:29 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/identifiable-row.xsl 2012-07-20 10:15:43 +0000
@@ -5,10 +5,10 @@
<xsl:template match="*" mode="row">
<tr>
<td> <xsl:value-of select="@name"/> </td>
- <td> <a href="{@link}">html</a> </td>
- <td> <a href="{@link}.xml">xml</a> </td>
- <td> <a href="{@link}.json">json</a> </td>
- <td> <a href="{@link}.jsonp">jsonp</a> </td>
+ <td> <a href="{@href}">html</a> </td>
+ <td> <a href="{@href}.xml">xml</a> </td>
+ <td> <a href="{@href}.json">json</a> </td>
+ <td> <a href="{@href}.jsonp">jsonp</a> </td>
</tr>
</xsl:template>
=== modified file 'dhis-2/pom.xml'
--- dhis-2/pom.xml 2012-06-03 15:20:21 +0000
+++ dhis-2/pom.xml 2012-07-20 10:15:43 +0000
@@ -842,7 +842,7 @@
<spring.version>3.1.1.RELEASE</spring.version>
<spring.security.version>3.1.0.RELEASE</spring.security.version>
<hibernate.version>4.1.3.Final</hibernate.version>
- <jackson.version>2.0.2</jackson.version>
+ <jackson.version>2.0.4</jackson.version>
<camel.version>2.9.2</camel.version>
<slf4j.version>1.6.4</slf4j.version>
</properties>