use rhino require in wsaccess plugin
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: use rhino require in wsaccess plugin
Hi Barbara,
We are using Rhyno version 1.7.7.1 to run the javascript. I did not manage to find a small example with how that "require" would work.
So right now I cannot give you a solution for writing and using multiple Javascript modules, we are interested in making this work though so probably in a future Oxygen version you will be able to specify in your plugin.xml references to multiple Javascript files which Oxygen will use for the plugin.
In the meantime, if you decide to have multiple Javascript modules you could have a build stage in which you combine all these modules in a single Javascript file which will actually be used.
Or if you want to experiment further you could take full control over the Java code we use to call the Rhyno engine. You can create a Java implementation of the "WorkspaceAccess" plugin extension which calls Rhyno code to invoke methods from a Javascript file:
post41181.html
Regards,
Radu
We are using Rhyno version 1.7.7.1 to run the javascript. I did not manage to find a small example with how that "require" would work.
So right now I cannot give you a solution for writing and using multiple Javascript modules, we are interested in making this work though so probably in a future Oxygen version you will be able to specify in your plugin.xml references to multiple Javascript files which Oxygen will use for the plugin.
In the meantime, if you decide to have multiple Javascript modules you could have a build stage in which you combine all these modules in a single Javascript file which will actually be used.
Or if you want to experiment further you could take full control over the Java code we use to call the Rhyno engine. You can create a Java implementation of the "WorkspaceAccess" plugin extension which calls Rhyno code to invoke methods from a Javascript file:
post41181.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 13
- Joined: Mon Oct 23, 2017 3:42 pm
Re: use rhino require in wsaccess plugin
hi,
thanks and sorry for my mistake: require isn't a rhino but a commonjs function which is available in rhino since version 1.7R3.
http://tschaub.net/blog/2011/05/17/comm ... rhino.html
So js.jar already contains the needed code.
https://mozilla.github.io/rhino/javadoc ... quire.html
i hope that somehow helpful.
best wishes,
barbara
thanks and sorry for my mistake: require isn't a rhino but a commonjs function which is available in rhino since version 1.7R3.
http://tschaub.net/blog/2011/05/17/comm ... rhino.html
So js.jar already contains the needed code.
https://mozilla.github.io/rhino/javadoc ... quire.html
i hope that somehow helpful.
best wishes,
barbara
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: use rhino require in wsaccess plugin
Hi Barbara,
Thanks for the links.
Probably in a future Oxygen version we'll add support for you to declare additional JS modules in the "plugin.xml".
Regards,
Radu
Thanks for the links.
Probably in a future Oxygen version we'll add support for you to declare additional JS modules in the "plugin.xml".
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: use rhino require in wsaccess plugin
Hi,
We released Oxygen 21.1 and it should allow specifying multiple Javascript module files in the plugin.xml like:
Regards,
Radu
We released Oxygen 21.1 and it should allow specifying multiple Javascript module files in the plugin.xml like:
Code: Select all
<extension type="WorkspaceAccessJS" href="wsAccess.js"/>
<extension type="WorkspaceAccessJSModule" href="wsAccessModule1.js"/>
<extension type="WorkspaceAccessJSModule" href="wsAccessModule2.js"/>
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “SDK-API, Frameworks - Document Types”
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