Page 1 of 1
Send command line option for plugin
Posted: Mon Feb 24, 2014 8:02 pm
by flasomm
We've made a plugin to load data from web services.
Is it possible to open Oxygen and send an id to the plugin with command line ?
Ex:
Thanks
Re: Send command line option for plugin
Posted: Tue Feb 25, 2014 10:16 am
by Radu
Hi,
Oxygen is a Java application. A Java application can be started with a set of properties (which can then be read from the Java code using System.getProperty) and with a set of program arguments.
If you look inside the
OXYGEN_INSTALL_DIR/oxygen.sh, the system properties are sent hard coded like:
Code: Select all
-Dcom.oxygenxml.MultipleInstances=true
while the program arguments are read from the command line. Unfortunately there is no way for a plugin to have access to the program arguments while it could have access to the system properties using constructs like
System.getProperty("com.oxygenxml.MultipleInstances").
You will probably need to make your own version of the
oxygen.sh which interprets the list of additional command line parameters as system properties for the
java process.
Another possible workaround would be for your plugin to open a socket on some predetermined port and to send to it commands from the exterior via that opened port.
Regards,
Radu
Re: Send command line option for plugin
Posted: Fri May 23, 2014 3:31 pm
by Radu
Hi,
Oxygen 16.0 was just released.
Starting with Oxygen 16.0 you will be able to invoke a command line like:
and the application will start with a system property named
myPlugin set to
id which a started plugin can read from the system properties map.
Regards,
Radu