Change behavior of "DITA/ReuseKeys" action
Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
-
- Posts: 25
- Joined: Mon Dec 11, 2023 3:10 pm
Change behavior of "DITA/ReuseKeys" action
Hi,
I'm trying to add an index-see-also element with a keyref attribute in a glossentry topic using the "DITA/ReuseKeys" action.
The keyref attribute is correctly inserted but, it's inserted as an inline bold element with a xref child.
Example from your "try it" Webauthor version https://www.oxygenxml.com/oxygen-xml-we ... n%22%7D%5D
I would like to change the inserted element as "index-see" or "index-see-also". Is there a way to customize the default behavior/action ?
Thanks
I'm trying to add an index-see-also element with a keyref attribute in a glossentry topic using the "DITA/ReuseKeys" action.
The keyref attribute is correctly inserted but, it's inserted as an inline bold element with a xref child.
Example from your "try it" Webauthor version https://www.oxygenxml.com/oxygen-xml-we ... n%22%7D%5D
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE glossentry PUBLIC "-//OASIS//DTD DITA Glossary//EN" "glossary.dtd">
<glossentry id="flowers.genus">
<glossterm>Genus</glossterm>
<glossdef>A low-level taxonomic rank used in the classification of living and fossil organisms.
Other well-known taxonomic ranks are domain, kingdom, phylum, class, order, family, and
species, with <term>genus</term> fitting between family and species. The scientific name of
a genus may be called the generic name: it is always capitalized.</glossdef>
<prolog>
<metadata>
<keywords>
<indexterm>test <b><xref keyref="perennial"/></b></indexterm>
</keywords>
</metadata>
</prolog>
</glossentry>
Code: Select all
<keywords>
<indexterm>test <index-see-also keyref="perennial"/></indexterm>
</keywords>
-
- Posts: 519
- Joined: Wed May 20, 2009 2:40 pm
Re: Change behavior of "DITA/ReuseKeys" action
Hello,
The only way to change the element that is inserted when a DITA key is selected is by creating a plugin that uses an AuthorDocumentFilter[1] to update the fragment before it is inserted in the document.
See the javadoc of the filter class about implementation details and also check the AuthorDocumentController [2] API class if you need methods to create or serialize an AuthorDocumentFragment [3].
We have a sample plugin that uses an AuthorDocumentFilter, maybe you can use it as a starting point:
https://github.com/oxygenxml/web-author ... g-comments
Please let us know if you need further assistance.
[1] https://www.oxygenxml.com/InstData/Edit ... ilter.html
[2] https://www.oxygenxml.com/InstData/Edit ... tFragment)
[3] https://www.oxygenxml.com/InstData/Edit ... gment.html
Best Regards,
Mihaela
The only way to change the element that is inserted when a DITA key is selected is by creating a plugin that uses an AuthorDocumentFilter[1] to update the fragment before it is inserted in the document.
See the javadoc of the filter class about implementation details and also check the AuthorDocumentController [2] API class if you need methods to create or serialize an AuthorDocumentFragment [3].
We have a sample plugin that uses an AuthorDocumentFilter, maybe you can use it as a starting point:
https://github.com/oxygenxml/web-author ... g-comments
Please let us know if you need further assistance.
[1] https://www.oxygenxml.com/InstData/Edit ... ilter.html
[2] https://www.oxygenxml.com/InstData/Edit ... tFragment)
[3] https://www.oxygenxml.com/InstData/Edit ... gment.html
Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
http://www.oxygenxml.com
-
- Posts: 519
- Joined: Wed May 20, 2009 2:40 pm
Re: Change behavior of "DITA/ReuseKeys" action
Hello,
A possibility, if you use a custom framework that extends DITA, is to create [1] and register [2] another action with the same id ("DITA/ReuseKeys").
Your custom action should delegate to the original on all the existing methods [3].
On actionPerformed, after delegating to original action you could invoke an operation [5] [6] that renames the inserted element from xref to your element in the callback method (make sure that you cal the callback received as parameter when the rename operation ends).
Please let us know if you need more details about this approach.
[1] https://www.oxygenxml.com/maven/com/oxy ... ction.html
[2] https://www.oxygenxml.com/maven/com/oxy ... on__anchor
[3] https://www.oxygenxml.com/maven/com/oxy ... ction.html
[4] https://www.oxygenxml.com/maven/com/oxy ... ed__anchor
[5] https://www.oxygenxml.com/maven/com/oxy ... on__anchor
[6] https://www.oxygenxml.com/InstData/Edit ... mmary.html
Best Regards,
Mihaela
A possibility, if you use a custom framework that extends DITA, is to create [1] and register [2] another action with the same id ("DITA/ReuseKeys").
Your custom action should delegate to the original on all the existing methods [3].
On actionPerformed, after delegating to original action you could invoke an operation [5] [6] that renames the inserted element from xref to your element in the callback method (make sure that you cal the callback received as parameter when the rename operation ends).
Please let us know if you need more details about this approach.
[1] https://www.oxygenxml.com/maven/com/oxy ... ction.html
[2] https://www.oxygenxml.com/maven/com/oxy ... on__anchor
[3] https://www.oxygenxml.com/maven/com/oxy ... ction.html
[4] https://www.oxygenxml.com/maven/com/oxy ... ed__anchor
[5] https://www.oxygenxml.com/maven/com/oxy ... on__anchor
[6] https://www.oxygenxml.com/InstData/Edit ... mmary.html
Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
http://www.oxygenxml.com
-
- Posts: 25
- Joined: Mon Dec 11, 2023 3:10 pm
Re: Change behavior of "DITA/ReuseKeys" action
Hello Mihaela,
We are using a custom framework so we will try your suggestion, thanks!
I will let you know if I need some help or precision to implement this.
Regards,
arthur
We are using a custom framework so we will try your suggestion, thanks!
I will let you know if I need some help or precision to implement this.
Regards,
arthur
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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