How can I list the requirements within a folder in 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
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
<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
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>
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
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
Hi Jean,
how you managed to do that i need to implement same in my project.
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.
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.
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);