It's all about the answers!

Ask a question

pulling artifact data via DNG REST API


0
1
Arthur Kleer (302) | asked Jan 13, 6:16 p.m.
edited Jan 14, 11:20 a.m.

I am trying to pull artifact data (this includes general and custom attributes) via the REST API on (Jazz 6.0.6).

We faced the following situation:

When using "server/publish/resources?resourceURI" I get module information as one ds:artifact. it has a ds:moduleContext tag and 20 rrm:contextBinding tags. The 20 artifacts matches what I see in DNG Web UI.

I can get attribute data when using either "resources?moduleURI" or "text?moduleURI". However when doing so, I only get 15 ds:artifact items. Some artifacts are missing. They have different Artifact Type, the Artifact Format is always "Text".

Is that expected behavior or what would be the right approach to get the artifact data?
Do I need to get the individual links from the contextBinding tags of the resources?resourceURI request and use these to get the data, or is there a correct way to request all at once.

--

OK. it seems these artifacts have links in the context of a GC, but the data is pulled in local context. That might cause the problem. Is that behaviour on purpose? even if the links cannot be resolved/used, the artifact data is valid.


I also realized that requesting artifact data for these items from an URI based on rmm:core works fine, while using 
the URI in rrm:about of rrm:contextBinding returns a XML with 0 entries. What is the difference between the two?

--

Using modules?moduleURI has the following output. it has 20 <rrm:contextBinding> tags inside <ds:moduleContext>. This matches what I see in the DNG Web UI. All of them have the format "Text".

<?xml version="1.0" encoding="UTF-8"?>
               xmlns:rrm="http://www.ibm.com/xmlns/rrm/1.0/"
               xmlns:attribute="http://jazz.net/xmlns/alm/rm/attribute/v0.1"
               xmlns:h="http://www.w3.org/1999/xhtml"
               xmlns:history="http://jazz.net/xmlns/alm/rm/history/v0.1"
               xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
               appId="RRC"
               rrm:totalCount="1"
               vMajor="60"
               vMinor="06">
<ds:artifact attribute:itemId="_Jtauoe6sEemYOfWArySh2g">
<rrm:title attribute:itemId="_2c3asaxiEemFIJ8WymdLqQ">Display</rrm:title>
<rrm:description attribute:itemId="_2b5xYaxiEemFIJ8WymdLqQ"/>
<rrm:identifier attribute:itemId="_2cLeMaxiEemFIJ8WymdLqQ">219619</rrm:identifier>
<rrm:about>server/resources/_Jtauoe6sEemYOfWArySh2g</rrm:about>
<rrm:format attribute:itemId="_2a-kUqxiEemFIJ8WymdLqQ">Module</rrm:format>
<rrm:core/>
<rrm:collaboration>
<rrm:creator attribute:itemId="_2brH4axiEemFIJ8WymdLqQ">
...
</rrm:creator>
<rrm:created attribute:itemId="_2bdFcaxiEemFIJ8WymdLqQ">2019-10-14T17:57:56.505+0000</rrm:created>
<rrm:modified attribute:itemId="_2cZgoaxiEemFIJ8WymdLqQ">2021-03-03T00:38:40.008+0000</rrm:modified>
<rrm:attributes>
...
</attribute:objectType>
</rrm:attributes>
<rrm:comments>
<rrm:href>server/publish/comments?resourceURI=server/resources/_Jtauoe6sEemYOfWArySh2g</rrm:href>
</rrm:comments>
<rrm:revisions>
<rrm:href>server/publish/revisions?resourceURI=server/resources/_Jtauoe6sEemYOfWArySh2g</rrm:href>
<rrm:about>server/resources/_Jtauoe6sEemYOfWArySh2g?revision=_rcXeEGRMEeugY7sye1HTrA</rrm:about>
</rrm:revisions>
</rrm:collaboration>
<ds:location>
<ds:project>
<rrm:title>Planning</rrm:title>
<rrm:description>Type System [1.4] Type system variant</rrm:description>
<rrm:about>server/resource/itemOid/com.ibm.team.process.ProjectArea/_1t0jYKxiEemFIJ8WymdLqQ</rrm:about>
<rrm:alternative>server/process/project-areas/_1t0jYKxiEemFIJ8WymdLqQ</rrm:alternative>
</ds:project>
<ds:component>
<rrm:title>Some title</rrm:title>
<rrm:description>Type System [1.4] Type system variant</rrm:description>
<rrm:about>server/cm/component/_12ewIKxiEemFIJ8WymdLqQ</rrm:about>
</ds:component>
<ds:parentFolder>
<rrm:title>root</rrm:title>
<rrm:description>root</rrm:description>
<rrm:about>server/folders/_2Shy8axiEemFIJ8WymdLqQ</rrm:about>
</ds:parentFolder>
</ds:location>
<ds:content/>
<ds:aggregatedContent/>
<ds:moduleContext>
<rrm:contextBinding>
<rrm:about>server/resources/MB_682e762bdc564504b1c1621015efb411</rrm:about>
<rrm:identifier>241220</rrm:identifier>
<rrm:title>Features &amp; Functionality</rrm:title>
<rrm:format>Text</rrm:format>
<rrm:core>CA_48abf83437fe4f6089885c724c6b0a2e</rrm:core>
<rrm:moduleUrl>server/resources/_Jtauoe6sEemYOfWArySh2g</rrm:moduleUrl>
<rrm:parentBindingUrl/>
<rrm:section>1</rrm:section>
<rrm:bookOrder>1</rrm:bookOrder>
<rrm:depth>1</rrm:depth>
<rrm:isHeading>true</rrm:isHeading>
</rrm:contextBinding>
<rrm:contextBinding>
<rrm:format>Text</rrm:format>
...
</rrm:contextBinding>
<rrm:contextBinding>
<rrm:format>Text</rrm:format>
...
</rrm:contextBinding>
<rrm:contextBinding>
<rrm:format>Text</rrm:format>
...
</rrm:contextBinding>
<rrm:contextBinding>
<rrm:format>Text</rrm:format>
...
</rrm:contextBinding>
<rrm:contextBinding>
<rrm:format>Text</rrm:format>
...
</rrm:contextBinding>
<rrm:contextBinding>
<rrm:format>Text</rrm:format>
...
</rrm:contextBinding>
<rrm:contextBinding>
<rrm:format>Text</rrm:format>
...
</rrm:contextBinding>
<rrm:contextBinding>
<rrm:format>Text</rrm:format>
...
</rrm:contextBinding>
<rrm:contextBinding>
<rrm:format>Text</rrm:format>
...
</rrm:contextBinding>
<rrm:contextBinding>
<rrm:format>Text</rrm:format>
...
</rrm:contextBinding>
<rrm:contextBinding>
<rrm:format>Text</rrm:format>
...
</rrm:contextBinding>
<rrm:contextBinding>
<rrm:format>Text</rrm:format>
...
</rrm:contextBinding>
<rrm:contextBinding>
<rrm:format>Text</rrm:format>
...
</rrm:contextBinding>
<rrm:contextBinding>
<rrm:format>Text</rrm:format>
...
</rrm:contextBinding>
<rrm:contextBinding>
<rrm:format>Text</rrm:format>
...
</rrm:contextBinding>
<rrm:contextBinding>
<rrm:format>Text</rrm:format>
...
</rrm:contextBinding>
<rrm:contextBinding>
<rrm:format>Text</rrm:format>
...
</rrm:contextBinding>
<rrm:contextBinding>
<rrm:format>Text</rrm:format>
...
</rrm:contextBinding>
<rrm:contextBinding>
<rrm:format>Text</rrm:format>
...
</rrm:contextBinding>
</ds:moduleContext>
</ds:artifact>
</ds:dataSource>

When using text?moduleURI=, DNG returns a XML starting as following:
rrm:totalCount is 15 and the XML data contains 15 ds:artifact below ds:dataSource

<?xml version="1.0" encoding="UTF-8"?>
               xmlns:rrm="http://www.ibm.com/xmlns/rrm/1.0/"
               xmlns:attribute="http://jazz.net/xmlns/alm/rm/attribute/v0.1"
               xmlns:h="http://www.w3.org/1999/xhtml"
               xmlns:history="http://jazz.net/xmlns/alm/rm/history/v0.1"
               xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
               xmlns:text="http://jazz.net/xmlns/alm/rm/text/v0.1"
               appId="RRC"
               rrm:totalCount="15"
               vMajor="60">


Comments
Ian Barnard commented Jan 14, 10:02 a.m. | edited Jan 14, 10:03 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Using /rm/publish/text will only return information about artifacts which are Text format - I guess the others are images or diagrams or other uploaded content like PDF etc.. (these are generically called Wrapped Resources) /rm/publish/resources should return information for all artifacts - if you're interested in contents of a module then use /rm/publish/resources?moduleUri=...&oslc_config.context=... 


Ian Barnard commented Jan 14, 2:10 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 Results from the Reportable REST API can be paged if the server decides it wants to - are you getting all the pages?


Arthur Kleer commented Jan 17, 6:10 p.m.

There is no indications, that multiple pages are used for these 20 items. And the server usually returns a couple of hundred without paging.

Additional it only skips the items with links (Satisfies). So I have the feeling there is connection to that.

Just also did a test, using a GC context instead of the (local) DNG baseline and it correctly returned the 20 artifacts. However as we need to compare baselines, that is no viable solution, as it would require creating dummy GCs for every DNG baseline.

Accepted answer


permanent link
Arthur Kleer (302) | answered May 31, 4:21 a.m.
This issue was no longer observed after an upgrade to DNG 7.0.2

Ralph Schoon selected this answer as the correct answer

One other answer



permanent link
David Honey (1.1k7) | answered Jan 14, 5:55 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

If you are in a DOORS Next project area that has opted-in for configuration management, then the GET requests for requirements should include either a oslc.config_context query parameter or a Configuration-Context header whose value is set to the URI of a configuration context, such as a global configuration. See https://docs.oasis-open-projects.org/oslc-op/config/v1.0/psd01/oslc-config-mgt.html, especially section 4 of https://docs.oasis-open-projects.org/oslc-op/config/v1.0/psd01/config-resources.html.


Comments
Arthur Kleer commented Jan 14, 6:03 a.m.

I am using already the oslc.config_context,


https://<server>/publish/text?moduleURI=<Module UID>&oslc_config.context=https%3A%2F%2F<server>%2Fcm%2Fbaseline%2F<Config UID>

So I use local configurations (baselines and streams, in other cases changesets) as context instead of the global one.

I guess it comes down to the question, why is the DNG API skipping the items with (global) links when pulling local component data.

Your answer


Register or to post your answer.