← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6821: rendering of mapLegend, mapLegendSet and mapLayer as html on the web api

 

------------------------------------------------------------
revno: 6821
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-05-01 11:53:59 +0200
message:
  rendering of mapLegend, mapLegendSet and mapLayer as html on the web api
added:
  dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/mapLayer.xsl
  dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/mapLegend.xsl
  dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/mapLegendSet.xsl
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapLegend.java
  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/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/mapping/MapLegend.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapLegend.java	2012-04-11 07:28:51 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapLegend.java	2012-05-01 09:53:59 +0000
@@ -40,7 +40,7 @@
 /**
  * @author Jan Henrik Overland
  */
-@JacksonXmlRootElement( localName = "mapLegendSet", namespace = Dxf2Namespace.NAMESPACE )
+@JacksonXmlRootElement( localName = "mapLegend", namespace = Dxf2Namespace.NAMESPACE )
 public class MapLegend
     extends BaseIdentifiableObject
 {

=== 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-04-17 08:24:35 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/list.xsl	2012-05-01 09:53:59 +0000
@@ -18,7 +18,7 @@
       d:documents|d:indicatorGroups|d:indicatorGroupSets|d:organisationUnitGroups|
       d:organisationUnitGroupSets|d:indicatorTypes|d:attributeTypes|d:reports|d:constants|
       d:sqlViews|d:validationRules|d:validationRuleGroups|d:users|d:userGroups|d:userAuthorityGroups|
-      d:reportTables">
+      d:reportTables|d:mapLegends|d:mapLegendSets|d:mapLayers">
 
     <h3>
       <xsl:value-of select="local-name()" />

=== added file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/mapLayer.xsl'
--- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/mapLayer.xsl	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/mapLayer.xsl	2012-05-01 09:53:59 +0000
@@ -0,0 +1,62 @@
+<?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:mapLayer">
+    <div class="mapLayer">
+      <h2>
+        <xsl:value-of select="@name" />
+      </h2>
+      <table>
+        <tr>
+          <td>ID</td>
+          <td> <xsl:value-of select="@id" /> </td>
+        </tr>
+        <tr>
+          <td>Last Updated</td>
+          <td> <xsl:value-of select="@lastUpdated" /> </td>
+        </tr>
+        <tr>
+          <td>Code</td>
+          <td> <xsl:value-of select="@code" /> </td>
+        </tr>
+        <tr>
+          <td>Type</td>
+          <td> <xsl:value-of select="d:type" /> </td>
+        </tr>
+        <tr>
+          <td>URL</td>
+          <td> <xsl:value-of select="d:url" /> </td>
+        </tr>
+        <tr>
+          <td>Layers</td>
+          <td> <xsl:value-of select="d:layers" /> </td>
+        </tr>
+        <tr>
+          <td>Time</td>
+          <td> <xsl:value-of select="d:time" /> </td>
+        </tr>
+        <tr>
+          <td>Fill Color</td>
+          <td> <xsl:value-of select="d:fillColor" /> </td>
+        </tr>
+        <tr>
+          <td>Fill Opacity</td>
+          <td> <xsl:value-of select="d:fillOpacity" /> </td>
+        </tr>
+        <tr>
+          <td>Stroke Color</td>
+          <td> <xsl:value-of select="d:strokeColor" /> </td>
+        </tr>
+        <tr>
+          <td>Stroke Width</td>
+          <td> <xsl:value-of select="d:strokeWidth" /> </td>
+        </tr>
+      </table>
+
+    </div>
+  </xsl:template>
+
+</xsl:stylesheet>

=== added file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/mapLegend.xsl'
--- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/mapLegend.xsl	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/mapLegend.xsl	2012-05-01 09:53:59 +0000
@@ -0,0 +1,51 @@
+<?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:mapLegend">
+    <div class="mapLegend">
+      <h2>
+        <xsl:value-of select="@name" />
+      </h2>
+      <table>
+        <tr>
+          <td>ID</td>
+          <td> <xsl:value-of select="@id" /> </td>
+        </tr>
+        <tr>
+          <td>Last Updated</td>
+          <td> <xsl:value-of select="@lastUpdated" /> </td>
+        </tr>
+        <tr>
+          <td>Code</td>
+          <td> <xsl:value-of select="@code" /> </td>
+        </tr>
+        <tr>
+          <td>Image</td>
+          <td> <xsl:value-of select="d:image" /> </td>
+        </tr>
+        <tr>
+          <td>Start Value</td>
+          <td> <xsl:value-of select="d:startValue" /> </td>
+        </tr>
+        <tr>
+          <td>End Value</td>
+          <td> <xsl:value-of select="d:endValue" /> </td>
+        </tr>
+      </table>
+
+    </div>
+  </xsl:template>
+
+  <xsl:template match="d:mapLegends" mode="short">
+    <xsl:if test="count(child::*) > 0">
+      <h3>MapLegends</h3>
+      <table class="mapLegends">
+        <xsl:apply-templates select="child::*" mode="row"/>
+      </table>
+    </xsl:if>
+  </xsl:template>
+
+</xsl:stylesheet>

=== added file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/mapLegendSet.xsl'
--- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/mapLegendSet.xsl	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/mapLegendSet.xsl	2012-05-01 09:53:59 +0000
@@ -0,0 +1,40 @@
+<?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:mapLegendSet">
+    <div class="mapLegend">
+      <h2>
+        <xsl:value-of select="@name" />
+      </h2>
+      <table>
+        <tr>
+          <td>ID</td>
+          <td> <xsl:value-of select="@id" /> </td>
+        </tr>
+        <tr>
+          <td>Last Updated</td>
+          <td> <xsl:value-of select="@lastUpdated" /> </td>
+        </tr>
+        <tr>
+          <td>Code</td>
+          <td> <xsl:value-of select="@code" /> </td>
+        </tr>
+        <tr>
+          <td>Symbolizer</td>
+          <td> <xsl:value-of select="d:symbolizer" /> </td>
+        </tr>
+        <tr>
+          <td>Type</td>
+          <td> <xsl:value-of select="d:type" /> </td>
+        </tr>
+      </table>
+
+      <xsl:apply-templates select="d:mapLegends" mode="short"/>
+
+    </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-28 09:29:38 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/model2html.xsl	2012-05-01 09:53:59 +0000
@@ -17,6 +17,9 @@
   <xsl:include href="resource.xsl" />
   <xsl:include href="relativePeriods.xsl" />
   <xsl:include href="map.xsl" />
+  <xsl:include href="mapLegend.xsl" />
+  <xsl:include href="mapLegendSet.xsl" />
+  <xsl:include href="mapLayer.xsl" />
   <xsl:include href="chart.xsl" />
   <xsl:include href="constant.xsl" />
   <xsl:include href="category.xsl" />