← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6332: minor tweaks to pager in webapi

 

------------------------------------------------------------
revno: 6332
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-03-21 13:12:03 +0100
message:
  minor tweaks to pager in webapi
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/Resources.java
  dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/list.xsl


--
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-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/Resources.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/Resources.java	2012-03-19 22:10:02 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/Resources.java	2012-03-21 12:12:03 +0000
@@ -82,7 +82,7 @@
     }
 
     @JsonProperty
-    @JacksonXmlElementWrapper( localName = "resources" )
+    @JacksonXmlElementWrapper( localName = "resources", namespace = Dxf2Namespace.NAMESPACE )
     @JacksonXmlProperty( localName = "resource", namespace = Dxf2Namespace.NAMESPACE )
     public List<Resource> getResources()
     {

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/list.xsl'
--- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/list.xsl	2012-03-21 11:55:51 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/list.xsl	2012-03-21 12:12:03 +0000
@@ -33,8 +33,22 @@
       <table>
         <tr>
           <td>Page
-            <xsl:value-of select="page" /> /
-            <xsl:value-of select="pageCount" />
+            <xsl:choose>
+              <xsl:when test="page">
+                <xsl:value-of select="page" />
+              </xsl:when>
+              <xsl:otherwise>1</xsl:otherwise>
+            </xsl:choose>
+
+            <xsl:text> / </xsl:text>
+
+            <xsl:choose>
+              <xsl:when test="page">
+                <xsl:value-of select="pageCount" />
+              </xsl:when>
+              <xsl:otherwise>1</xsl:otherwise>
+            </xsl:choose>
+
           </td>
 
           <xsl:if test="prevPage">