XSLTOperation in javascript

Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
NicoAMP
Posts: 97
Joined: Tue Mar 06, 2018 2:07 pm
Contact:

XSLTOperation in javascript

Post by NicoAMP »

Hello,

From javascript, I tried to perform an XSLT action:

Code: Select all

TransformToOlAction.prototype.actionPerformed = function (callback) {
   this.editor.getActionsManager().invokeOperation(
      'ro.sync.ecss.extensions.commons.operations.XSLTOperation', {
      action: 'Replace',
      script: '${framework}/lib/element-to-ol.xsl'
   }, callback);
};
But I have the following message:
For security reasons, the execution of ro.sync.ecss.extensions.commons.operations.XSLTOperation with user-provided parameters is blocked. If the operation is safe, consider annotating it with ro.sync.ecss.extensions.api.webapp.WebappRestSafe.
Is it possible to resolve this problem directly in javascript code?
Or, do I have to implement a specific action in Java with @WebappRestSafe annotation?

Thanks.
Nicolas Delobel
AmeXio
nicolas.delobel at group.amexio.net
cristi_talau
Posts: 496
Joined: Thu Sep 04, 2014 4:22 pm

Re: XSLTOperation in javascript

Post by cristi_talau »

Hello,

This restriction is put in place as a security control to avoid running untrusted XSLT code provided by an user. You will need to implement your own operation that will load the XSLT script from a trusted location (e.g. a JAR file in the classpath) and only receive a couple of params from client-side code.

Best,
Cristian
NicoAMP
Posts: 97
Joined: Tue Mar 06, 2018 2:07 pm
Contact:

Re: XSLTOperation in javascript

Post by NicoAMP »

Thanks Cristian for these information.
Regards,
Nicolas
Nicolas Delobel
AmeXio
nicolas.delobel at group.amexio.net
Post Reply