Call multiple AuthorOperation implementations in Web Author action?
Oxygen general issues.
-
- Posts: 16
- Joined: Tue Nov 13, 2007 6:02 pm
Call multiple AuthorOperation implementations in Web Author action?
We recently upgraded from Web Author 18.1 to 20.0. Under 18.1, we had the following simple action defined for Web Author (displaying only the actionPerformed function for brevity):
The purpose of the second invokeOperation call is to place a customized prefix onto the URL value of the link generated by the first invoked operation (SurroundWithFragmentOperation). This prefix is generated by a custom AuthorOperation implementation, InsertLinkPrefixOperation. This operation operates on the selected node, which is the newly generated cross-reference link installed by the previously invoked operation.
This no longer works under v20.0 -- no exceptions thrown, it seems to just ignore the call to InsertLinkPrefixOperation. From inspection of the Web Author JS API it isn't apparent if something different has to happen for this to work going forward. Do we need to be more explicit in identifying the selection on which the second operation should accept? Any help?
Code: Select all
MarkCrossRefAction.prototype.actionPerformed = function (callback) {
var url = window.prompt("Cross Reference URL:", "");
if (url) {
var surroundWith = '<a class="cross-ref" href="' + url + '"></a>';
var am = this.editor.getActionsManager();
am.invokeOperation('ro.sync.ecss.extensions.commons.operations.SurroundWithFragmentOperation', {
fragment: surroundWith
},
function () {
am.invokeOperation('org.lds.cm.ldssource.framework.operations.InsertLinkPrefixOperation', {
},
callback);
});
} else {
callback && callback();
}
};
This no longer works under v20.0 -- no exceptions thrown, it seems to just ignore the call to InsertLinkPrefixOperation. From inspection of the Web Author JS API it isn't apparent if something different has to happen for this to work going forward. Do we need to be more explicit in identifying the selection on which the second operation should accept? Any help?
-
- Posts: 517
- Joined: Thu Sep 04, 2014 4:22 pm
Re: Call multiple AuthorOperation implementations in Web Author action?
Post by cristi_talau »
Hello,
From the symptoms you described it seems that the operation "org.lds.cm.ldssource.framework.operations.InsertLinkPrefixOperation" is not annotated as safe to be invoked from the JS code. The annotation is "ro.sync.ecss.extensions.api.webapp.WebappRestSafe". This annotation is enforced starting from version 20.
Anyway, to confirm this you can look in the server-side logs for more information: https://www.oxygenxml.com/doc/versions/ ... -logs.html .
Best,
Cristian
From the symptoms you described it seems that the operation "org.lds.cm.ldssource.framework.operations.InsertLinkPrefixOperation" is not annotated as safe to be invoked from the JS code. The annotation is "ro.sync.ecss.extensions.api.webapp.WebappRestSafe". This annotation is enforced starting from version 20.
Anyway, to confirm this you can look in the server-side logs for more information: https://www.oxygenxml.com/doc/versions/ ... -logs.html .
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