← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13183: OrganisationUnitController, getEntitiesWithinRange, using fixed properties instead of map

 

------------------------------------------------------------
revno: 13183
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-12-09 19:33:36 +0100
message:
  OrganisationUnitController, getEntitiesWithinRange, using fixed properties instead of map
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/organisationunit/OrganisationUnitController.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/organisationunit/OrganisationUnitController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/organisationunit/OrganisationUnitController.java	2013-11-04 16:58:07 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/organisationunit/OrganisationUnitController.java	2013-12-09 18:33:36 +0000
@@ -257,19 +257,13 @@
     
     
     @RequestMapping(value = "/withinRange", method = RequestMethod.GET, produces = { "*/*", "application/json" })
-    public void getEntitiesWithinRange( @RequestParam Map<String, String> parameters,
+    public void getEntitiesWithinRange( @RequestParam Double longitude, @RequestParam Double latitude, 
+        @RequestParam Double distance, @RequestParam(required = false) String orgUnitGroupSetId,
         Model model, HttpServletRequest request, HttpServletResponse response ) throws Exception
     {
-        WebOptions options = new WebOptions( parameters );
-
-        Double longitude = Double.parseDouble( options.getOptions().get( "longitude" ) );
-        Double latitude = Double.parseDouble( options.getOptions().get( "latitude" ) );
-        Double distance = Double.parseDouble( options.getOptions().get( "distance" ) );
-        String orgUnitGroupSetId = options.getOptions().get( "orgUnitGroupSetId" );
-                
         List<OrganisationUnit> entityList = new ArrayList<OrganisationUnit>( organisationUnitService.getWithinCoordinateArea( longitude, latitude, distance ) );
                  
-        for( OrganisationUnit orgunit : entityList )
+        for ( OrganisationUnit orgunit : entityList )
         {
             Set<AttributeValue> attributeValues = orgunit.getAttributeValues();
             attributeValues.clear();