...
- Plugins are software programs that can be dynamically added to existing programs to add / enhance the functionality.
- They are also called Add-ons or Bundles (the OSGi term).
- You may have seen plugins in the software that you use, Internet browsers, text/graphics editors, games, etc.
- Examples include Adobe Flash and Adobe Reader for browsers, and countless Photoshop filters.
- Users can search for plugins and choose ones that address their needs.
- The user Users can add the a new plugin (download and install) whenever they want.
- They can remove a plugin if they no longer need it.
- The plugins can also be updated dynamically when the author(s) make changes.
...
- The java standard for Plugins is OSGi (http://www.osgi.org), this is what IGB (written in java) uses.
- the The OSGi term for a Plugin is Bundle, they mean the same thing.
- an An OSGi bundle is a jar file. It must have a MANIFEST.MF file with the OSGi headers (see below).
- an An OSGi bundle can (usually will) have a special java class called an Activator. This class must extend
org.osgi.framework.BundleActivator
, and implement thestart()
andstop()
methods. The activator class is specified in the Bundle-Activator MANIFEST.MF header (see below). These methods are called when the bundle is started and stopped. - when When a program is running with OSGi, the OSGi framework dynamically handles installing / uninstalling,
activating (starting), deactivating (stopping), and upgrading bundles. - OSGi caches bundles, saving them to a directory on the local hard disk, so that they don't need to be downloaded every time. So you can work offline after you have loaded IGB. If, for some reason, you need to clean out the bundle cache, you can run
ant cbc
(clear bundle cache). - There are several implementations of OSGi, including:
- Apache Felix (http://felix.apache.org/)
- Eclipse Equinox (http://www.eclipse.org/equinox/)
- Knoplerfish (http://www.knopflerfish.org/)
- the implementations are (for the most part) interchangeable and are free
- the implementations allow the user to run OSGi from a command line tool or to start it within a program
- IGB starts the felix implementation from within the com.affymetrix.igb.main.OSGiHandler class, but IGB can
be run using the Felix command line tool by runningant gogo
- there are several tutorials for OSGi, including:
- How to get Started with OSGi (http://www.osgi.org/About/HowOSGi)
- Apache Felix OSGi Tutorial (http://felix.apache.org/site/apache-felix-osgi-tutorial.html)
- OSGi for Beginners (http://www.theserverside.com/news/1363825/OSGi-for-Beginners)
- OSGi with Eclipse Equinox - Tutorial (http://www.vogella.de/articles/OSGi/article.html)
- IGB uses OBR (http://felix.apache.org/site/apache-felix-osgi-bundle-repository.html) to find and load bundles from web servers (repositories). The web servers need to use OBR to create the repository.xml file listing all the available bundles.
- Users can add / remove bundle repositories by choosing File>Preferences page, Plugin Repositories tab.
- IGB uses OSGi Services to allow bundles to add new implementations of existing IGB elements. The new implementations will show up as soon as the bundle is started. Examples include IGB tabs and graph manipulation functions.
...
- Check out IGB from https://genoviz.svn.sourceforge.net/svnroot/genoviz/trunk into a new directory - we will refer to the project directory below as IGB_HOME.
- open a command prompt in IGB_HOME, run "svn co https://genoviz.svn.sourceforge.net/svnroot/genoviz/trunk"
- in eclipse, project explorer, "File>Import"
- in the Import popup, under "General", select "Existing Projects into Workspace"
- "Next >" button
- make sure "Select root directory:" is selected, and fill in the IGB_HOME directory
- click the "Finish" button Ann's comment: I followed the directions exactly, even checking an all-new copy of genoviz-trunk into a newly created directory (I called it IGB_HOME) but Eclipse refused to let me proceed, showing an error message on the "Import" window that syas "Some projects cannot be imported because they already exist in the workspace." I got it to work only after I deleted another copy of the IGB project. Is it not possible to have to separate IGB projects on the same computer without Eclipse causing a problem? I need to be able to develop on branch and the trunk checked out into different locations. How do I do this?
- Open a command prompt in IGB_HOME, and do an "ant clean" and "ant jar"
- Make sure Eclipse is displaying the Project Explorer Tab. (If not, click View>Show View>Project Explorer.)
- In eclipse, Project Explorer, right click the IGB project and select "refresh."
- in eclipse, Project Explorer, right click on open space, and select "Import..." Ann's comment: When I did this, I did not see a folder labeled "Plug-in Development." Is this something unique to how your Eclipse is set up? I did a Web search for "Helios" - is that what I need to develop a plug-in? I tried using the "Install New Software" option under the "Help" menu in Eclipse, but there were so many options I had no idea what to choose. Please give more details. ## Select "Plug-ins and Fragments" under "Plug-in Development", click the "Next >" button
- under "Import From", select "Directory:",
- under "Plug-ins and Fragments to Import" select "Select from all plug-ins and Fragments",
- under "Import As" select "Binary Projects"
- for "Directory:", click the "Browse..." button and select the IGB_HOME/ext, click the "OK" button
- click the "Next >" button
- under "Plug-ins and Fragments Found:", select affx_fusion, colt, freehep, image4j, jlfgr, picard, and sam
- click the "Add -->" button to add these all to "Plug-ins and Fragments to Import:", click the "Finish" button
- Do the following for the directories under IGB_HOME, genometryImpl, common, genoviz_sdk, igb, plugins/igb_service, plugins/window_service
- in eclipse, project explorer, right click on open space, and select "Import..."
- Select "Existing Projects into Workspace" under "General", click the "Next >" button
- click "Select root directory:" and click the "Browse..." button on the right
- select the project folder under IGB_HOME, and click "OK"
- click "Finish"
- note - you will find it easier to debug in eclipse if you use the Debug project. You can add the Activator for your bundle (whatever one you are developing) in com.affymetrix.igb.debug.Debug, in the static statement at the top. Choose Run>Debug>Debug As Then on Debug, you can "Debug As" "Java Application", and
this will run IGB using a dummy OSGi implementation, so that you can easily step through code, set breakpoints, etc. Please explain in more detail.- import the "debug" project
- The benefit of this is that Eclipse will be able to compile as you go.
- right-click Debug Configure Build Path ,c change it to always put every resource path
Sample plug-in using eclipse
...