It's all about the answers!

Ask a question

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


Naveen Tyagi (19775152) | asked Sep 03 '15, 6:15 a.m.
edited Sep 12 '15, 12:03 a.m. by Geoffrey Clemm (30.1k33035)
  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 . 
  

Comments
Geoffrey Clemm commented Sep 12 '15, 12:02 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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

Accepted answer


permanent link
Donald Nong (14.5k614) | answered Sep 04 '15, 3:11 a.m.
edited Sep 07 '15, 8:40 p.m.
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

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

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



Naveen Tyagi commented Mar 07 '16, 2:47 a.m.

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.


Donald Nong commented Mar 07 '16, 7:50 p.m.

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.


Naveen Tyagi commented Mar 08 '16, 12:20 a.m.

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 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.