← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6405: added rendering of Constansts in web-api

 

------------------------------------------------------------
revno: 6405
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-03-27 23:38:22 +0200
message:
  added rendering of Constansts in web-api
added:
  dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/constant.xsl
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/constant/Constant.java
  dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/model2html.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-api/src/main/java/org/hisp/dhis/constant/Constant.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/constant/Constant.java	2012-03-19 15:52:39 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/constant/Constant.java	2012-03-27 21:38:22 +0000
@@ -118,7 +118,7 @@
 
     @JsonProperty
     @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlProperty
+    @JacksonXmlProperty( namespace = Dxf2Namespace.NAMESPACE )
     public double getValue()
     {
         return value;

=== added file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/constant.xsl'
--- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/constant.xsl	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/constant.xsl	2012-03-27 21:38:22 +0000
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0"
+                xmlns="http://www.w3.org/1999/xhtml";
+                xmlns:d="http://dhis2.org/schema/dxf/2.0";
+    >
+
+  <xsl:template match="d:constant">
+    <div class="constant">
+      <h2> <xsl:value-of select="@d:name" /> </h2>
+
+      <table>
+        <tr>
+          <td>ID</td>
+          <td> <xsl:value-of select="@d:id" /> </td>
+        </tr>
+        <tr>
+          <td>Last Updated</td>
+          <td> <xsl:value-of select="@d:lastUpdated" /> </td>
+        </tr>
+        <tr>
+          <td>Code</td>
+          <td> <xsl:value-of select="@d:code" /> </td>
+        </tr>
+        <tr>
+          <td>Value</td>
+          <td> <xsl:value-of select="d:value" /> </td>
+        </tr>
+      </table>
+
+    </div>
+  </xsl:template>
+
+</xsl:stylesheet>

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/model2html.xsl'
--- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/model2html.xsl	2012-03-27 20:10:41 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/model2html.xsl	2012-03-27 21:38:22 +0000
@@ -18,6 +18,7 @@
   <xsl:include href="relativePeriods.xsl" />
   <xsl:include href="map.xsl" />
   <xsl:include href="chart.xsl" />
+  <xsl:include href="constant.xsl" />
   <xsl:include href="category.xsl" />
   <xsl:include href="categoryOption.xsl" />
   <xsl:include href="categoryCombo.xsl" />