It's all about the answers!

Ask a question

DOORS - Folder search with using API


Mustafa Askin (108713) | asked May 21 '15, 7:43 a.m.
Hi everyone,

I am able to create an artifact & folder etc. But I have more than 2000 folders. Before creating an artifact I only know folder name. While creating an artifact I have to know folder URL.

Is there any documentation, any advice that how can I retrieve folder URL (ex:https://jazz:9443/rm/folders/_XqQ3Yf7fEeSTwNmIfiTrTw) by folder name? Otherwise I have to keep each folder url to somewhere(like db) to retrieve folder url.

My folder structure like this:
-a
--b
----c
----d
-x
--y
----c
----d
-t
--r
----c
----d

So if possible, I should be able to search folder "C" under folder "T"

One answer



permanent link
Jean-Luc Johnson (8125) | answered May 21 '15, 7:52 a.m.
Hello,
This is a recurrent question I think.
There is a very interesting blog post at https://jazz.net/library/article/1197 . Scroll down to the middle of the page to find few examples of folder queries.

I hope it helps.

Best regards,
JL


Comments
Naveen Tyagi commented Oct 05 '15, 8:06 a.m.

Hi Jean,
I have looked into the post but didn't find any way to search any perticlur folder, could you please give little bit description, how this will be implemented. Thanking  in advance.


Jean-Luc Johnson commented Oct 06 '15, 5:02 a.m.

Hello,
Ok, as OSLC is scalable, Folder concepts does not exist in OSLC RM, right? Since DNG was introduced with the new vocabulary "folder", DNG comes with new sets of services like query capability and creation factory for folder.
Please, read again the blog post, go to the section Exploring the project folder structure by using the folder query capability
In the project area service.xml  document, identify the related node. It will look like

 <oslc:QueryCapability>
        <dcterms:title rdf:parseType="Literal">Folder Query Capability</dcterms:title>
        <oslc:queryBase rdf:resource="https://grarrc.ibm.com:9443/rm/folders?oslc.where=public_rm:parent=https://grarrc.ibm.com:9443/rm/folders/_Or3t4OrtEeGaNr-hWVrMiw" />
    </oslc:QueryCapability>

  Then send  a GET on the appropriate URI to get the list of folder in your project area.
I hope it helps.
 


Donald Nong commented Oct 06 '15, 11:08 p.m.

You can't actually "search" a folder, as the folder query capability just gives a way to "locate" the root folder. See below post and the blog for more details.
https://jazz.net/forum/questions/103026/how-to-query-the-folder-by-its-name-using-oslc
https://rhnaranjo.wordpress.com/2012/06/25/folder-support-added-to-rrc-4-0-oslc-rm-api-implementation/


Jean-Luc Johnson commented Oct 07 '15, 5:52 a.m.

HI Donald,
You are probably right.
Maybe there is no built-in advanced service for query folders.
However, the query capability service gives you all the folders available in a given project area. Then you could easily apply a filter in order to extract only the URI of the one you are interested in.
I wrote this code 2-3 years ago using java Xpath, it is doable!
Find attached the code written by my student.

I hope it helps.


Your answer


Register or to post your answer.