Customizing dmmCustomizeTopicTitlesAndIcons
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 7
- Joined: Sat Sep 28, 2019 1:38 pm
Customizing dmmCustomizeTopicTitlesAndIcons
Hi,
I want to customize DITA map manager view based on dmmCustomizeTopicTitlesAndIcon posted on https://github.com/oxygenxml/wsaccess-j ... le-plugins.
My requirements are following:
Thanks,
Edomonndo
I want to customize DITA map manager view based on dmmCustomizeTopicTitlesAndIcon posted on https://github.com/oxygenxml/wsaccess-j ... le-plugins.
My requirements are following:
- The displayed title text is computed without some specific element such as "title/data."
- If a chapter references submap, then do not render number prefix. The title of a child topicref in the submap is rendered as like the topicref referenced by chapter. (The submap should only have one topicref as child.)
- The conditional attributes specialized from @props and its value are also rendered without coding these attributes directly.
Thanks,
Edomonndo
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Customizing dmmCustomizeTopicTitlesAndIcons
Hi,
I will assume you are using as a staring point this Javascript-based plugin which calls our Java-based API to customize the rendering:
https://github.com/oxygenxml/wsaccess-j ... sAccess.js
Please see some suggestions below:
https://www.oxygenxml.com/InstData/Edit ... rNode.html
Once you gain access to the root element:
from that root element using the "getContentNodes()" method you can iterate its child nodes and find the <title> element:
https://www.oxygenxml.com/InstData/Edit ... tNode.html
In this structure of AuthorNode's the text is stored separtely in a large text buffer, like in the image here:
https://www.oxygenxml.com/InstData/Edit ... rNode.html
Unfortunately you only have access to the "getTextContent()" method for the title element which returns all the text from all sub elements. I will add an internal issue to add some more API for what you need.
https://www.oxygenxml.com/InstData/Edit ... mizer.html
the received "topicref" element has both "getParent()" and "getContentNodes()" methods allowing you to identify this particular case.
you can request the value of the "domains" attribute something like this:
https://www.oxygenxml.com/InstData/Edit ... ng.String-
You will need to parse that value and if the DITA specialization is properly done you will find in that value all definitions for extra profiling attributes contributed by the DITA specification:
https://www.oxygenxml.com/dita/1.3/spec ... te-domains
Regards,
Radu
I will assume you are using as a staring point this Javascript-based plugin which calls our Java-based API to customize the rendering:
https://github.com/oxygenxml/wsaccess-j ... sAccess.js
Please see some suggestions below:
On the "customizeComputedTopicrefTitle" callback function you receive the "defaultComputedTitle" (the title Oxygen computes by default) and the "targetTopicOrMap" variable which is the target document parsed as an AuthorNode tree:The displayed title text is computed without some specific element such as "title/data."
https://www.oxygenxml.com/InstData/Edit ... rNode.html
Once you gain access to the root element:
Code: Select all
rootElement = targetTopicOrMap.getRootElement();
https://www.oxygenxml.com/InstData/Edit ... tNode.html
In this structure of AuthorNode's the text is stored separtely in a large text buffer, like in the image here:
https://www.oxygenxml.com/InstData/Edit ... rNode.html
Unfortunately you only have access to the "getTextContent()" method for the title element which returns all the text from all sub elements. I will add an internal issue to add some more API for what you need.
On the same "DITAMapNodeRendererCustomizer.customizeComputedTopicrefTitle(AuthorNode, AuthorNode, String)" callback:If a chapter references submap, then do not render number prefix. The title of a child topicref in the submap is rendered as like the topicref referenced by chapter. (The submap should only have one topicref as child.)
https://www.oxygenxml.com/InstData/Edit ... mizer.html
the received "topicref" element has both "getParent()" and "getContentNodes()" methods allowing you to identify this particular case.
Again on the "customizeComputedTopicrefTitle" API callback once you gain access to the root element:The conditional attributes specialized from @props and its value are also rendered without coding these attributes directly.
Code: Select all
rootElement = targetTopicOrMap.getRootElement();
Code: Select all
rootElement.getAttribute("domains").getValue();
You will need to parse that value and if the DITA specialization is properly done you will find in that value all definitions for extra profiling attributes contributed by the DITA specification:
https://www.oxygenxml.com/dita/1.3/spec ... te-domains
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Customizing dmmCustomizeTopicTitlesAndIcons
Hi,
As an update about this:
ro.sync.ecss.extensions.api.node.AuthorNode.getContentIterator()
to allow iteration over a node's text contents.
Regards,
Radu
As an update about this:
in our recent release of Oxygen 22 we added this new API method:Unfortunately you only have access to the "getTextContent()" method for the title element which returns all the text from all sub elements. I will add an internal issue to add some more API for what you need
ro.sync.ecss.extensions.api.node.AuthorNode.getContentIterator()
to allow iteration over a node's text contents.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service