← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11499: Minor

 

------------------------------------------------------------
revno: 11499
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-07-24 13:10:40 +0200
message:
  Minor
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/Dashboard.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardItem.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DashboardController.java


--
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/dashboard/Dashboard.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/Dashboard.java	2013-07-23 20:15:16 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/Dashboard.java	2013-07-24 11:10:40 +0000
@@ -119,6 +119,13 @@
         return null;
     }    
     
+    @JsonProperty
+    @JacksonXmlProperty
+    public int getItemCount()
+    {
+        return items == null ? 0 : items.size();
+    }
+    
     // -------------------------------------------------------------------------
     // Getters and setters
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardItem.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardItem.java	2013-07-23 17:21:14 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardItem.java	2013-07-24 11:10:40 +0000
@@ -137,7 +137,7 @@
     // -------------------------------------------------------------------------
 
     @JsonProperty
-    @JsonSerialize( contentAs = BaseIdentifiableObject.class )
+    @JsonSerialize( as = BaseIdentifiableObject.class )
     public Chart getChart()
     {
         return chart;
@@ -149,7 +149,7 @@
     }
     
     @JsonProperty
-    @JsonSerialize( contentAs = BaseIdentifiableObject.class )
+    @JsonSerialize( as = BaseIdentifiableObject.class )
     public Map getMap()
     {
         return map;

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DashboardController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DashboardController.java	2013-07-23 17:21:14 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DashboardController.java	2013-07-24 11:10:40 +0000
@@ -132,11 +132,11 @@
         ContextUtils.createdResponse( response, "Dashboard item created", item.getUid() );
     }
     
-    @RequestMapping( value = "/{uid}/items/content", method = RequestMethod.POST, consumes = "application/json" )
+    @RequestMapping( value = "/{dashboardUid}/items/content", method = RequestMethod.POST )
     public void postJsonItemContent( HttpServletResponse response, HttpServletRequest request, 
-        @PathVariable String uid, @RequestParam String type, @RequestParam( "uid" ) String contentUid ) throws Exception
+        @PathVariable String dashboardUid, @RequestParam String type, @RequestParam( "id" ) String contentUid ) throws Exception
     {
-        dashboardService.addItemContent( uid, type, contentUid );
+        dashboardService.addItemContent( dashboardUid, type, contentUid );
         
         ContextUtils.okResponse( response, "Dashboard item added" );
     }