Plugin - JavaScript Demo Works?

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
jlpoole
Posts: 13
Location: Salem, Oregon

Plugin - JavaScript Demo Works?

Wed Jan 18, 2017 10:11 pm

I'm recreating the example plugin at https://www.oxygenxml.com/doc/versions/ ... in-js.html

I copied the content from the examples into two files, plugin.xml, and msAcess.js, and placed the files in my Oxygen plugins folder.

I launched Oxygen from a DOS console (so I might see any System.out.println or error output), selected the example flowers.ditamap and then looked for the "Run notepad" in two windows. I did not see any output in my DOS console indicating that the plugin had loaded, nor was I able to see the menu item, "Run notepad", that should have added.

What do I need to do to have the plugins activated?

My version of Oxygen:
Image

Showing the files in the plugins directory:
Image

Depicting the right click pop-up menu in the ditamap views:
Image
Image
Radu
Posts: 5862

Re: Plugin - JavaScript Demo Works?

Thu Jan 19, 2017 9:28 am

Hi,

In the Oxygen "plugins" folder you should create another folder called for example something like "myPlugin" in which the plugin.xml and all other resources are located.
Here's a github project which contains various workspace access plugin samples, maybe it will help you see other examples as well:

https://github.com/oxygenxml/wsaccess-javascript-sample-plugins

Oh, and we will update our documentation to explain more properly the need for a plugin-specific folder inside the plugins folder.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
jlpoole
Posts: 13
Location: Salem, Oregon

Re: Plugin - JavaScript Demo Works?

Thu Jan 19, 2017 3:28 pm

Thank you, your instructions worked.

I created a subfolder "radu", to wit: C:\Program Files\Oxygen XML Editor 18\plugins\radu, and moved the two files plugin.xml and msAcess.js, into the "radu" folder and then launched Oxygen from the command line. The "run notepad" now displays in the right-click pop-up menu.

Here's session output:

Code: Select all

C:\Program Files\Oxygen XML Editor 18>oxygen.bat
Picked up JAVA_TOOL_OPTIONS: -Djava.net.preferIPv4Stack=true
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
Application started ro.sync.exml.workspace.b.c.k@e62319f
0 WARN [ main ] ro.sync.exml.project.c - Could not load the last project file.java.io.IOException: No scenario in specified file.

running file:/C:/Users/jlpoole/Documents/OxygenXMLEditor/samples/dita/flowers/flowers.ditamap
5253 WARN [ AuthorExtensionBuilder ] ro.sync.ecss.extensions.g - Actions update state took too long, checkOffset 29 in file:/C:/Users/jlpoole/Documents/OxygenXM
amap
RIGHT CLICKro.sync.ecss.component.ui.f.b.t[,0,0,0x0,invalid,layout=javax.swing.plaf.basic.DefaultMenuLayout,alignmentX=0.0,alignmentY=0.0,border=javax.swing.pla
mumSize=,minimumSize=,preferredSize=,desiredLocationX=0,desiredLocationY=0,label=,lightWeightPopupEnabled=true,margin=,paintBorder=true]
Computed absolute reference file:/C:/Users/jlpoole/Documents/OxygenXMLEditor/samples/dita/flowers/topics/flowers/snowdrop.dita
Application closing ro.sync.exml.workspace.b.c.k@e62319f

C:\Program Files\Oxygen XML Editor 18>


This issue is now resolved. Thank you.
Radu
Posts: 5862

Re: Plugin - JavaScript Demo Works?

Thu Jan 19, 2017 3:33 pm

Hi John,

Great. Once you have a stable plugin and want to share it with others, the procedure is this one:

https://www.oxygenxml.com/doc/versions/18.1/ug-editor/topics/packing-and-deploying-addons.html

because most people might not have admin privileges to create folders in the Windows program files area.
Or you can instruct users to install Oxygen in a place (user home for example) with full read/write access allowed to all applications.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Return to “Common Problems”

Who is online

Users browsing this forum: No registered users and 1 guest