dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #28046
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13981: minor fix
------------------------------------------------------------
revno: 13981
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-02-11 11:27:09 +0700
message:
minor fix
modified:
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AbstractCrudController.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-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AbstractCrudController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AbstractCrudController.java 2014-02-11 04:22:08 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AbstractCrudController.java 2014-02-11 04:27:09 +0000
@@ -84,18 +84,12 @@
// GET
//--------------------------------------------------------------------------
- @RequestMapping(value = "/filtered", method = RequestMethod.GET)
+ @RequestMapping( value = "/filtered", method = RequestMethod.GET )
public void getJacksonClassMap(
- @RequestParam(required = false) String include,
- @RequestParam(required = false) String exclude,
+ @RequestParam( required = false ) String include,
+ @RequestParam( required = false ) String exclude,
@RequestParam Map<String, String> parameters, HttpServletResponse response ) throws IOException
{
- if ( include == null && exclude == null )
- {
- // JacksonUtils.toJson( response.getOutputStream(), ReflectionUtils.getJacksonClassMap( getEntityClass() ) );
- // return;
- }
-
WebOptions options = new WebOptions( parameters );
WebMetaData metaData = new WebMetaData();
List<T> entityList = getEntityList( metaData, options );
@@ -118,7 +112,7 @@
JacksonUtils.toJson( response.getOutputStream(), output );
}
- @RequestMapping(method = RequestMethod.GET)
+ @RequestMapping( method = RequestMethod.GET )
public String getObjectList( @RequestParam Map<String, String> parameters, Model model, HttpServletRequest request ) throws Exception
{
WebOptions options = new WebOptions( parameters );
@@ -145,7 +139,7 @@
return StringUtils.uncapitalize( getEntitySimpleName() ) + "List";
}
- @RequestMapping(value = "/query/{query}", method = RequestMethod.GET)
+ @RequestMapping( value = "/query/{query}", method = RequestMethod.GET )
public String query( @PathVariable String query, @RequestParam Map<String, String> parameters, Model model, HttpServletRequest request ) throws Exception
{
WebOptions options = new WebOptions( parameters );
@@ -174,8 +168,8 @@
return StringUtils.uncapitalize( getEntitySimpleName() ) + "List";
}
- @RequestMapping(value = "/{uid}", method = RequestMethod.GET)
- public String getObject( @PathVariable("uid") String uid, @RequestParam Map<String, String> parameters,
+ @RequestMapping( value = "/{uid}", method = RequestMethod.GET )
+ public String getObject( @PathVariable( "uid" ) String uid, @RequestParam Map<String, String> parameters,
Model model, HttpServletRequest request, HttpServletResponse response ) throws Exception
{
WebOptions options = new WebOptions( parameters );
@@ -205,7 +199,7 @@
return StringUtils.uncapitalize( getEntitySimpleName() );
}
- @RequestMapping(value = "/search/{query}", method = RequestMethod.GET)
+ @RequestMapping( value = "/search/{query}", method = RequestMethod.GET )
public String search( @PathVariable String query, @RequestParam Map<String, String> parameters,
Model model, HttpServletRequest request, HttpServletResponse response ) throws Exception
{
@@ -235,13 +229,13 @@
// 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
{
throw new HttpRequestMethodNotSupportedException( RequestMethod.POST.toString() );
}
- @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
{
throw new HttpRequestMethodNotSupportedException( RequestMethod.POST.toString() );
@@ -251,16 +245,16 @@
// PUT
//--------------------------------------------------------------------------
- @RequestMapping(value = "/{uid}", method = RequestMethod.PUT, consumes = { "application/xml", "text/xml" })
- @ResponseStatus(value = HttpStatus.NO_CONTENT)
- public void putXmlObject( HttpServletResponse response, HttpServletRequest request, @PathVariable("uid") String uid, InputStream input ) throws Exception
+ @RequestMapping( value = "/{uid}", method = RequestMethod.PUT, consumes = { "application/xml", "text/xml" } )
+ @ResponseStatus( value = HttpStatus.NO_CONTENT )
+ public void putXmlObject( HttpServletResponse response, HttpServletRequest request, @PathVariable( "uid" ) String uid, InputStream input ) throws Exception
{
throw new HttpRequestMethodNotSupportedException( RequestMethod.PUT.toString() );
}
- @RequestMapping(value = "/{uid}", method = RequestMethod.PUT, consumes = "application/json")
- @ResponseStatus(value = HttpStatus.NO_CONTENT)
- public void putJsonObject( HttpServletResponse response, HttpServletRequest request, @PathVariable("uid") String uid, InputStream input ) throws Exception
+ @RequestMapping( value = "/{uid}", method = RequestMethod.PUT, consumes = "application/json" )
+ @ResponseStatus( value = HttpStatus.NO_CONTENT )
+ public void putJsonObject( HttpServletResponse response, HttpServletRequest request, @PathVariable( "uid" ) String uid, InputStream input ) throws Exception
{
throw new HttpRequestMethodNotSupportedException( RequestMethod.PUT.toString() );
}
@@ -269,9 +263,9 @@
// DELETE
//--------------------------------------------------------------------------
- @RequestMapping(value = "/{uid}", method = RequestMethod.DELETE)
- @ResponseStatus(value = HttpStatus.NO_CONTENT)
- public void deleteObject( HttpServletResponse response, HttpServletRequest request, @PathVariable("uid") String uid ) throws Exception
+ @RequestMapping( value = "/{uid}", method = RequestMethod.DELETE )
+ @ResponseStatus( value = HttpStatus.NO_CONTENT )
+ public void deleteObject( HttpServletResponse response, HttpServletRequest request, @PathVariable( "uid" ) String uid ) throws Exception
{
throw new HttpRequestMethodNotSupportedException( RequestMethod.DELETE.toString() );
}
@@ -420,7 +414,7 @@
private String entitySimpleName;
- @SuppressWarnings("unchecked")
+ @SuppressWarnings( "unchecked" )
protected Class<T> getEntityClass()
{
if ( entityClass == null )
@@ -452,7 +446,7 @@
return entitySimpleName;
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings( "unchecked" )
protected T getEntityInstance()
{
try