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