Get desired Module and add artifacts in it using OSCL + JAVA
I am new at OSLC + JAVA framework. Currently I am trying to add some artifacts in particular module.
So I need to fetch that module and add new artifact in it.
As a part of POC currently I am able to add base artifact in some folder by setting that folder path as parent.
Is there any resource available to add artifact in particular module ?
It will be really helpful if we get some sample code.
One answer
Hi
I can't help you with the Java, but in outline to add an artifact to a module you first create the core artifact if it doesn't already exist, then using the module API to GET the existing structure and add a reference to the artifact into the structure and update the structure using PUT.
The module API is documented here: https://jazz.net/wiki/bin/view/Main/DNGModuleAPI and on pages linked from there.
AFAICT the module structure API is a bit pernickety about headers on the GET/PUT and how configuration is provided:
- Don't construct the structure URL, get it from the module definition by doing a GET on the module URL using the following settings:
- Provide header (capitalised exactly like this)
- DoorsRP-Request-Type: public 2.0
- Do NOT provide header OSLC-Core-Version
- Provide the configuration using header vvc.configuration and NOT using header Configuration-Context or query ?oslc_config.context - so it must be a local configuration URL not a global configuration
A little more detail is in my answer here https://jazz.net/forum/questions/278116/get-module-structure-uri-via-rest-api/278122
HTH
Ian