It's all about the answers!

Ask a question

How to know if name (aka title) attribute value is synchronized with primary text attribute value


Benjamin Röhl (1671324) | asked Nov 23 '17, 12:03 p.m.

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


permanent link
Bas Bekker (1.4k4) | answered Nov 23 '17, 12:27 p.m.
JAZZ DEVELOPER
edited Nov 23 '17, 12:28 p.m.

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.

Benjamin Röhl selected this answer as the correct answer

Comments
Benjamin Röhl commented Nov 24 '17, 4:57 a.m.

Thanks for your quick reply.
Could you please also say since which DNG version this property is available?


Bas Bekker commented Nov 24 '17, 6:37 p.m.
JAZZ DEVELOPER

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.


Benjamin Röhl commented Dec 05 '17, 3:33 a.m.

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 ?


Benjamin Röhl commented Jan 09 '18, 9:55 a.m.

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


Christian Opitz commented Apr 09 '18, 8:51 a.m. | edited Apr 09 '18, 8:54 a.m.

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!


Christian Opitz commented May 24 '18, 5:06 a.m.

It is working with 6.0.5iFix004

showing 5 of 6 show 1 more comments

2 other answers



permanent link
Dominic Tulley (38114) | answered Dec 13 '17, 11:17 a.m.

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

If you really cared, there is a pattern for having the javascript API call out to an external service that can  make OSLC requests back to the RM server to discover the information you need.


permanent link
Benjamin Röhl (1671324) | answered Nov 24 '17, 5:00 a.m.

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
Bas Bekker commented Nov 24 '17, 6:30 p.m.
JAZZ DEVELOPER

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


Christian Opitz commented Apr 09 '18, 8:51 a.m.

I was not able to use the RM.Data.getAttributes method. Has this been proven to work? Using DNG 6.0.4

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.