How to know if name (aka title) attribute value is synchronized with primary text attribute value
Hello,
The situation:
We have developed a custom widget, which uses the DNG Javascript API, and a custom application, which uses the Lyo/OSLC API. to retrieve and manipulate requirement's attributes. In both cases we read and manipulate requirement attribute values.
In DNG the primary text and name attribute value are synchronized, if name attribute was not modified by the user. So, if name was modified, these both attribute are un-synchronized and may differ over time.
(see explanation by @matt99)
The problem:
When using one of the APIs, the name/title value is returned, even if it is only synchronized with the primary text attribute value.
The expectations:
The name/title attribute value is not returned (or at least empty), since it is not defined by the user explicitly by the user.
Alternatively, there is some indication if the name/title value is derived from the primary text value.
Does maybe a solution already exist, which would match with our above described expections?
Thank you & Kind regards,
Benjamin
Accepted answer
In the OSLC API you can look for this artifact attribute in the RDF resource:
xmlns:rm="http://www.ibm.com/xmlns/rdm/rdf/"
<rm:hasServerGeneratedTitle rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">false</rm:hasServerGeneratedTitle>
false indicates that the artifact has it's own name/title,
true indicates that the artifact name/title is derived from the primary text content.
Comments
Thanks for your quick reply.
Could you please also say since which DNG version this property is available?
Couldn't find the exact version when this feature (and property) was introduced, but I see it already present in DNG 4.0.7, so it started in one of the 4.0.x versions.
I tried to find the property "hasServerGenerated" in the RDF representation of a requirement resource, but without success.
Could you please guide me how to query the resource, so the property is included @bbekker ?
It can be retrieved by not using OSLC API, instead using the private API.
Thus, you have to put "DoorsRP-Request-Type: private" as request header, instead of "OSLC-Core-Version: 2.0".
Which version are you using? We are using DNG 6.0.4 and I was not able to get this data by using GET on e.g. https://<server>/rm/resources/MB_07c68fb661f54a7aa1ef7bd72461b3f3 with "Accept: application/rdf+xml" and "DoorsRP-Request-Type: private" headers
Thank you!
It is working with 6.0.5iFix004
2 other answers
The javascript API does not expose the information you need unfortunately (it gives you the Title as an attribute value without any indication of whether it is dynamically generated from the primary text or explicitly set in the artifact).
https://jazz.net/wiki/bin/view/Main/RMExtensionsUsingExternalWebService605
Thanks to @bbekker for OSLC API hint.
But, is there also something for the Javascript API?
If not, I would create a change request for this.
Comments
I'm not really familiar with the RM Javascript extensions, but would think that with the RM.Data.getAttributes method you can access that property.
If it's not, you can put in a request for enhancement, which you can do here: IBM Software RFE Community
I was not able to use the RM.Data.getAttributes method. Has this been proven to work? Using DNG 6.0.4