It's all about the answers!

Ask a question

How can I list the requirements within a folder in DOORS Next Generation?


Jean-Luc Johnson (8115) | asked Oct 01 '13, 1:28 p.m.
edited Oct 01 '13, 10:51 p.m. by Geoffrey Clemm (29.4k23035)
I'm using RM 4.0.3 and a REST plugin to get RDF documents from RM (I assume DOORS Next Generation).
I'm developing a java client for jazz RM  4.0.3 and I would like to build a tree structure of my project area and to access accurately only requirements (or other artifact types) in a given folder. Here is my issue.

So far I can get the list of project areas, I can retrieve the list of folders and subfolders. But I realised that the service document (i.e https://servername:9443/rm/discovery/_X07S0iptEeODGMSiZX4rMQ/services.xml) is the same for all the containers and it uses the project area ID (here it would be _X07S0iptEeODGMSiZX4rMQ). In the end I always get a flat list of the requirements.

Question: How can I use the query capability service to display only the artifact  type requirement resources in a given folder ?
Any idea or workaround is welcome.
Thanks,
Jean-Luc


5 answers



permanent link
Bas Bekker (1.4k4) | answered Oct 01 '13, 2:39 p.m.
JAZZ DEVELOPER
Hi,

Look at this link for folder support in RM: Folder Support in RRC 4.0 OSLC API
As it is the same RM server, support includes DNG 4.0.3

permanent link
Jean-Luc Johnson (8115) | answered Sep 04 '15, 5:27 a.m.
Exploring the project folder structure is relatively simple. In the service provider service.xml document, look for the folder service query capability. That is one of the Jazz specific concept. It should 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>
Copy the query base
https://grarrc.ibm.com:9443/rm/folders?oslc.where=public_rm:parent=https://grarrc.ibm.com:9443/rm/folders/_Or3t4OrtEeGaNr-hWVrMiw then replace with your server.

It should work.

Regards,



Comments
Naveen Tyagi commented Sep 15 '15, 6:49 a.m.

Thanks Jean!! Finally i am able to get the folder list inside the project. now i have folder name with URi.

Now i want to get list of the requirements in any of these folder. can you please let me know correct URi and way whether GET or query capabilities. I have tried both way
on the URL given in this (https://jazz.net/library/article/1197) article but still dind't work.

&oslc.prefix=oslc=<http://open-services.net/ns/core%23>,\
dcterms=<http://purl.org/dc/terms/>,nav=<http://com.ibm.rdm/navigation%23>
&oslc.select=dcterms:title,dcterms:description,oslc:instanceShape&oslc.where=nav:parent=<https://grarrc.ibm.com:9443/rm/folders/_RHCJYN5jEeGb6IIbvOh9Dw>


permanent link
Jean-Luc Johnson (8115) | answered Oct 02 '13, 9:30 a.m.
edited Oct 24 '13, 6:30 a.m.
Hi Bas,
The link you have mentioned takes me back to this web site. An answer could be in the article at https://jazz.net/library/article/1197
I will investigate later on. Many thanks

permanent link
Jean-Luc Johnson (8115) | answered Oct 24 '13, 6:41 a.m.
I tried the query snippet codes at https://jazz.net/library/article/1197 and it worked.
Here is the answer.
First get the query capability service, example:
https://grarrc.ibm.com:9443/rm/views?oslc.query=true&projectURL=https://grarrc.ibm.com:9443/jts/process/project-areas/_C7NVcttZEeG_kKBmAlkUvA"

To query the requirements in a specific folder, append to the the query capability a query similar to the following one:
&oslc.prefix=oslc=<http://open-services.net/ns/core%23>,dcterms=<http://purl.org/dc/terms/>,nav=<http://com.ibm.rdm/navigation%23>&oslc.select=dcterms:title,dcterms:description,oslc:instanceShape&oslc.where=nav:parent=<https://grarrc.ibm.com:9443/rm/folders/_RHCJYN5jEeGb6IIbvOh9Dw>

Now I'm able to filter accurately my artifacts. I hope it will help other people.
Thanks

Comments
Naveen Tyagi commented Sep 03 '15, 1:44 a.m.

 Hi Jean,
how you managed to do that i need to implement same in my project.

I am able to retrieve all the requirement in a project by OSLC/Java but i need to retrieve them folder by folder. you can get my actual problem from the question i have posted yesterday. Thanking in Advance for any help.


Jean-Luc Johnson commented Sep 03 '15, 4:19 a.m. | edited Sep 03 '15, 4:20 a.m.

Hello Navenn,
For your information I was not using the lyo SDK and sample code at http://git.eclipse.org/c/lyo/org.eclipse.lyo.client.git/tree/org.eclipse.lyo.client.java.sample. Instead I used the workshop material at https://jazz.net/wiki/bin/view/Main/OSLCWorkshopDownload. I don't recommend any more. 
I looked at your previous post and I think that you were doing well.
At this stage you would need to add additional query parameters to match the ones I have mentioned in this post. In the end, your query should look like this:
&oslc.prefix=oslc=<http: open-services.net="" ns="" core%23="">,dcterms=<http: purl.org="" dc="" terms=""/>,nav=<http: com.ibm.rdm="" navigation%23="">&oslc.select=dcterms:title,dcterms:description,oslc:instanceShape&oslc.where=nav:parent=<https: grarrc.ibm.com:9443="" rm="" folders="" _RHCJYN5jEeGb6IIbvOh9Dw=""
Please read the article at https://jazz.net/library/article/1197 to find out more about how to get the list of existing folders in a project area.


Naveen Tyagi commented Sep 03 '15, 7:22 a.m.

Thanks Jean for quick response.
My question is how will i get the folders URI for first time, i didn't find any way to get the folders URI.

what it does you can fetch any requirement that contains parent folder URI with help of that parent(folder) URI you can get all the other requirements inside that folder.(i can get root Folder Uri but after firing that folder query i am not getting any requirement).

i want list of the folder and on the name/URI of the folder, i want to pull out all the requirement inside that folder.


permanent link
Naveen Tyagi (1978129) | answered Sep 15 '15, 9:04 a.m.
Hi Jean, I have been struggling quit a long time but still not able to solve this.i have pulled out all the folder with URI's in my projects.  could you please add the required parameters in the below code so that i can just the submit the query to get requirements from any folder: lets assume my folder uri i want to pull out requirements from is :   https://myserver.com/rm/folders/_uek58k6ZEeSd-tB745kpOQ . Thanking in advance.

OslcQueryParameters queryParams = new OslcQueryParameters();
                queryParams.setPrefix("rdf=<http://www.w3.org/1999/02/22-rdf-syntax-ns#>");
                queryParams.setWhere("nav=<http://com.ibm.rdm/navigation#>&oslc.where=nav:parent=<https://myserver.com/rm/folders/_uek58k6ZEeSd-tB745kpOQ>");
                OslcQuery query = new OslcQuery(client, queryCapability, 5, queryParams);
                OslcQueryResult result = query.submit();
                System.out.println("Result Size: "  +result.getMembersUrls().length);

Your answer


Register or to post your answer.