under construction
Explain:
IGB bundles are OSGi compatible, so they must have an Activator, a class that extends org.osgi.framework.BundleActivator, and they must have a manifest.mf file that is found in the META-INF directory. These are compiled and jarred with all required classes, jars, and resources. The resulting jar is the bundle. This can then be uploaded to the bundle repository. At that point, any one can use the bundle with IGB. IGB uses the Apache Felix OSGi implementation, but this could change, so no Felix specific code should be used. In the Activator class, there is a start() and stop() method that are called when the bundle is activated / deactivated (not installed / uninstalled). This is where you want to put all the code to start and stop the bundle.
In the manifest.mf file, there are several headers that need to be specified - fill in parenthesis below:
Manifest-Version: 1.0 |
Ann's note: the formatting below is weird. Did you copy and paste from an email message?
If you look at the Plug-ins tab, you will see the Bundle-SymbolicName under the Name column, the Bundle-Description under the Description column, and the Bundle-Version under the Version column. If the Bundle-DocURL is there, the Name cell will have a blue info icon that links to this URL.
Eclipse (http://www.eclipse.org) makes it a lot easier to develop bundles. You can create a new project
as a plug in project, and it will give you wizards, etc. for development. see:http://www.vogella.de/articles/OSGi/article.html
(using eclipse Helios)
Ann's note: Please add a tutorial explaining how to develop a simple plug-in. Your graph plug-in is probably a good place to start. We need a very simple but cool example that relies on a stable part of the API so that the tutorial doesn't get out of date.)
In the Project Explorer - blank area, right-click
New > Project ... > Plug-in Project > "Next >" button
Project name: "HelloWorld" > "Next >" button
Version: "1.0.0" check "Generate an activator ...",
Activator "helloworld.Activator", Rich Client Application click "No",
"Next >" button
Uncheck "Create a plug-in using one of the templates", "Finish" button
Under the new HelloWorld project, find the META-INF directory, and open
the MANIFEST.MF file by double-clicking on it.
Click on the "Dependencies" tab,
in the "Required Plug-ins" box,
highlight org.eclipse.core.runtime, and click the "Remove" button on the right.
next to the "Imported Packages" box, click the "Add..." button, int
the "Package Selection" popup in the text box, enter "com.affymetrix.genoviz.util"
and click the "OK" button. Do the same for "org.osgi.framework" (there may be
a version number in parentheses after the name).
Right click on the blank area at the top, next to "Dependencies" and
a context menu comes up, click "Save".
Open the Activator.java file under src/helloworld, add the import statement
import com.affymetrix.genoviz.util.ErrorHandler;
at the top, and add the line
ErrorHandler.errorPanel("Hello World");
at the end of the start() method, and
ErrorHandler.errorPanel("Goodbye World");
at the end of the stop method
Save the file
In the Project Explorer, Right click the HelloWorld project, > "Export ..."
"Deployable plug-ins and fragments", "Next >" button,Under "Available Plug-ins and Fragments:", check only
Hello World, "Directory:" use any directory you like. click the "Finish" button.
The HelloWorld_1.0.0.jar file will be in the plugins directory under the directory the you specified. This is your bundle
In the plugins directory, from the command line run
java -cp IGB_HOME/igb_server/lib/bindex.jar -jar bindex.jar -n IGB -q -r repository.xml .
where IGB_HOME is your IGB directory.
Now, if you can access your plugins directory from a local web server, you can open up the Plug ins tab
in IGB, and click on the "Repositories..." button on the lower right. Click the "Add..." button, and put the
URL for your local plugin directory. Click the "Add Server" button, then close the Preferences popup. Now,
uncheck and recheck the "Show Uninstalled" checkbox at the bottom of the Plug ins tab. You should now
see your Hello World plugin. If you install the plugin you will see an Error popup "Hello World". When you uninstall
the plugin, you will see an Error popup "Goodbye World". Congratulations!
Is this possible? Easy?