This article demonstrates the IGB plug-able architecture using a simple example plugin that adds a menu item to the IGB Tools menu.
IGB runs within an OSGi framework, also called an OSGI "container" or "runtime." This means you can extend IGB without modifying the core IGB code base. By implementing a few well-described interfaces and using the Apache maven project management tool, you can add new menu items, create new kinds of tracks, or connect IGB to all-new data sources - all without re-installing or even re-starting IGB.
This tutorial introduces the IGB platform by demonstrating a very simple IGB App that adds a new entry to the IGB Tools menu.
Clone the IGB Hello World App project - this contains complete, working example of the Hello World IGB App:
git clone https://bitbucket.org/lorainelab/igb-app-hello-world.git |
To build your App, open the igb-app-hello-world project into Netbeans, select the project in the Projects tab, and then select Run > Build.
Alternatively, you can build it from the command line by entering:
mvn clean install |
Building the App will create a new directory named "target" which can serve as a new App repository. This new directory contains compiled code as well as a meta-data about the App it contains.
Normally, Apps are deployed on-line via an App Store or your own on-line App repository.
However, you can also deploy an App Store on your local computer - useful for developing and testing new Apps.
To add your target directory as a local App Store:
Once you add "target" as a new local App store, you should see the Hello World App added as a new App in the IGB App Manager window, as show below:
To install the hello world App:
To check that installation worked correctly, select the Edit menu. Check that there is now a new menu item named Hello World App.
To run the App:
Observe the message that appears:
Open the IGB App project in Netbeans. Edit the message your IGB App prints and re-build your App. Then, return to the IGB App Manager, un-install and then re-install your App. When you select the the menu item again, the new message will print instead of the old one.
Note that you can rapidly repeat this edit-build-uninstall-install cycle. You don't have to re-build IGB or even restart it, which makes development much faster than if you had to modify the IGB code directly.