← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5446: Web api, documented usage of data resources in html view for relevant resources

 

------------------------------------------------------------
revno: 5446
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-12-15 22:05:08 +0100
message:
  Web api, documented usage of data resources in html view for relevant resources
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/MapController.java
  dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/chart.xsl
  dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/document.xsl
  dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/map.xsl
  dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/report.xsl
  dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/reportTable.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/controller/MapController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/MapController.java	2011-12-15 19:55:51 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/MapController.java	2011-12-15 21:05:08 +0000
@@ -39,6 +39,8 @@
 import org.hisp.dhis.mapping.MapView;
 import org.hisp.dhis.mapping.MappingService;
 import org.hisp.dhis.mapping.Maps;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.stereotype.Controller;
@@ -58,6 +60,9 @@
     
     @Autowired
     private MappingService mappingService;
+    
+    @Autowired
+    private OrganisationUnitService organisationUnitService;
 
     //-------------------------------------------------------------------------------------------------------
     // GET
@@ -108,8 +113,15 @@
     public String getMap( Model model,
         @RequestParam( value = "in" ) String indicatorUid, 
         @RequestParam( value = "ou" ) String organisationUnitUid,
-        @RequestParam Integer level )
+        @RequestParam( value = "level", required = false ) Integer level )
     {
+        if ( level == null )
+        {
+            OrganisationUnit unit = organisationUnitService.getOrganisationUnit( organisationUnitUid );
+            
+            level = organisationUnitService.getLevelOfOrganisationUnit( unit.getId() );
+        }
+        
         MapView mapView = mappingService.getIndicatorLastYearMapView( indicatorUid, organisationUnitUid, level );
 
         model.addAttribute( "model", mapView );

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/chart.xsl'
--- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/chart.xsl	2011-12-15 20:23:22 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/chart.xsl	2011-12-15 21:05:08 +0000
@@ -10,9 +10,48 @@
 	  
 	  <table>
 		<tr>
-			<td>Data</td>
+			<td>Resource Data</td>
 			<td><a href="{@link}/data">png</a></td>
 		</tr>
+		<tr>
+			<td>width</td>
+			<td>width in px (opt)</td>
+		</tr>
+		<tr>
+			<td>height</td>
+			<td>height in px (opt)</td>
+		</tr>
+	  </table><br/>
+	  
+	  <table>
+		<tr>
+			<td>Dynamic Data</td>
+			<td><a href="data">png</a></td>
+		</tr>
+		<tr>
+			<td>ou</td>
+			<td>organisation unit uid (req)</td>
+		</tr>
+		<tr>
+			<td>pe</td>
+			<td>period yyyy-MM-dd (req)</td>
+		</tr>
+		<tr>
+			<td>periods</td>
+			<td>use periods or org units (opt)</td>
+		</tr>
+		<tr>
+			<td>width</td>
+			<td>width in px (opt)</td>
+		</tr>
+		<tr>
+			<td>height</td>
+			<td>height in px (opt)</td>
+		</tr>
+		<tr>
+			<td>skipTitle</td>
+			<td>skip title (opt)</td>
+		</tr>
 	  </table><br/>
 	  
       <a href="{@link}/data"><img src="{@link}/data" style="border-style:solid; border-width: 1px; padding: 5px;" /></a>

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/document.xsl'
--- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/document.xsl	2011-12-15 20:23:22 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/document.xsl	2011-12-15 21:05:08 +0000
@@ -10,7 +10,7 @@
 	  
 	  <table>
 		<tr>
-			<td>Data</td>
+			<td>Resource Data</td>
 			<td><a href="{@link}/data">any</a></td>
 		</tr>
 	  </table><br/>

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/map.xsl'
--- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/map.xsl	2011-12-15 20:23:22 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/map.xsl	2011-12-15 21:05:08 +0000
@@ -8,11 +8,30 @@
 	  
 	  <table>
 		<tr>
-			<td>Data</td>
+			<td>Resource Data</td>
 			<td><a href="{@link}/data">png</a></td>
 		</tr>
 	  </table><br/>
 	  
+	  <table>
+		<tr>
+			<td>Dynamic Data</td>
+			<td><a href="data">png</a></td>
+		</tr>
+		<tr>
+			<td>in</td>
+			<td>indicator uid (req)</td>
+		</tr>
+		<tr>
+			<td>ou</td>
+			<td>organisation unit uid (req)</td>
+		</tr>
+		<tr>
+			<td>level</td>
+			<td>organisation unit level (opt)</td>
+		</tr>
+	  </table><br/>
+	  
       <a href="{@link}/data"><img src="{@link}/data" style="border-style:solid; border-width: 1px; padding: 5px;" /></a>
 
       <h3>Details</h3>

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/report.xsl'
--- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/report.xsl	2011-12-15 20:23:22 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/report.xsl	2011-12-15 21:05:08 +0000
@@ -10,10 +10,18 @@
 	  
 	  <table>
 		<tr>
-			<td>Data</td>
+			<td>Resource Data</td>
 			<td><a href="{@link}/data">pdf</a></td>
 			<td><a href="{@link}/data.xls">xls</a></td>
 		</tr>
+		<tr>
+			<td>ou</td>
+			<td colspan="2">organisation unit uid (opt)</td>
+		</tr>
+		<tr>
+			<td>pe</td>
+			<td colspan="2">period yyyy-MM-dd (opt)</td>
+		</tr>
 	  </table><br/>
 	  
       <table>

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/reportTable.xsl'
--- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/reportTable.xsl	2011-12-15 20:23:22 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/reportTable.xsl	2011-12-15 21:05:08 +0000
@@ -10,12 +10,20 @@
 	  
 	  <table>
 		<tr>
-			<td>Data</td>
+			<td>Resource Data</td>
 			<td><a href="{@link}/data">html</a></td>
 			<td><a href="{@link}/data.pdf">pdf</a></td>
 			<td><a href="{@link}/data.xls">xls</a></td>
 			<td><a href="{@link}/data.csv">csv</a></td>
 		</tr>
+		<tr>
+			<td>ou</td>
+			<td colspan="4">organisation unit uid (opt)</td>
+		</tr>
+		<tr>
+			<td>pe</td>
+			<td colspan="4">period yyyy-MM-dd (opt)</td>
+		</tr>
 	  </table><br/>
 	  	  
       <table>