=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java 2014-06-17 14:06:57 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java 2014-06-17 14:37:19 +0000 @@ -46,7 +46,6 @@ import org.hisp.dhis.hibernate.exception.DeleteAccessDeniedException; import org.hisp.dhis.hibernate.exception.UpdateAccessDeniedException; import org.hisp.dhis.importexport.ImportStrategy; -import org.hisp.dhis.node.config.Inclusions; import org.hisp.dhis.node.types.CollectionNode; import org.hisp.dhis.node.types.ComplexNode; import org.hisp.dhis.node.types.RootNode; @@ -120,7 +119,7 @@ // GET //-------------------------------------------------------------------------- - @RequestMapping( method = RequestMethod.GET ) + @RequestMapping(method = RequestMethod.GET) public @ResponseBody RootNode getObjectList( @RequestParam Map parameters, HttpServletResponse response, HttpServletRequest request ) { @@ -193,15 +192,15 @@ return rootNode; } - @RequestMapping( value = "/{uid}/{property}", method = RequestMethod.GET ) - public @ResponseBody RootNode getObjectProperty( @PathVariable( "uid" ) String uid, @PathVariable( "property" ) String property, + @RequestMapping(value = "/{uid}/{property}", method = RequestMethod.GET) + public @ResponseBody RootNode getObjectProperty( @PathVariable("uid") String uid, @PathVariable("property") String property, @RequestParam Map parameters, HttpServletRequest request, HttpServletResponse response ) throws Exception { return getObjectInternal( uid, parameters, Lists.newArrayList(), Lists.newArrayList( property ) ); } - @RequestMapping( value = "/{uid}", method = RequestMethod.GET ) - public @ResponseBody RootNode getObject( @PathVariable( "uid" ) String uid, @RequestParam Map parameters, + @RequestMapping(value = "/{uid}", method = RequestMethod.GET) + public @ResponseBody RootNode getObject( @PathVariable("uid") String uid, @RequestParam Map parameters, HttpServletRequest request, HttpServletResponse response ) throws Exception { List fields = Lists.newArrayList( contextService.getParameterValues( "fields" ) ); @@ -269,7 +268,7 @@ // POST //-------------------------------------------------------------------------- - @RequestMapping( method = RequestMethod.POST, consumes = { "application/xml", "text/xml" } ) + @RequestMapping(method = RequestMethod.POST, consumes = { "application/xml", "text/xml" }) public void postXmlObject( HttpServletResponse response, HttpServletRequest request, InputStream input ) throws Exception { if ( !aclService.canCreate( currentUserService.getCurrentUser(), getEntityClass() ) ) @@ -282,7 +281,7 @@ renderService.toXml( response.getOutputStream(), summary ); } - @RequestMapping( method = RequestMethod.POST, consumes = "application/json" ) + @RequestMapping(method = RequestMethod.POST, consumes = "application/json") public void postJsonObject( HttpServletResponse response, HttpServletRequest request, InputStream input ) throws Exception { if ( !aclService.canCreate( currentUserService.getCurrentUser(), getEntityClass() ) ) @@ -299,9 +298,9 @@ // PUT //-------------------------------------------------------------------------- - @RequestMapping( value = "/{uid}", method = RequestMethod.PUT, consumes = { MediaType.APPLICATION_XML_VALUE, MediaType.TEXT_XML_VALUE } ) - @ResponseStatus( value = HttpStatus.NO_CONTENT ) - public void putXmlObject( HttpServletResponse response, HttpServletRequest request, @PathVariable( "uid" ) String uid, InputStream + @RequestMapping(value = "/{uid}", method = RequestMethod.PUT, consumes = { MediaType.APPLICATION_XML_VALUE, MediaType.TEXT_XML_VALUE }) + @ResponseStatus(value = HttpStatus.NO_CONTENT) + public void putXmlObject( HttpServletResponse response, HttpServletRequest request, @PathVariable("uid") String uid, InputStream input ) throws Exception { List objects = getEntity( uid ); @@ -324,9 +323,9 @@ renderService.toXml( response.getOutputStream(), summary ); } - @RequestMapping( value = "/{uid}", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE ) - @ResponseStatus( value = HttpStatus.NO_CONTENT ) - public void putJsonObject( HttpServletResponse response, HttpServletRequest request, @PathVariable( "uid" ) String uid, InputStream + @RequestMapping(value = "/{uid}", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(value = HttpStatus.NO_CONTENT) + public void putJsonObject( HttpServletResponse response, HttpServletRequest request, @PathVariable("uid") String uid, InputStream input ) throws Exception { List objects = getEntity( uid ); @@ -353,9 +352,9 @@ // DELETE //-------------------------------------------------------------------------- - @RequestMapping( value = "/{uid}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE ) - @ResponseStatus( value = HttpStatus.NO_CONTENT ) - public void deleteObject( HttpServletResponse response, HttpServletRequest request, @PathVariable( "uid" ) String uid ) throws + @RequestMapping(value = "/{uid}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(value = HttpStatus.NO_CONTENT) + public void deleteObject( HttpServletResponse response, HttpServletRequest request, @PathVariable("uid") String uid ) throws Exception { List objects = getEntity( uid ); @@ -505,7 +504,7 @@ private String entitySimpleName; - @SuppressWarnings( "unchecked" ) + @SuppressWarnings("unchecked") protected Class getEntityClass() { if ( entityClass == null ) @@ -537,7 +536,7 @@ return entitySimpleName; } - @SuppressWarnings( "unchecked" ) + @SuppressWarnings("unchecked") protected T getEntityInstance() { try