Webapp customisation
Posted: Thu May 10, 2018 9:13 am
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.