Use API to determine folder associated with a module in Doors Next
Hello,
https://jazz.net/library/article/1197
This works fine, but I noticed that a folder for storing the artifacts of the module gets created at the same time. For example, if I call my module "Test module" then a folder called "Test module artifacts" is created.
What I'd like to know is:
I did find the following question relating to #1:
https://jazz.net/forum/questions/264160/get-module-content-folder-using-api
Thanks for your help,
One answer
FYI It's possible to change the default behaviour of creating a content folder by going into the component Gear->Manage Component Properties->Module Options, and select Same folder as the module. Now when you create the module (presumably in a folder) the content folder will be below that folder.
Comments
Thanks Ian. While I can use the OSLC Query Capability to traverse the folder hierarchy, it just provides the title of each folder and a URL to query the subfolders. It doesn't provide any field showing associated modules that I can see. The only nodes under the folder are "dcterms:title" and "nav:subfolders". I tried including an "oslc.select=*" in case there were additional fields not included by default, but it had no effect.
Regarding the "Module Options", this is already set to "Same folder as the module" in my project. This determines the location of the created folder itself, it doesn't allow new modules to place their artifacts in an existing folder. Thanks.
I also tried performing a GET on the folder itself. This gives more fields but still nothing for the associated module. It has dcterms:title, dcterms:description, nav:parent (parent folder), oslc_config:component, nav:subfolders, and oslc:serviceProvider (i.e., the project services).
rdf:type=jazz_rm:Module) |
I'm not sure if there are other reasons why core artifacts created in a module are created in a dedicated folder, but it's convenient when e.g. you want to change team ownership of all the artifacts in a module because you don't have to pick and choose from a pile of artifacts you just change ownership on the folder and its contents.
Perhaps add to your question why you need to locate the content folder?
Thanks Ian. Regarding the two OSLC queries you propose, the "nav:folder" field you propose doesn't seem to exist (e.g., it isn't returned if I add it to the "select" query). "nav:parent" works fine (but isn't what I want).
2. Create the base artifacts via a POST.
3. Update the module structure via a PUT (which creates any new module bindings).