← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7155: Minor update to data value set controller re consuming content types

 

------------------------------------------------------------
revno: 7155
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2012-06-02 22:53:02 +0200
message:
  Minor update to data value set controller re consuming content types
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataValueSetController.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/DataValueSetController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataValueSetController.java	2012-06-01 22:00:36 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataValueSetController.java	2012-06-02 20:53:02 +0000
@@ -89,7 +89,7 @@
         dataValueSetService.writeDataValueSet( dataSet, period, orgUnit, response.getOutputStream() );
     }
 
-    @RequestMapping( method = RequestMethod.POST, headers = {"Content-Type=application/dxf2+xml"} )
+    @RequestMapping( method = RequestMethod.POST, consumes = "application/xml" )
     @PreAuthorize( "hasRole('ALL') or hasRole('F_DATAVALUE_ADD')" )
     public void postDxf2DataValueSet( ImportOptions importOptions,
                                   HttpServletResponse response, 
@@ -104,7 +104,7 @@
         JacksonUtils.toXml( response.getOutputStream(), summary );
     }
     
-    @RequestMapping( method = RequestMethod.POST, headers = {"Content-Type=application/sdmx+xml"} )
+    @RequestMapping( method = RequestMethod.POST, consumes = "application/sdmx+xml" )
     @PreAuthorize( "hasRole('ALL') or hasRole('F_DATAVALUE_ADD')" )
     public void postSDMXDataValueSet( ImportOptions importOptions,
                                   HttpServletResponse response, 
@@ -119,7 +119,7 @@
         JacksonUtils.toXml( response.getOutputStream(), summary );
     }
 
-    @RequestMapping( method = RequestMethod.POST, headers = {"Content-Type=application/xml"} )
+    @RequestMapping( method = RequestMethod.POST, consumes = "application/dhis+xml" )
     @PreAuthorize( "hasRole('ALL') or hasRole('F_DATAVALUE_ADD')" )
     public void postDataValueSet( ImportOptions importOptions,
                                   HttpServletResponse response, 
@@ -133,7 +133,7 @@
         response.setContentType( CONTENT_TYPE_XML );        
         JacksonUtils.toXml( response.getOutputStream(), summary );
     }
-        
+    
     @ExceptionHandler(IllegalArgumentException.class)
     public void handleError( IllegalArgumentException ex, HttpServletResponse response )
         throws IOException