=== 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" ); }