← Back to team overview

dhis2-devs team mailing list archive

Re: baffled with web api

 

Hi Bob

This should be as easy as adding another method.. we already have
getObjectList (I think thats the name.. ) in our ABC. What you will need to
do, is to add another method in DataSetController, maybe call it
getDataSetsDSD (or something similar). And have a request-mapping that
points to both dataSets and dataSets.dsd, this together with the consumed =
mimetype option, should give you a unique combination (spring mvc will
complain if two requestmappings point to the same method)

Try it... if its not working, I will try and add it for you

--
Morten


On Sat, Oct 27, 2012 at 6:54 PM, Bob Jolliffe <bobjolliffe@xxxxxxxxx> wrote:

> Hi Morten
>
> I am struggling to grasp something (well actually to do something)
> which I thought would be fairly simple, and probably even is if only I
> knew how ...
>
> It has to do with where you have been clever with the
> AbstractCrudController in the web api.
>
> Something like DataSetController extends this.
>
> Currently /api/dataSets returns you the full list of datasets
> formatted in html.  And using either the extension (.xml or .json) or
> accept headers we can get xml or json renditions of the same.
>
> But I want to return an alternative xml description of the structure
> of the datasets (lets call it as data structure definition or DSD).
> Is there any way to map a request which uses either an extension (eg
> dataSets.dsd) or accept header (eg application/dsd+xml) which DOES NOT
> get routed through the getObjectList method of AbstractCrudController?
>
> Bob
>

Follow ups

References