====== Deploying New Extensions for Greenstone3 ======
===== Overview =====
Deploying extensions is now a relatively simple task in Greenstone, thanks to recent updates to the extension manager system in GAI (The Greenstone Administrator Interface). In order to make your extension available to the world of Greenstone users, you must first edit the //extension_project_list.xml// file located in http://svn.greenstone.org/main/trunk/greenstone3/ext/ (this tutorial assumes you are an experienced SVN user). In the //extension_project_list.xml// file you can define how users download, install and run your extension. This file is read by the GAI extension manager when it is run and creates the necessary buttons for each of these steps.
For reference, here is an example of an extension entry in the extension file:
Metadata Quality ToolJava / Webmat
...
ant compileorg.greenstone.admin.guiext.mat.ControlPanelant clean
...
===== Basic extension information =====
Firstly you will want to go to the bottom of the file (one line above the tag) and create a new set of tags for your extension's information to reside within. Within these tags you will want to include the following tags:
* ****: Between these tags you include the name of your extension (e.g., Example Extension).
* ****: Here you write the name of the group of extensions that you want your extension to belong to (e.g., Example Group), this affects where your extension will be placed in the extension tree view in the extension manager.
* ****: This indicates what folder the extension will be downloaded to within the //ext// directory within Greenstone 3. Also if your first (discussed later) does not have a download action then one is automatically created by combining the base URL (specified as an attribute in the element at the top of the file) with this value (for example, if the base url is "http://svn.greenstone.org/gs3-extensions/" and the file stem value is "mat" then the resulting URL will be "http://svn.greenstone.org/gs3-extensions/mat". A good guideline for deciding on this value is to use an abbreviated version of the extension name without spaces (e.g., "mat" rather than "Metadata Analysis Tool").
* ****: This is what users will see when they initially select your extension in the extension manager. You may want to include details such as: what does this extension do? who would find this extension useful? are there any software/hardware prerequisites for this extension?
===== Steps =====
==== Attributes ====
After this information you create each of the buttons available in the extension manager (e.g., Download, Install, Remove etc.). These are specified as a series of elements within a element. The order of the elements specifies the order in which the buttons will be displayed. Each element should have the following attributes:
* **id**: This is the internal name for this step. It is used to control dependencies (e.g., the installation step depends on the download step), see "dependsOn" and "rollbackTo" for more details.
* **label**: This attributes defines what text will be written on the button that corresponds to this step.
* **action**: This can be one of five different values: "download", "properties", "button", "panel" and "remove". These are discussed later.
A step can also have two more optional attributes:
* **dependsOn**: This attribute defines the id(s) of the step(s) that must be executed before this step is enabled. More than one value can be specified by separating each step id with a comma. Because you cannot specify the id of a download or remove button that is automatically created the ids "AUTOMATIC_DOWNLOAD" and "AUTOMATIC_REMOVE" respectively can be used to depend on these automatic steps.
* **rollbackTo**: This attribute can be used to remove dependencies back to a specified step (for example, after an uninstall step you may wish to disable all steps that depend on the program being installed which could be achieved by rolling back to the install step). More that one step id can be specified in this attribute by separating each id with commas.
==== Actions ====
There are five types of elements and they are as follows:
==== Download ====
A download step can be used to download something from the Internet. As discussed earlier, a download step is expected to be the first step in the list of steps. If the automatic download button is not sufficient for your needs then by specifying your own download step as the first step the automatic button is no longer created. A download element can contain the following elements:
* ****: A download step must contain one of these elements. The URL for this resource is placed between the tags. It also requires a "method" attribute to specify how to obtain this resource. Here is what the element would look like in the example file above: http://svn.greenstone.org/gs3-extensions/mat/trunk/
* ****: These are exactly the same as a element except that there can be more than one of them and they can contain a "folder" attribute that specifies the folder for this download to be put into.
=== Properties ===
A properties step can be used to store user specified values in a properties file. A properties element can contain:
* ****: elements are used to group together sets of