Page 1 of 1

Re: Creating an Oxygen plugin from IntelliJ?

Posted: Fri Jun 30, 2017 7:56 am
by Radu
Hi Matthew,

Should I understand that you used our Maven-based SDK:

https://www.oxygenxml.com/oxygen_sdk.html

to try and create an IntelliJ project? We do not work with IntelliJ internally but maybe if you tell us more about what went wrong we could try to do the same steps on our side and help you further.

As an alternative, there is a special Oxygen plugin type which allows Javascript implementations, meaning that you no longer need to compile your extensions.

https://www.oxygenxml.com/doc/versions/ ... in-js.html

And some sample plugins I built over the years:
https://github.com/oxygenxml/wsaccess-j ... le-plugins

Basically Oxygen uses the Rhyno Javascript engine to allow the Javascript code to call Oxygen Java API methods.

Regards,
Radu

Re: Creating an Oxygen plugin from IntelliJ?

Posted: Mon Jul 03, 2017 2:21 pm
by Radu
Hello Matthew,

So:
Most of us have experience in Java, so Javascript probably isn't the best choice.
Actually the Javascript just calls Java code using the Rhyno engine:

https://developer.mozilla.org/en-US/doc ... pting_Java

so it might be fun for them to try invoking the Java API from JavaScript and they would no longer need to compile anything.
It seems everyone followed slightly different ones, either trying to translate the Youtube video to IntelliJ or the instructions in the documentation the same way, from what I've been told, it's essentially creating a new Maven project with the 19.0.0.0 Archetype, after which the maven project downloads for a very long time, occasionally failing for reasons no-one can remember,
Possibly some network connection. Indeed the libraries need to be brought to the local Maven repository and this may take some time.
and if they got that far, it creates a project structure with many examples,
We do have lots of samples in the SDK and indeed this makes things more confusing. I will add an internal issue to try and maybe have different SDKs for different purposes.
In your case after the project was created the developers can manually remove the folders:

Code: Select all

/oxygen-sdk-samples/oxygen-sample-applet
/oxygen-sdk-samples/oxygen-sample-eclipse-plugin
/oxygen-sdk-samples/oxygen-sample-framework
/oxygen-sdk-samples/oxygen-sample-webapp
and from the folder "oxygen-sample-plugins" preserve only the "oxygen-sample-plugin-workspace-access" plugin sample which will be used to create a workspace access plugin extension which is flexible enough for most purposes:

https://www.oxygenxml.com/doc/versions/ ... lugin.html
then they said something about trying to add arguments to the "maven install action" so that it would know where the Oxygen folder is to install to, but they all seem to have different ideas exactly what you have to add to the run configuration to do that, and if they made it this far, since for many, builds would just fail for reasons they couldn't seem to fix, they would try to configure an "external tool" to open oxygen with the plugins installed, and I don't think anyone ever actually achieved that, possibly due to our employees not being given administrator access to their machines, so IntelliJ may not have been able to write to the program files folder (just my hunch).
A simple plugin is basically a folder containing a JAR library and a plugin.xml descriptor file:

https://www.oxygenxml.com/doc/versions/ ... lugin.html

In order to install the plugin, its folder should be copied to the OXYGEN_INSTALL_DIR\plugins folder. In order for this to work, you need to give full read-write rights for the current user to the Oxygen plugins folder or to install Oxygen in a place where there is full file system read-write access for the current user (for example "My Documents", "Desktop").
Long story short, every step failed for different people for different reasons, but most of them agreed on not having clear instructions and not having any experience with Eclipse to translate the process of making the project into, the funny thing is that no-one has any issues whatsoever writing the actual plugin code, but the project configuration seems to have either stumped everyone or just made them stop caring by the time they could actually build something.
They seemed to have got far enough, they just need to allow the current user full file system read-write rights to the Oxygen "plugins" folder.
I will take your feedback and we'll try to make these required steps easier than they are currently are.
Usually what I do on my side after the Maven project gets created in my IDE (Eclipse) is to remove the extra samples (see my suggestion above), and then in the "sample-plugin-workspace-access" right click the "pom.xml" and choose "Maven Install". After this, the folder oxygen-sample-plugins\oxygen-sample-plugin-workspace-access\target folder should contain a JAR library which has inside the plugin folder. The JAR needs to be unpacked in the Oxygen "plugins" folder and then Oxygen needs to be restarts. In the Oxygen Preferences->"Plugins" page you can see the list of loaded plugins.

Regards,
Radu

Re: Creating an Oxygen plugin from IntelliJ?

Posted: Tue Jul 04, 2017 11:55 am
by Radu
Hi,

I tried to create a simpler project on GitHub containing only the most popular plugin extension type along with some installation details:

https://github.com/oxygenxml/sample-plu ... ace-access

Regards,
Radu