java vs javascript with Oxygen SDK
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 91
- Joined: Tue Jul 17, 2018 6:57 am
java vs javascript with Oxygen SDK
Post by msambasiva »
Hi,
As I understand, we can use either java or javascript with SDK to customize the Oxygen features. Please correct me if I am wrong. I am basically a java developer. Please let me know if I need to learn javascript to work with Oxygen SDK. If required, can we use javascript framework with Oxygen SDK? If so, which is the best framework?
Please suggest any reference to read to get started with schematron in Oxygen.
Thanks,
Samba.
As I understand, we can use either java or javascript with SDK to customize the Oxygen features. Please correct me if I am wrong. I am basically a java developer. Please let me know if I need to learn javascript to work with Oxygen SDK. If required, can we use javascript framework with Oxygen SDK? If so, which is the best framework?
Please suggest any reference to read to get started with schematron in Oxygen.
Thanks,
Samba.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: java vs javascript with Oxygen SDK
Hi Samba,
Javascript is an alternative when it comes to creating small Oxygen plugins. A Javascript-based plugin can call our Java API:
https://www.oxygenxml.com/doc/versions/ ... in-js.html
But there is no option to use Javascript to developer framework customizations, it's only available for plugins.
So as you are comfortable with Java you should continue using it.
About Schematron, besides Oxygen's user's manual there are a couple of topics on the Oxygen XML Blog:
https://blog.oxygenxml.com/topics/shari ... rules.html
https://blog.oxygenxml.com/topics/SchematronBCs.html
If you want to learn Schematron, you can google for Schematron tutorials, there is also a tutorial with samples created by my colleague Octavian:
https://github.com/octavianN/Schematron-step-by-step
Regards,
Radu
Javascript is an alternative when it comes to creating small Oxygen plugins. A Javascript-based plugin can call our Java API:
https://www.oxygenxml.com/doc/versions/ ... in-js.html
But there is no option to use Javascript to developer framework customizations, it's only available for plugins.
So as you are comfortable with Java you should continue using it.
About Schematron, besides Oxygen's user's manual there are a couple of topics on the Oxygen XML Blog:
https://blog.oxygenxml.com/topics/shari ... rules.html
https://blog.oxygenxml.com/topics/SchematronBCs.html
If you want to learn Schematron, you can google for Schematron tutorials, there is also a tutorial with samples created by my colleague Octavian:
https://github.com/octavianN/Schematron-step-by-step
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 110
- Joined: Fri May 14, 2010 12:14 am
Re: java vs javascript with Oxygen SDK
Hi Radu,
I'm having trouble reconciling the two statements below:
I'm having trouble reconciling the two statements below:
is this because we can't add JavaScript assets to the Extensions tab of a framework?
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: java vs javascript with Oxygen SDK
Hi John,
Right, the Extensions tab for a framework customization only allows JAR libraries in the classpath. We might add some day for Javascript-based extensions here but right now only Java can be used for framework extensions.
Regards,
Radu
Right, the Extensions tab for a framework customization only allows JAR libraries in the classpath. We might add some day for Javascript-based extensions here but right now only Java can be used for framework extensions.
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: java vs javascript with Oxygen SDK
Hi John,
If we were to look into implementing this, we could possibly look in all folder in the framework configuration's classpath, load all Javascript files having a particular name pattern using the Rhyno library we already use for plugins, then from those Javascript files call some methods to return implementations of those classes. But I do not have all the details figured out for this one.
Regards,
Radu
If we were to look into implementing this, we could possibly look in all folder in the framework configuration's classpath, load all Javascript files having a particular name pattern using the Rhyno library we already use for plugins, then from those Javascript files call some methods to return implementations of those classes. But I do not have all the details figured out for this one.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 110
- Joined: Fri May 14, 2010 12:14 am
Re: java vs javascript with Oxygen SDK
Hi Radu,

Btw, we had one of our student interns write our first instances of Java extensions, which still need some work before including it in our framework.
If time allowed, I was going to ask her to implement JavaScript versions as well for example purposes, but now that I know we can't include them in a framework, there's no need.
What!!! Not yet???But I do not have all the details figured out for this one.

Btw, we had one of our student interns write our first instances of Java extensions, which still need some work before including it in our framework.
- Support multiple ID generation patterns, each having their own list of elements. Right now, Oxygen supports just one pattern and one element list. We don't want our users to be able to configure this with a dialog box though. Our Information Architecture group has defined the patterns they want to use for different groups of elements.
- Is there a hook to have the Generate IDs execute our own code instead of the default code?
- Can we suppress the built-in ID Options dialog?
- A Build Log Viewer in a JTable that supports filtering. It also shows the full text of the log in a sibling panel and positions the viewable area of that panel depending on the currently selected row in the table so that it shows the context of the error. We plan on adding regex support and the ability to offer named regex filters and selectors for different uses, such as error severity level, component (build.xml, DITA-OT, FOP, etc.), error code, ditamap for multi ditamap builds, etc.
If time allowed, I was going to ask her to implement JavaScript versions as well for example purposes, but now that I know we can't include them in a framework, there's no need.
-
- Posts: 110
- Joined: Fri May 14, 2010 12:14 am
Re: java vs javascript with Oxygen SDK
Hi Radu,
It looks like Rhino has a compiler and debugger: https://developer.mozilla.org/en-US/doc ... t_Compiler
From the above page:
It looks like Rhino has a compiler and debugger: https://developer.mozilla.org/en-US/doc ... t_Compiler
From the above page:
The JavaScript compiler translates JavaScript source into Java class files. The resulting Java class files can then be loaded and executed at another time, providing a convenient method for transferring JavaScript, and for avoiding translation cost.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: java vs javascript with Oxygen SDK
Hi John,
About these questions:
About using Javascript for extensions, in my opinion it's nice to use when you have small pieces of code but as the code gets larger and you call lots of APIs on the Oxygen side, for me it's easier using Java, you get clear compilation errors if you make mistakes, I get content completion when calling various APIs on the Oxygen side so I don't need to look at the Oxygen SDK Javadoc just to see what methods are available in what object.
Regards,
Radu
About these questions:
Sure, actually you can do this quite easily by editing the DITA extension framework configuration and in the "Author->Actions" tab find the action for "generate.ids" and have it call a custom operation (even JSOperation).Is there a hook to have the Generate IDs execute our own code instead of the default code?
This is again an action with id "id.options" defined in the Actions list. You can remove it from the menus and toolbars.Can we suppress the built-in ID Options dialog?
So some user interface in which you load the entire DITA OT console output and tries to present in a structured form the encountered errors? This is similar to what we do, we present in the Problems view errors gathered from the DITA OT console output.A Build Log Viewer in a JTable that supports filtering. It also shows the full text of the log in a sibling panel and positions the viewable area of that panel depending on the currently selected row in the table so that it shows the context of the error. We plan on adding regex support and the ability to offer named regex filters and selectors for different uses, such as error severity level, component (build.xml, DITA-OT, FOP, etc.), error code, ditamap for multi ditamap builds, etc.
About using Javascript for extensions, in my opinion it's nice to use when you have small pieces of code but as the code gets larger and you call lots of APIs on the Oxygen side, for me it's easier using Java, you get clear compilation errors if you make mistakes, I get content completion when calling various APIs on the Oxygen side so I don't need to look at the Oxygen SDK Javadoc just to see what methods are available in what object.
Regards,
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