Adding shortcut keys
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 32
- Joined: Wed Nov 28, 2018 8:13 pm
Adding shortcut keys
Post by akheiljain »
I would like to configure/customize a keyboard shortcut & Tool bar menu to perform the following action.
unwrap element <email> everywhere in the current document.
How would I go about implementing this functionality.
Background: I am looking into changing authoring tools from XMetal to Oxygen and trying to figure out how to port my MACRO's from XMetal to Oxygen.
unwrap element <email> everywhere in the current document.
How would I go about implementing this functionality.
Background: I am looking into changing authoring tools from XMetal to Oxygen and trying to figure out how to port my MACRO's from XMetal to Oxygen.
-
- Posts: 9470
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Adding shortcut keys
Hi,
I will assume you also want to share this custom action with others.
Usually you would first need the extend the DITA framework configuration and save that extension to a separate folder:
http://blog.oxygenxml.com/2015/08/docum ... aring.html
The DITA framework extension has an "Author" tab with an "Actions" tab in which you can define new actions, actions which can be added to the DITA main menu, contextual menu or toolbar:
https://www.oxygenxml.com/doc/versions/ ... olbar.html
An action can call various operations in various XPath activation contexts, we do have an "UnwrapTagsOperation" operation:
https://www.oxygenxml.com/doc/versions/ ... tions.html
but it unwraps the tag only for the first element selected by the XPath expression so it would not be that good for your needs.
You can define your custom "AuthorOperation" Java implementation which would use our API to make changes to the document:
https://www.oxygenxml.com/InstData/Edit ... oller.html
or you could use the existing "JSOperation" and pass to it some Javascript code which uses our Java API to make changes to the document, this would look something like this:
https://github.com/oxygenxml/javascript ... keyrefs.js
I do not have a sample doing exactly what you want but if you want I can try to come up with the code for it next week and update this forum thread.
Regards,
Radu
I will assume you also want to share this custom action with others.
Usually you would first need the extend the DITA framework configuration and save that extension to a separate folder:
http://blog.oxygenxml.com/2015/08/docum ... aring.html
The DITA framework extension has an "Author" tab with an "Actions" tab in which you can define new actions, actions which can be added to the DITA main menu, contextual menu or toolbar:
https://www.oxygenxml.com/doc/versions/ ... olbar.html
An action can call various operations in various XPath activation contexts, we do have an "UnwrapTagsOperation" operation:
https://www.oxygenxml.com/doc/versions/ ... tions.html
but it unwraps the tag only for the first element selected by the XPath expression so it would not be that good for your needs.
You can define your custom "AuthorOperation" Java implementation which would use our API to make changes to the document:
https://www.oxygenxml.com/InstData/Edit ... oller.html
or you could use the existing "JSOperation" and pass to it some Javascript code which uses our Java API to make changes to the document, this would look something like this:
https://github.com/oxygenxml/javascript ... keyrefs.js
I do not have a sample doing exactly what you want but if you want I can try to come up with the code for it next week and update this forum thread.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Site Admin
- Posts: 125
- Joined: Wed Dec 12, 2018 5:33 pm
Re: Adding shortcut keys
Post by Cosmin Duna »
Hi,
We created a 'JSOperation' for unwrap the 'email' element:
https://github.com/oxygenxml/javascript ... lements.js
For change the unwrapped element, you can edit the 'elementToUnwrap' variable.
Regards,
Cosmin
We created a 'JSOperation' for unwrap the 'email' element:
https://github.com/oxygenxml/javascript ... lements.js
For change the unwrapped element, you can edit the 'elementToUnwrap' variable.
Regards,
Cosmin
Cosmin Duna
<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)
- ↳ 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