------------------------------------------------------------ revno: 15652 committer: Morten Olav Hansen <morte...@gmail.com> branch nick: dhis2 timestamp: Thu 2014-06-12 16:34:04 +0200 message: removed /api/optionSets/ID/options and /version, now supported generically through AbstractCrudController (slighly different format) modified: dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/OptionSetController.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/webapi/controller/OptionSetController.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/OptionSetController.java 2014-05-27 13:18:27 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/OptionSetController.java 2014-06-12 14:34:04 +0000 @@ -28,22 +28,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import org.hisp.dhis.dxf2.utils.JacksonUtils; -import org.hisp.dhis.option.OptionService; import org.hisp.dhis.option.OptionSet; import org.hisp.dhis.schema.descriptors.OptionSetSchemaDescriptor; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** * @author Morten Olav Hansen <morte...@gmail.com> @@ -53,29 +41,4 @@ public class OptionSetController extends AbstractCrudController<OptionSet> { - @Autowired - private OptionService optionService; - - @RequestMapping( value = "/{uid}/version", method = RequestMethod.GET ) - public void getVersion( @PathVariable( "uid" ) String uid, @RequestParam Map<String, String> parameters, - HttpServletResponse response ) throws IOException - { - OptionSet optionSet = manager.get( OptionSet.class, uid ); - - Map<String, Integer> versionMap = new HashMap<String, Integer>(); - versionMap.put( "version", optionSet.getVersion() ); - - JacksonUtils.toJson( response.getOutputStream(), versionMap ); - } - - @RequestMapping( value = "/{uid}/options", method = RequestMethod.GET ) - public void getOptions( @PathVariable( "uid" ) String uid, - @RequestParam( required = false ) String key, - @RequestParam( required = false ) Integer max, - HttpServletResponse response ) throws IOException - { - List<String> options = optionService.getOptions( uid, key, max ); - - JacksonUtils.toJson( response.getOutputStream(), options ); - } }
_______________________________________________ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp