Plugins

Plugins contain extensions for STRAP from third-party developers. They cannot be used if customized classloaders are deactivated in STRAP to enhance security. This is the case in the STRAPlite version.

The plugin command takes three arguments:
  1. The name of the Java-class
  2. One or several jar files
  3. A number of jar file names from previous versions, that are not used any more.

The action that is performed when the link is pressed depends on the interface that the plugin is implementing. For example, if the plugin is implementing SequenceAligner the alignment dialog will be opened and the plugin will be selected as the alignment method.

For convenient developing plugins, the Hotswap-dialog from the Plugin menu in STRAP can be used. It is visible if "advanced" is selected in the User-Profile.

Security of Plugins

Plugins could contain malware. The user receives a warning message, not to download a plugin if he does not trust the publisher of the plugin. Untrusted plugins should be tested in a Sandbox environment.

The language is not confined to Java. A plugin can wrap code written in other programming languages using the class AbstractExecutable.

Hello World Plugin

The jar-file HelloWorld.jar contains the class file HelloWorld.class. The two files Old1.jar and Old2.jar simulate files from previous versions. They are deleted so that they do not interfer with the current version. Since HelloWorld implements the interface StrapExtension it is registerd as a listener for events and its "run()"-method is executed.
  plugin HelloWorld , http://www.bioinformatics.org/strap/plugins/HelloWorld.jar     Run

Scripts for Plugins

Plugins can react on script lines that start with an asterisk. These are not evaluated by STRAP but are broadcasted to all objects implementing StrapListener. This is demonstrated with the following plugin which displays all script lines starting with an asterisk in a JTextArea:

  plugin DemoWebLinkControl, http://www.bioinformatics.org/strap/plugins/demoWebLinkControl2.jar, demoWebLinkControl1.jar     Run


When the following script line with an asterisk is send to STRAP it will be broadcasted in an event object. The plugin will receive the event and will print the script line in the JTextArea:

  *This line starts with an asterisk and may be evaluated by a plugin     Run


  *Here another command line     Run


Plugins that require libraries such as Biojava

The following Plugin needs Biojava. It requires the jars biojava.jar and bytecode.jar. These are given in the file download.txt in the jar-file demoBiojava4.jar.
  plugin DemoBiojavaCreateSequence3, http://www.bioinformatics.org/strap/plugins/demoBiojava4.jar     Run


In a previous plugin version, an earlier Biojava may have been used. To get rid of files that are not required any more, a file delete.txt in demoBiojava4.jar may be created which lists those URLs of previous versions that are not required any more. For more information see BioJava in STRAP plugins.