Webapp customisation
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 32
- Joined: Tue May 26, 2015 10:28 am
Webapp customisation
Post by aleh.haidash »
Hello.
We use Oxygen Webapp 19.1 as dita editor. We faced with some issues connected with customization it for our needs:
1) How we can remove actions from context menu (for example Edit reference
) ?
2) We catch exception connected with dirty status. We use dirty listener with call server operation
When we try to call some oxygen actions, that remove selected offset (for example Join Cell Above, paste text from external source), we got exception
with next stacktrace
.
Where plugins.js:53 - new sync.ops.ServerOperation from prev code block.
3) We need to add new attribute to selected node in "xml mode". It works fine in author mode:
if we use xml mode, attribute was added. But is notshowed in xml mode. We need to reload xml mode (go back to author and open xml mode again). Could you provide possible way to insert attribute in xml mode(using current offset/caret position), or reload document in xml mode or api for getting current mode?
Could you help us with these issues? We hope you have a solution, since we don't want to hardcode these problems.
Thanks.
We use Oxygen Webapp 19.1 as dita editor. We faced with some issues connected with customization it for our needs:
1) How we can remove actions from context menu (for example Edit reference

2) We catch exception connected with dirty status. We use dirty listener with call server operation
Code: Select all
goog.events.listen(editor, sync.api.Editor.EventTypes.DIRTY_STATUS_CHANGED, function(e) {
new sync.ops.ServerOperation("webapp.extention.action.NotifyDirty", editor.getController()).doOperation(function(){}, {
isDirty: e.isDirty
}, null);
}

Code: Select all
workspace-f31af6f40d.js:1393 Uncaught Error: Reference sentinel not found for position: {"nodeId":"44","sentinelType":0,"distance":0}
at Function.sync.caret.ContentIterator.fromRelativeContentPosition (VM566 workspace-f31af6f40d.js:1393)
at sync.position.RelativeContentPosition.toHTMLPosition (VM566 workspace-f31af6f40d.js:1426)
at sync.select.SavedSelection.restore (VM566 workspace-f31af6f40d.js:1548)
at sync.select.SelectionHandler.getCurrentSelection (VM566 workspace-f31af6f40d.js:1934)
at Object.sync.select.getSelection (VM566 workspace-f31af6f40d.js:1545)
at sync.ops.ServerOperation.doOperation (VM566 workspace-f31af6f40d.js:2120)
at sync.Editor.<anonymous> (VM570 plugins.js:53)
at sync.Editor.goog.events.EventTarget.fireListeners (VM566 workspace-f31af6f40d.js:234)
at Function.goog.events.EventTarget.dispatchEventInternal_ (VM566 workspace-f31af6f40d.js:236)
at sync.Editor.goog.events.EventTarget.dispatchEvent (VM566 workspace-f31af6f40d.js:231)
Where plugins.js:53 - new sync.ops.ServerOperation from prev code block.
3) We need to add new attribute to selected node in "xml mode". It works fine in author mode:
Code: Select all
documentController.beginCompoundEdit();
documentController.removeAttribute(tag.getName(), element);
documentController.setAttribute(tag.getName(), newAttr, element);
documentController.insertXMLFragment("", element.getStartOffset());
documentController.endCompoundEdit();
Could you help us with these issues? We hope you have a solution, since we don't want to hardcode these problems.
Thanks.
Best Regards,
Aleh
Aleh
-
- Posts: 517
- Joined: Thu Sep 04, 2014 4:22 pm
Re: Webapp customisation
Post by cristi_talau »
Hello,
1. The Action has the ID: 'Author/EditReference' . You can remove it as in this tutorial: https://www.oxygenxml.com/maven/com/oxy ... ction.html .
2. You can try to invoke the API method instead: sync.api.ActionsManager#invokeOperation (https://www.oxygenxml.com/maven/com/oxy ... nager.html) . It seems that you are executing your (background) operation in parallel with another operation performed by the user. You may consider setting the opt_background parameter of the method that I mentioned above.
3.The text page is synchronised with the server-side model only when switching to/from the Author View. Unfortunately, we also do not have API for the text page. Did you add actions on the toolbar in text-mode also? How does the user get to insert that attribute? I would suggest modifying the text and then it will be synchronised to the server model when the user switches to Author mode or saves.
Best,
Cristian
1. The Action has the ID: 'Author/EditReference' . You can remove it as in this tutorial: https://www.oxygenxml.com/maven/com/oxy ... ction.html .
2. You can try to invoke the API method instead: sync.api.ActionsManager#invokeOperation (https://www.oxygenxml.com/maven/com/oxy ... nager.html) . It seems that you are executing your (background) operation in parallel with another operation performed by the user. You may consider setting the opt_background parameter of the method that I mentioned above.
3.The text page is synchronised with the server-side model only when switching to/from the Author View. Unfortunately, we also do not have API for the text page. Did you add actions on the toolbar in text-mode also? How does the user get to insert that attribute? I would suggest modifying the text and then it will be synchronised to the server model when the user switches to Author mode or saves.
Best,
Cristian
-
- Posts: 32
- Joined: Tue May 26, 2015 10:28 am
Re: Webapp customisation
Post by aleh.haidash »
Hello.
Thank you for your quick response.
I'll check 1) and 2). I thinks it'll help.
About 3) I use external operation. I handle it in js and then call ServerOperation.
Thanks.
Thank you for your quick response.
I'll check 1) and 2). I thinks it'll help.
About 3) I use external operation. I handle it in js and then call ServerOperation.
I want to do like this, but I need your help: how can I insert attribute in current selected node in xml mode using js or java? Is it possible for now?I would suggest modifying the text and then it will be synchronised to the server model when the user switches to Author mode or saves.
Thanks.
Best Regards,
Aleh
Aleh
-
- Posts: 517
- Joined: Thu Sep 04, 2014 4:22 pm
Re: Webapp customisation
Post by cristi_talau »
Hello,
Unfortunately, we do not have a high-level API for the text page. We use CodeMirror in that page, so you can use its API to modify the content (e.g. http://codemirror.net/doc/manual.html#replaceSelection).
Best,
Cristian
Unfortunately, we do not have a high-level API for the text page. We use CodeMirror in that page, so you can use its API to modify the content (e.g. http://codemirror.net/doc/manual.html#replaceSelection).
Best,
Cristian
-
- Posts: 32
- Joined: Tue May 26, 2015 10:28 am
Re: Webapp customisation
Post by aleh.haidash »
Hello2. You can try to invoke the API method instead: sync.api.ActionsManager#invokeOperation (https://www.oxygenxml.com/maven/com/oxy ... nager.html) . It seems that you are executing your (background) operation in parallel with another operation performed by the user. You may consider setting the opt_background parameter of the method that I mentioned above.
Unfortunately I receive this issue again if I try to call next operation(I think without active selection)
Code: Select all
editor.getActionsManager().invokeOperation('SetReadOnlyStatusOperation', {'read-only': state},callback)
Stacktrace
Code: Select all
sync.caret.ContentIterator.fromRelativeContentPosition
http://192.168.94.211:8080/oxygen-editor/app/workspace-1f234a0d74.js:1395:154
sync.position.RelativeContentPosition.prototype.toHTMLPosition
http://192.168.94.211:8080/oxygen-editor/app/workspace-1f234a0d74.js:1428:406
sync.select.SavedSelection.prototype.restore
http://192.168.94.211:8080/oxygen-editor/app/workspace-1f234a0d74.js:1550:90
sync.select.SelectionHandler.prototype.getCurrentSelection
http://192.168.94.211:8080/oxygen-editor/app/workspace-1f234a0d74.js:1937:489
sync.select.getSelection
http://192.168.94.211:8080/oxygen-editor/app/workspace-1f234a0d74.js:1547:74
sync.ops.ServerOperation.prototype.doOperation
http://192.168.94.211:8080/oxygen-editor/app/workspace-1f234a0d74.js:2145:279
sync.actions.ActionsManager.prototype.invokeOperation/this.opsQueue_<
http://192.168.94.211:8080/oxygen-editor/app/workspace-1f234a0d74.js:1557:236
goog.Promise.prototype.addChildPromise_/d.child</d.onFulfilled<
http://192.168.94.211:8080/oxygen-editor/app/workspace-1f234a0d74.js:749:187
goog.Promise.invokeCallback_
http://192.168.94.211:8080/oxygen-editor/app/workspace-1f234a0d74.js:757:79
goog.Promise.prototype.executeCallback_
http://192.168.94.211:8080/oxygen-editor/app/workspace-1f234a0d74.js:756:180
goog.Promise.prototype.executeCallbacks_
http://192.168.94.211:8080/oxygen-editor/app/workspace-1f234a0d74.js:755:135
goog.async.run.processWorkQueue
http://192.168.94.211:8080/oxygen-editor/app/workspace-1f234a0d74.js:735:97
Thanks.
Best Regards,
Aleh
Aleh
-
- Posts: 32
- Joined: Tue May 26, 2015 10:28 am
Re: Webapp customisation
Post by aleh.haidash »
I want to add that I call
maybe this operation delete selection or something else.
but I catch error with selection if I call this 2 operation next order ReloadContentOperation -> SetReadOnlyStatusOperation.
Thanks
Code: Select all
editor.getActionsManager().invokeOperation('ro.sync.ecss.extensions.commons.operations.ReloadContentOperation', {}, callback);
but I catch error with selection if I call this 2 operation next order ReloadContentOperation -> SetReadOnlyStatusOperation.
Thanks
Best Regards,
Aleh
Aleh
-
- Posts: 81
- Joined: Wed Jul 20, 2016 8:22 am
Re: Webapp customisation
Post by mihai_coanda »
Hello,
I am trying to reproduce your issue using the 19.1 build from our website by running the following code in the browser's console:
This call works as expected and we cannot reproduce the issue you are experiencing.
In order to support you in overcoming this issue we first need to reproduce it on our side. It would be great if you could provide us a code snippet that we can execute in the browser's console and reproduce the issue.
Another point of interest would be if you constantly reproduce this issue each time you call your code or is it some special scenario in which you do. If this issue appears in only certain scenarios we would need a step by step scenario.
Regards,
Michael
I am trying to reproduce your issue using the 19.1 build from our website by running the following code in the browser's console:
Code: Select all
workspace.currentEditor.getActionsManager().invokeOperation('ro.sync.ecss.extensions.commons.operations.ReloadContentOperation', {}, goog.nullFunction);
workspace.currentEditor.getActionsManager().invokeOperation('SetReadOnlyStatusOperation', {'read-only': true},goog.nullFunction)
In order to support you in overcoming this issue we first need to reproduce it on our side. It would be great if you could provide us a code snippet that we can execute in the browser's console and reproduce the issue.
Another point of interest would be if you constantly reproduce this issue each time you call your code or is it some special scenario in which you do. If this issue appears in only certain scenarios we would need a step by step scenario.
Regards,
Michael
Michael
https://www.oxygenxml.com
https://www.oxygenxml.com
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