How To Write a MAEPlugin using the Open java API
MAExplorer |
MAEPlugin home |
Design |
Open Java API |
MJA classes |
MJA javadocs |
Open Java API javadocs |
Plugin Tutorial Examples |
List of Plugins |
Developing a Plugin |
Installing Plugins |
MAExplorer home |
MAExplorer revision notes |
Help desk
|
This document briefly describes how to write MAEPlugins using the MJA
Open Java API (Application Programming Interface). It discusses key
issues to be addressed when writing a MAEPlugin and describes in
sufficient detail to enable researchers to write their own MAEPlugins
for use with MAExplorer. Note that there are basically two types of
plugins: those which are one-shot plugins (e.g., popup a window with
its own user interface or perform an operation one time), and pipeline
operations. The latter include FilterPlugins and
NormalizationPlugins. These are inserted by MAExplorer into the gene
filtering chained intersection analysis and the normalization
analysis. See examples of existing plugins to help understand the
differences.
1. Using a Java development environment to develop and debug a Plugin
We have designed the MAExplorer.jar file so that it contains both
MAExplorer and the Open Java API. All MAExplorer classes are compiled
with the symbol table so that it may be used in a debugger. We use the
Sun's Forte for Java (Community
Edition) which is a free development environment (IDE) available over
the Internet. Forte (now known as "SunONE" and most other IDEs) allows
you "mount" a jar file. So to create a new plugin you would:
- Create a new project directory (e.g., see the
ExamplePlugin source code example and discussion).
- Copy some example MAExplugin code into this project and rename the
modules and classes to correspond to the names of your new plugin.
- Mount the MAExplorer.jar file (you can mount it from the directory
where you installed MAExplorer (eg. typically
C:/Program Files/MAExplorer/MAExplorer.jar for Windows, etc.)
- After you have compiled your plugin and want to test it, you create a
new Jar file with the name of the plugin (e.g. ExamplePlugin.jar) from the
file browser. Forte lets you create jar files with with a jar packager tool.
- To test it, you first open the MAExplorer.jar file tree you have mounted.
Then you select "MAExplorer". At this point you can execute MAExplorer or run
the debugger.
- After MAExplorer is running, you select "Load Plugin" from the MAExplorer
Plugins pull-down menu, and then enter the name of the plugin (e.g.
ExamplePlugin.jar).
- At this point you may run the plugin by going back to the Plugins menu
and select the entry corresponding to your plugin.
- If you want to make a change in your plugin and try again, you do not
need to restart MAExplorer. Instead first unload your plugin using the
"Unload Plugin" command in the Plugins menu. Then rebuild your plugin,
use "Load Plugin", and try again.
2. Installing your MAEPlugin in a working MAExplorer environment
- After you are happy (or somewhat happy) with your plugin, copy
the plugin jar file (e.g. ExamplePlugin.jar) to the installation
Plugins/ directory where you can access on any of your MAExplorer
database(s) (e.g., C:/Program Files/MAExplorer/Plugins for
Windows, etc.)
- To use the plugin on any database, just start MAExplorer and then
load and run the plugin as above.