It's all about the answers!

Ask a question

Module Richtext Contents - Text vs Modules schema method

Sean F (1.3k243149) | asked Apr 13 '18, 12:36 p.m.
edited Apr 13 '18, 12:43 p.m.

If you want to publish the richtext contents of a module it seems like there are 2 methods:

  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
  e.g.  https://localhost:9443/rm/publish/text?moduleURI=_F8ptYCYOEeiWbapxO14vMQ


  (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
  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?

Subramanya Prasad Pilar commented 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.

Accepted answer

permanent link
Kumaraswamy Gowda (39115) | answered Apr 13 '18, 12:55 p.m.

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

pox profile

More details under



Sean F selected this answer as the correct answer

6 other answers

permanent link
Kumaraswamy Gowda (39115) | answered Apr 15 '18, 9:45 p.m.

Not anything that I could think of.

permanent link
Sean F (1.3k243149) | answered Apr 15 '18, 1:34 a.m.

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?

Kumaraswamy Gowda commented Apr 15 '18, 9:46 p.m.

Not anything that I could think of.

Sean F commented Apr 16 '18, 3:10 a.m.

Thanks Kumar

permanent link
Kumaraswamy Gowda (39115) | answered Apr 14 '18, 11:11 p.m.

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

permanent link
Sean F (1.3k243149) | answered Apr 14 '18, 3:18 p.m.

OK I found another advantage of using the Module schema.
If you use the Module schema then you can use a numbered stylesheet and get numbered headings.
If you just iterate through the artifacts using the Text schema then all headings come out as level 1.

permanent link
Sean F (1.3k243149) | answered Apr 14 '18, 1:33 p.m.

The only advantage I have been able to see so far of starting with the Module schema is that you can grab the name of the module itself before changing schema to process the module contents artifacts.
Is there any other advantage?

permanent link
Sean F (1.3k243149) | answered Apr 13 '18, 2:05 p.m.

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

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.