← Back to team overview

dhis2-devs team mailing list archive

Re: web api

 

On 28 June 2012 11:10, Morten Olav Hansen <mortenoh@xxxxxxxxx> wrote:
>> I'm not sure if this is the correct answer but perhaps Morten or Lars
>> will chip in if they have time.  As far as I can see you are right ..
>> there is no parent field in the listed orgunits at
>> api/organisationUnits which you would need to construct the hierarchy.
>
> There should be a parent field there, if not, there is something wrong
> (demo is old, so I don't know about that). In general I would suggest
> using 2.9 (trunk) for WebAPI development since it contains so many
> improvements.

demo is old .. there are no parenets.  Morten is right.  the api is a
bit fast moving at the moment so best to try and follow trunk.

>
>> You can get this information however by querying the metadata as a
>> more complete collection: eg
>> http://apps.dhis2.org/demo/api/metaData.xml
>
> The same information should be available at:
> /api/organisationUnits?viewClass=export
> and
> /api/metaData?assumeTrue=false&organisationUnits=true

I can confirm this works on dev:
http://apps.dhis2.org/dev/api/organisationUnits.xml?viewClass=export

though I am not seeing any effect of
"assumeTrue=false&organisationUnits=true" on the metaData url.
Probably in trunk.  I'll test myself later.

Alice I think viewClass=export might solve your problem.  Or is there
something else you are getting at with your question?

Regards
Bob


> (but not on demo, try dev. Sorry, I can't access the UiO network from
> where I am now)
>
> --
> Morten
>
>> This will give you the list of orgunits with parent field and also
>> conveniently in order from top of the tree down to the base (a
>> breadth-wise traversal).  You should be able to construct your
>> javascript or html UI with this data.
>>
>> There are also some options to restrict whether *only* orgunits are
>> shown but I can't remember them offhand.  Once I've looked up I'll let
>> you know.
>>
>> Cheers
>> Bob
>>
>>>
>>> Thanks,
>>>   Alice
>>>
>>>
>>> On Wed, Jun 27, 2012 at 5:02 PM, Bob Jolliffe <bobjolliffe@xxxxxxxxx> wrote:
>>>>
>>>> Sure.  Alice I don't know what you are going to ask or if I have the
>>>> answer, but in case I don't. I presume you won't have a problem if I
>>>> direct to the dhis2 developers list?
>>>>
>>>> On 27 June 2012 12:27, Sundeep Sahay <sundeep.sahay@xxxxxxxxx> wrote:
>>>> > bob,
>>>> > alice had some queries on the WebAPI
>>>> > can i direct her to you?
>>>> > thanks
>>>
>>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dhis2-devs
>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help   : https://help.launchpad.net/ListHelp


Follow ups

References