Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

DNG 6.0 : How to get List of the Folders in a project using OSLC

  I am using Java, Eclipse  Lyo and OSLC.  i am able to pull out all the requirements from DNG but i want  requirement should be fetched folder by folder, not all once.

1. I need to pass list of the folder in DNG project to  a Custom tool where user will select the folder name from drop down list in GUI. 
2. Selected folder  name will be passed to me as an Input from custom tool. 
3. I have to again pull out all the requirement from that folder and send requirement  list to the custom tool.

I am not able to get any hint to sort out this issue. I gone through this article ( https://jazz.net/library/article/1197 ) didn't find any way to pull out list of the folder inside a DNG project . 
  

0 votes

Comments

Please tag your questions appropriately.   This is clearly a question about DNG ... not about RTC or jazz foundation.


Accepted answer

Permanent link
You first need to find the root folder with these two conditions.
1. dcterms:title is "root".
2. oslc:serviceProvider contains the project area's service document services.xml
(edited to add, it turns out the the base folder query already contains the root folder, as "public_rm:parent", so there is no need to "find" it).

Once you get the root folder, do a GET against the root folder, and check <nav:subfolders>. Follow the link to get all the folders under the root folder. For each folder, follow the link in <nav:subfolders> to get its subfolders.
Naveen Tyagi selected this answer as the correct answer

1 vote

Comments

Where have you been all my Life!!! Thanks for exact Answer!!!


Hi Donald,
back to the same question again since facing issue now.
I have implemented the approach and it is working fine. I am getting RDFXml response for root folder and then one by one i am checking  if it contains sub-folder and that how i am added all the folders in a list. But since i have to make get call for each folder it is taking very much time if project contains more folder. can you suggest any other Non-Resursive way to get all the folders. I don't need any relationship order means this folder is parent/child of this folder and so on. All i want all the folder once. Thanks in advance.

I don't have a better approach if you have to get all the folders at once. What I would suggest is to simulate the behavior of RDNG itself - only shows one level of folders at a time, and if you "expand" a folder, the child folders are shown, while "selecting" a folder shows the containing requirement artifacts.

No, I need all of them without worrying about any order. I am thinking to implement muti-threading, Instead of traversing through all the structure by one thread i will create multiple threads[5-10]. Lets see how it works.

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,954

Question asked: Sep 03 '15, 6:15 a.m.

Question was seen: 3,312 times

Last updated: Mar 08 '16, 12:20 a.m.

Confirmation Cancel Confirm