It's all about the answers!

Ask a question

Retrieve Parent folder in project areas OSLC/REST


Ahmed EL-BERDHI (1515) | asked May 28 '19, 9:35 a.m.
edited May 28 '19, 9:38 a.m.

 Hey !!

I would like to retrieve the list of folders in a RM Project Area ?
Thanks.

Accepted answer


permanent link
Matthias Buettgen (23612332) | answered May 28 '19, 12:29 p.m.
HI,

In the service provider of your project do you find in general two query capabilities. One is for the requirements and the other one for folders. 
So search for the one with the resource type "http://jazz.net/ns/rm/navigation#folder"
Its querybase points to the rootfolder. If you fetch the results for the root folder you'll get a list of all subfolders underneath the root folder. In order to get the entire folder structure you have to go through each node recursively.

I hope this helps.

Regards
Matthias
Ahmed EL-BERDHI selected this answer as the correct answer

One other answer



permanent link
Ahmed EL-BERDHI (1515) | answered May 29 '19, 4:09 a.m.

 Hi,

Thank you for your answer :), i tried to check for the query capabilities for folders and all i found is capabilities for requirements and collections, maybe i'm looking in the wrong place ?!!

Greetings

Ahmed


Response :
<?xml version="1.0" encoding="UTF-8"?>

  <oslc_rm:ServiceDescriptor xmlns:oslc_rm="http://open-services.net/xmlns/rm/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" rdf:about="https://desktop-03i8ss7:9443/rm/oslc_rm/_Y887IHiQEem5IrL-GwEvYg/services.xml">

    <oslc_rm:links>

      <oslc_rm:LinkCreationServices>

        <oslc_rm:validatedByLinkFactory rdf:resource="https://desktop-03i8ss7:9443/rm/links/oslc/validatedByLinks"/>

        <oslc_rm:implementedByLinkFactory rdf:resource="https://desktop-03i8ss7:9443/rm/links/oslc/implementedByLinks"/>

      </oslc_rm:LinkCreationServices>

    </oslc_rm:links>

    <oslc_rm:collections>

      <oslc_rm:CollectionSelectionDialog>

        <oslc_rm:heightHint>550px</oslc_rm:heightHint>

        <oslc_rm:widthHint>800px</oslc_rm:widthHint>

        <oslc_rm:widget rdf:resource="https://desktop-03i8ss7:9443/rm/pickers/com.ibm.rdm.web.CollectionPicker?projectURL=https%3A%2F%2Fdesktop-03i8ss7%3A9443%2Frm%2Frm-projects%2F_Y887IHiQEem5IrL-GwEvYg"/>

        <dc:title xmlns:dc="http://purl.org/dc/terms/">Sélection de collection</dc:title>

      </oslc_rm:CollectionSelectionDialog>

    </oslc_rm:collections>

    <oslc_rm:requirements>

      <oslc_rm:SelectionDialog>

        <oslc_rm:heightHint>550px</oslc_rm:heightHint>

        <oslc_rm:widthHint>800px</oslc_rm:widthHint>

        <oslc_rm:widget rdf:resource="https://desktop-03i8ss7:9443/rm/pickers/com.ibm.rdm.web.RRCPicker?projectURL=https%3A%2F%2Fdesktop-03i8ss7%3A9443%2Frm%2Frm-projects%2F_Y887IHiQEem5IrL-GwEvYg"/>

        <dc:title xmlns:dc="http://purl.org/dc/terms/">Sélection d'exigence</dc:title>

      </oslc_rm:SelectionDialog>

    </oslc_rm:requirements>

    <dc:description xmlns:dc="http://purl.org/dc/terms/">Descripteur de service pour le projet : TProject Capella</dc:description>

    <dc:title xmlns:dc="http://purl.org/dc/terms/">TProject Capella</dc:title>

  </oslc_rm:ServiceDescriptor> 


Comments
Matthias Buettgen commented May 29 '19, 4:25 a.m.
It seems, as if you didn't set the required headers.
Make sure that the following headers in your http request are set :

OSLC-Core-Version : 2.0
Accept : application/rdf+xml



Once this has been done you should get the complete service provider.

Ahmed EL-BERDHI commented May 29 '19, 4:36 a.m.

 thank you for your help :)

have a nice day.
best regards.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.