Skip to content

Using Plugins

Frieder Reinhold edited this page Mar 17, 2020 · 2 revisions

To install a plugin copy the .jar into the plugins/jars directory. This directory can be opened through a button in the plugins menu in the application.

Manage execution order

Inside the plugins folder create a file called protocol.xml.

It has the following structure:

<?xml version="1.0" encoding="UTF-8"?>
<protocol>
    <lists>
        <PublishMessageHook>
            <plugin name="example-plugin-1"/>
            <plugin name="example-plugin-2"/>
        </PublishMessageHook>

        <MessageIncomingHook>
            <plugin name="example-plugin-2"/>
            <plugin name="example-plugin-1"/>
        </MessageIncomingHook>
    </lists>
</protocol>

For each extension point the order can be defined separately.

E. g. it's pretty common to use one order of plugin execution for sending messages and reverse this order for incoming messages.

Attention
  • If there is no plugin specified for an extension point, all available extensions will be executed in a random order.
  • If two plugins implement extensions for the same extension point and only one is declared, the other one won't be executed.

Create Tasks

Some extension points will accept lists of extensions, called a task. Tasks need to be defined inside the protocol.xml as well:

<?xml version="1.0" encoding="UTF-8"?>
<protocol>
    <lists>
    ...
    </lists>

    <tasks>
        <DetailViewManipulatorHook>
            <task name="Decode + unzip + save">
                <plugin name="base64-plugin" extensionId="decode" />
                <plugin name="zip-manipulator-plugin" extensionId="unzip" />
                <plugin name="save-manipulator-plugin" extensionId="save" />
            </task>
            ...
        </DetailViewManipulatorHook>

        <MessageValidatorHook>
<!--      specify tasks to validate messages in specific topics -->
            <task id="/com/+/example">
                <plugin name="xml-xsd-validator-plugin">
<!--                ### plugins may be configurable ###     -->
<!--                ###  check their documentation  ###     -->
                    <schema>Example.xsd</schema>
                </plugin>
            </task>
<!--        ### add more tasks as you wish ###              -->
        </MessageValidatorHook>
    </tasks>
</protocol>

The same extension may be used more than once in one task and multiple tasks can be defined.

Clone this wiki locally