It's all about the answers!

Ask a question

Retrieve folders from rest API


TGS Thales (152) | asked Mar 27 '17, 12:50 p.m.

Hello,

We try to retrieve from a project ID the list of folders.
We have a look to this article : https://rhnaranjo.wordpress.com/2012/06/25/folder-support-added-to-rrc-4-0-oslc-rm-api-implementation/.
But it seems that it does not work.

We also try with the "DNGReportableRestAPI", but the type 'folder' is unknown.

Is anybody found a way to retrieve the list of folders from a project ID ?

Thanks in advance.

Accepted answer


permanent link
Donald Nong (14.4k213) | answered Mar 31 '17, 12:53 a.m.
TGS Thales selected this answer as the correct answer

Comments
TGS Thales commented May 11 '17, 12:26 p.m.

Hi Donald,
Thank you for your answer.
I follow also your article and the workshop of the lab, and I can get the folders.
But, it seems that the oslc is independant of 'stream' or 'baseline' to retrieve the folders.
Because I provide a parameter like 'oslc_config.context' or add for the Header the parameter 'OSLC-Configuration-Context', and it seems that it is not work .

Or maybe folders are 'stream independant' ?


Donald Nong commented May 12 '17, 1:31 a.m.

It works for me. I can see different contents when I use different configurations with the same folder query API. That is, there are different contents in different streams, and the API reflects this just fine.


TGS Thales commented May 12 '17, 8:29 a.m.

Which parameter do you provide ?
My request is like :
https://dngserver.public.name:port/rm/folders?oslc.where=public_rm:parent= https://dngserver.public.name:port /rm/folders/projectID

And my header has the following parameters:
catalogDoc.addHeader("Accept", "application/xml")
catalogDoc.addHeader("OSLC-Core-Version", "2.0")

I try to add the parameter 'OSLC-Configuration-Context" with the streamUri like " https://dngserver.public.name:port/rm/cm/stream/_XYZ ", but i get no my added folder in the stream...


Donald Nong commented May 14 '17, 10:01 p.m.

How did you come up with this parameter? You should use "vvc.configuration" (for local configurations only) or "oslc_config.context" (for both global and local configurations). See the "Configurations" section in the below article
https://jazz.net/wiki/bin/view/Main/DNGReportableRestAPI#Configurations
(The article talks about reportable REST API but these two parameters work with OSLC API as well)


TGS Thales commented May 19 '17, 5:41 a.m.

The OSLC-Configuration-Context was found in this page (http://open-services.net/wiki/configuration-management/Configuration-Management-Resource-Definitions/#Configuration-context).
And when I try oslc_config.context, I have no difference.
But the good news is with the 'vvc.configuration', I get folders in the selected stream.

I didn't know that some parameters for REST API can work for OSLC.

Many thanks for your help.

Your answer


Register or to post your answer.