Document Controller:: insertHtml
Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
-
- Posts: 67
- Joined: Thu Oct 29, 2020 12:01 am
Document Controller:: insertHtml
Post by manojdcoder »
I noticed internally Oxygen uses a method named `insertHtml` that accepts HTML and converts it appropriate language element before insert it into document.
For example running the code below in a DITA document automatically inserts <image href="..."/> where as on a DocBook it inserts imageobject which seems very convenient.
Is there a documentation that reveals the HTML equivalent for every language element?
For example running the code below in a DITA document automatically inserts <image href="..."/> where as on a DocBook it inserts imageobject which seems very convenient.
Code: Select all
workspace.currentEditor.getController().insertHtml(`<img src="path" />`)
-
- Posts: 517
- Joined: Thu Sep 04, 2014 4:22 pm
Re: Document Controller:: insertHtml
Post by cristi_talau »
Hello,
First of all, the methods that you discovered are not API. To implement the same behavior using API you should create your own AuthorOperationWithResult [1] and that calls:
Then invoke this operation from JavaScript code using sync.api.ActionsManager#invokeOperation [2].
Regarding the correspondence between HTML elements and framework elements, this mapping uses the same code as the Smart Paste feature and is configurable using an XSLT stylesheet found in the framework [3].
[1] https://www.oxygenxml.com/InstData/Edit ... esult.html
[2] https://www.oxygenxml.com/maven/com/oxy ... eOperation
[3] https://www.oxygenxml.com/doc/versions/ ... paste.html
First of all, the methods that you discovered are not API. To implement the same behavior using API you should create your own AuthorOperationWithResult [1] and that calls:
Code: Select all
authorDocumentModel.getActionsSupport().handleHtmlPaste(htmlString);
Regarding the correspondence between HTML elements and framework elements, this mapping uses the same code as the Smart Paste feature and is configurable using an XSLT stylesheet found in the framework [3].
[1] https://www.oxygenxml.com/InstData/Edit ... esult.html
[2] https://www.oxygenxml.com/maven/com/oxy ... eOperation
[3] https://www.oxygenxml.com/doc/versions/ ... paste.html
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