Customizing insert element
Oxygen general issues.
-
- Posts: 10
- Joined: Wed Jun 06, 2018 4:59 pm
Customizing insert element
Hi,
I'm new to Oxygen XML web Author and we are evaluating for our application.
I've been using the forum and documentation to achieve part of the goal. 1. The first step is inserting element - in this the user should be proivded a text box to enter text and the element is inserted along with this text.2 After successful insertion edit/delete/save should be possible.
The first step is achieved by providing a toolbar icon with action that triggers a dialog and the event of this dialog is captured to insert into editor. Since I couldn't find any documentation, the DOM is manipulated using JavaScript to insert the new element. The problem is in Edit/Delete/Save. The newly inserted element is not saved in the XML and delete/edit throws error message due to a server call. On closer look it looks like for every change to the XML a REST call is made to the backend service.
What I would like to know is - what is the right procedure to follow in this, either a REST call should be invoked after DOM manipulation or a better way to insert XML is there that will take care of syncing backend and frontend or if customization is not possible at all.
I'm new to Oxygen XML web Author and we are evaluating for our application.
I've been using the forum and documentation to achieve part of the goal. 1. The first step is inserting element - in this the user should be proivded a text box to enter text and the element is inserted along with this text.2 After successful insertion edit/delete/save should be possible.
The first step is achieved by providing a toolbar icon with action that triggers a dialog and the event of this dialog is captured to insert into editor. Since I couldn't find any documentation, the DOM is manipulated using JavaScript to insert the new element. The problem is in Edit/Delete/Save. The newly inserted element is not saved in the XML and delete/edit throws error message due to a server call. On closer look it looks like for every change to the XML a REST call is made to the backend service.
What I would like to know is - what is the right procedure to follow in this, either a REST call should be invoked after DOM manipulation or a better way to insert XML is there that will take care of syncing backend and frontend or if customization is not possible at all.
-
- Posts: 517
- Joined: Thu Sep 04, 2014 4:22 pm
Re: Customizing insert element
Post by cristi_talau »
Hello,
If you want to change the XML document form JS code, you should invoke an AuthorOperation like in the code below:
We also have a tutorial with more details: https://www.oxygenxml.com/maven/com/oxy ... ction.html .
Best,
Cristian
If you want to change the XML document form JS code, you should invoke an AuthorOperation like in the code below:
Code: Select all
this.editor.getActionsManager().invokeOperation(
'ro.sync.ecss.extensions.commons.operations.InsertFragmentOperation', {
fragment: '<xref href="' + text + '"/>'
}, callback);
Best,
Cristian
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