Table of Contents

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:

<extensionList baseURL="http://svn.greenstone.org/gs3-extensions/">
  <extension>
    <name>Metadata Quality Tool</name>
    <group>Java / Web</group> 
    <fileStem>mat</fileStem>
    <description>
      ...
    </description>
    <sequenceList>
      <step id="installOptions" action="properties" label="Install options" dependsOn="AUTOMATIC_DOWNLOAD">
	<optionList id="Mat" label="Mat options">
	  <option id="User_Name" label="User name"/>
	  <option id="Password" label="Password"/>
	  <option id="Tomcat_Port" label="Tomcat port"/>
	  <option id="JVM_Version" label="Java Virtual Machine version"/>
	</optionList>
      </step>
      <step id="install" action="button" label="Install" dependsOn="installOptions">
	<command>
	  <os name="default">ant compile</os>
        </command>
      </step>
      <step id="controlPanel" action="panel" label="Control Panel" dependsOn="install">
	<class>org.greenstone.admin.guiext.mat.ControlPanel</class>
      </step>
      <step id="uninstall" action="button" label="Uninstall" dependsOn="install" rollbackTo="install">
	<command>
	  <os name="default">ant clean</os>
	</command>
      </step>
    </sequenceList>
  </extension>
  ...
</extensionList>

Basic extension information

Firstly you will want to go to the bottom of the file (one line above the </extension_list> tag) and create a new set of <extension> tags for your extension's information to reside within. Within these tags you will want to include the following tags:

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 <step> elements within a <sequence_list> element. The order of the <step> elements specifies the order in which the buttons will be displayed. Each <step> element should have the following attributes:

A step can also have two more optional attributes:

Actions

There are five types of <step> 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 <step> element can contain the following elements:

Properties

A properties step can be used to store user specified values in a properties file. A properties <step> element can contain:

Button

A button step performs one or more of two types of commands. A button <step> element can contain as many commands as necessary but needs to contain at least one. The two types of command are represented by two different elements:

Panel

A panel step allows you to display a Java panel within the extension manager. The Java class that displays the panel must implement the org.greenstone.admin.guiext.BasePanel interface. Like the <callback> code, this class needs to be within guiext.jar which should be located at the top level of your extension's folder.

<class>: Between <class> tags you specify the name of the class that implements the BasePanel interface that will be shown within the extension manager (e.g., <class>org.greenstone.myextension.MyControlPanel</class>).

Remove

Currently the only functionality provided by remove steps are to delete the directory of this current extension. Like download steps, if one of these is not specified as the last step then one is automatically created.