Calling Plugins
You can call server-side plugins from JDito using the run
method of the plugin
module.
Object[] run(String jarURL, String className, Object[] arguments);
-
jarURL
: URL of the plugin JAR file. Can benull
if the JAR is already on the classpath.
Using the classpath is the preferred method.
Direct JAR referencing (e.g., using a file URL) does not work reliably on all platforms (e.g., Linux). -
className
: Fully qualified class name of the plugin. -
arguments
: An array of parameters passed to the plugin as arguments. -
return
: The result returned by the plugin. -
throws
:PluginException
if an error occurs.
Example
// run the plugin contained in testplugin.jar
var ret = plugin.run("file:///c:/plugin/testplugin.jar",
"de.adito.aditoweb.plugin.test.TestPlugin",
new Array("arg1", "arg2", "arg3") );
// display the number of array elements returned
question.showMessage(ret.length);
Using Plugins via Alias
To call a plugin via the plugin service, you must define an alias. The alias should specify the path where the plugin is hosted.
Currently, plugins are deployed to a Nexus repository.
Background
The plugin service is an external service and must be integrated into the ADITO system via an alias.
In SSP operations, plugins are provisioned automatically by the operator through this external service.
The alias definition signals that the plugin service should be started.
How to Set It Up
- Open the Projects module.
- Go to alias.
- Right-click → New.
- Enter a name.
- Choose type:
plugin
. - Deploy the configuration.
After deployment, the alias appears under system → default.
- Right-click the alias → Create.
- Go back to the alias definition.
- In the bottom left Properties panel, enter the following fields:
pluginGroupID
pluginArtifactId
pluginVersion
If you use the following example:
pluginCoordinates=de.adito.plugin:ewsplugin:1.1.4
pluginServiceUrl=https://127.0.0.1:8443/ews/
The pluginServiceUrl
is inserted by the operator when the service starts.
Figure: Required plugin alias properties