Module Richtext Contents - Text vs Modules schema method
If you want to publish the richtext contents of a module it seems like there are 2 methods:
1.
Create a template with only the Text schema.
In the template Publish the dataSource/artifact/content/text/richTextBody/div/value
In the DSX pass this template Text schema the text?moduleURI
https://server:port/rm/publish/text?moduleURI=module1
e.g. https://localhost:9443/rm/publish/text?moduleURI=_F8ptYCYOEeiWbapxO14vMQ
or
2.
(this is the method used in DNG Module.dta)
Create a template with both the Text schema and the Modules schema.
In the template iterate over the contents of the module schema
Then grab the <about> URI for each artifact and use dynamic data configuration to grab the URI content of each artifact in the module.
Then use the Text schema to extract the richtext for each artifact using its <about> URI
In the DSX pass this template module schema the modules?moduleURI
https://server:port/rm/publish/modules?moduleURI=module1
e.g. https://localhost:9443/rm/publish/modules?resourceURI=_F8ptYCYOEeiWbapxO14vMQ
The second method seems more complicated but it is the method used in the shipped example DNG Module.dta
Why are there 2 very different methods to achieve the same result and why is the more complex method the one that is demonstrated in youtube examples and shipped with the sample template?
Accepted answer
Hi Sean,
Artifacts in DNG could be of many types like module, text, diagram, etc.
General REST URL patterns
module: /rm/publish/modules?resourceURI=UUID
text: /rm/publish/text?resourceURI=UUID
resource: /rm/publish/resource?resourceURI=UUID
A module contains number of requirements of different kinds of artifacts, like text, diagram, etc. The REST URL XML of module doesn't expose details requirements for individual requirements. Hence, you'll have to use text schema to get dataSource/artifact/content/text/richTextBody/div/value.
Simplified REST URL would be to use OSLC URL + pox header.
OSLC URL: https://rmserver:9443/rm/resources/_a1771643c32e400e84ad90f0994ec71a
More details under https://rpeactual.com/2016/07/03/oslc-api-and-pox-profile-simplifies-clm-traceability/
Thanks,
Kumar
Thanks,
Kumar
6 other answers
^thanks Kumar
^thanks Prasad
When you say
>>However if you also want include module details / bindings / hierarchy...
So what does this translate to in terms of results? - like what is an example of something you can do using the 'modules' schema that you cannot do by simply using the 'text' schema and passing it a module parameter via the DSX?
Just curious since the 'modules' schema is the example used in youtube tutorials etc. but it seems more complex to configure and I cannot see what the advantages are.
Good points.
As we mentioned before, module schema and REST xml data does not provide individual requirement (xhtml table, rich text, etc) details. For example, if there is a text req in a module, with module schema you only get title, identifier and basic details. To get detailed requirement text, you need to use text schema with query dataSource/artifact/content/text/richTextBody/div/value
Thanks Kumar.
I now understand that using the Module schema gives
1. Module Title
2. Module heading hierarchy structure
Is there any other benefit that you get from using Module schema as well as Text schema, instead of just Text schema, for printing out the richtext contents of a module in sequential order?
Comments
Subramanya Prasad Pilar
Apr 13 '18, 1:27 p.m.You are right Sean. To print rich text content, you can use only text schema and set the data source URI as https://server:port/rm/publish/text?moduleURI=module1
However if you also want include module details / bindings / hierarchy, you can start with modules schema. The sample template DNG Module.dta mainly showcases how to configure the data sources for different artifact formats within the module.