← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4592: changed from id to uuid in jsonp

 

------------------------------------------------------------
revno: 4592
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-09-15 15:36:33 +0200
message:
  changed from id to uuid in jsonp
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/resources/DataSetsResourceP.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/web/api/resources/DataSetsResourceP.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/resources/DataSetsResourceP.java	2011-09-15 13:33:15 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/resources/DataSetsResourceP.java	2011-09-15 13:36:33 +0000
@@ -75,19 +75,19 @@
     }
 
     @GET
-    @Path("dataSets/{id}")
+    @Path("dataSets/{uuid}")
     @Produces( { "application/x-javascript" } )
-    public JSONWithPadding getDataSet( @PathParam("id") Integer id, @QueryParam( "callback" ) @DefaultValue( "callback" ) String callback )
+    public JSONWithPadding getDataSet( @PathParam("uuid") String uuid, @QueryParam( "callback" ) @DefaultValue( "callback" ) String callback )
     {
-        DataSet dataSet = dataSetService.getDataSet( id );
+        DataSet dataSet = dataSetService.getDataSet( uuid );
 
         if ( dataSet == null )
         {
-            throw new IllegalArgumentException( "No dataset with id " + id );
+            throw new IllegalArgumentException( "No dataset with uuid " + uuid );
         }
 
         Map<String, Object> dataSetMap = new HashMap<String, Object>();
-        dataSetMap.put( "id", dataSet.getId() );
+        dataSetMap.put( "uuid", dataSet.getUuid() );
         dataSetMap.put( "name", dataSet.getName() );
 
         return new JSONWithPadding( dataSetMap, callback );