=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/user/CurrentUserController.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/user/CurrentUserController.java 2013-08-30 14:03:13 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/user/CurrentUserController.java 2013-08-30 15:36:39 +0000 @@ -294,14 +294,22 @@ } } - - JacksonUtils.toJson( response.getOutputStream(), userOrganisationUnits ); + String viewName = parameters.get( "viewClass" ); + + if ( viewName == null ) + { + viewName = "detailed"; + } + + Class viewClass = JacksonUtils.getViewClass( viewName ); + + JacksonUtils.toJsonWithView( response.getOutputStream(), userOrganisationUnits, viewClass ); } - @SuppressWarnings("unchecked") - @RequestMapping(value = { "/assignedPrograms" }, produces = { "application/json", "text/*" }) + @SuppressWarnings( "unchecked" ) + @RequestMapping( value = { "/assignedPrograms" }, produces = { "application/json", "text/*" } ) public void getPrograms( HttpServletResponse response, @RequestParam Map parameters, - @RequestParam(defaultValue = "1") Integer type ) + @RequestParam( defaultValue = "1" ) Integer type ) throws IOException, NotAuthenticatedException { User currentUser = currentUserService.getCurrentUser(); @@ -389,8 +397,8 @@ JacksonUtils.toJson( response.getOutputStream(), forms ); } - @SuppressWarnings("unchecked") - @RequestMapping(value = "/assignedDataSets", produces = { "application/json", "text/*" }) + @SuppressWarnings( "unchecked" ) + @RequestMapping( value = "/assignedDataSets", produces = { "application/json", "text/*" } ) public void getDataSets( HttpServletResponse response, @RequestParam Map parameters ) throws IOException, NotAuthenticatedException { User currentUser = currentUserService.getCurrentUser();