Introduce 1.3 Toolkit Developers
Introduce Project Layout
Below is a non exhaustive list of the directory structure of the Introduce project and what the important areas are that a developer of the Introduce project would want to be aware of.
- src - The project source tress are contained here .
- java - Java source tress are under here.
- Introduce - The core introduce, non gui, source code is here. This is where the Introduce engine exists and all it's components that are used in creating and resynchronizing a service.
- Portal - The Introduce Portal code lives here. This contains all the graphical components and tools used in the GUI that makes of the Introduce GDE.
- jettemplates - Java Emitter Templates are located here that are used for the templates that are created and used in generated code and configuration files for the services Introduce can generate.
- test - All unit test code and resources for testing such as build scripts, gold standards, etc, which are used in testing the introduce framework and the services it can create.
- conf - The conf directory contains the files that are used to configure Introduce's GUI and all of the components configuration files as well as log4j configuration.
- ext - This contains all resources that are inherited through the Ivy build system.
- dependencies/jars - all the libraryies that are resolved through the Ivy build system.
- dependencies/wsdl - all the wsdl documents that are required for Introduce generated service that are provided by other projects such as the service security provider project which provides introduce generated service with the standard security metadata operations.
- dependencies/xml - same as the wsdl directory except this is explicitly for schema that is provided to introduce by other projects which may be used in beans that introduce needs or wsdl data types that are inherited.
- skeleton - This is the orignal service skeleton that each Introduce service that is generated starts with. Introduce copies the contents of this directory to the new service directory they are creating and begins building on top of this. The directory contains the ant build scripts the service will use to build and deploy itself to a grid contianer as well as the basic directory layout that is going to be used for the service.
- extensions - The extensions directory is where each Introduce extension will deploy itself to in order for Introduce to detect it and enable its use. There will be a common lib directory in this directory that all extension share so they have to be careful not to create jar version collisions. Also there will be one directory with the exact name or the extension which is deployed there. In this directory will be the extension.xml which Introduce will read to learn what type of extension it is and what classes and configuration are required to run this extension.
- resources/Portal - Resource that the portal will want to load out of the classloader such as images and icons.
- schema - Introduce schema which defines the persistence models of the entire introduce generated service and for Introduce itself as well as its extensions. These schema are all used in generating beans that are used in the Introduce source code for manipulating the model of an Introduce generated service.
- antfiles - the build and run files that are required to run the introduce sychronization engine, creation engine, and the GUI.
Writing an Extension
When writing an extension it is first important to chose which type of extension that you want to write. A description of the extension framework and the important extension types is documented here. There are extensions that add functionality to introduce and there are extensions designed to add functionality to a service. The most common introduce extension type is the service extension. This type of extension is designed to add functionality to a service. The best place to learn about extension is just to look at one. Here are a list of the service extension that can be found in the cagrid repository that are great places to start.
- cagrid/projects/data
- cagrid/projects/cabigextensions
- cagrid/projects/gridgrouperAuth
- cagrid/projects/transfer
Every extension revolves around it's extension.xml. The extension.xml describes what type the extension is, and what are the classes that need to be invoked in order to execute the extension.
Bundling an Extension
In order to bundle up an extension so that it can be deployed to introduce the extension directory structure must be laid out in the following way:
- <top of zip file>
- lib (any jars required to "execute" your extension
- <your extension name (not display name)>
- extension.xml (the extension.xml describing your extension)
Once this layout is complete the next step is to create the extension zip file. In order to do this all that is required is to create a zip file with no top level directory and the lib dir and <your extension name> dir as the only directories in the zip. So for instance, if the zip file were extracted there would be the two directories with no top level directory. Now that you have bundled up your extension so that it can be delivered and used by Introduce.
Creating an Update Site
Providing an update site is one way to enable Introduce users to be able to obtain your extensions or modified versions of Introduce. An update site is simply an address which points to a web folder that contains a software.xml file adhering to the introduce/schema/Software.xsd schema. The software.xml file describes the packages available at the particular update site and the release zip which contains those packages
<ns1:Software
xmlns:ns1="gme://gov.nih.nci.cagrid.introduce/1/Software">
<ns1:Introduce version="1.0" zipFileURL="http://bmi.osu.edu/~hastings/introduce/software/introduce_1-0.zip" />
<ns1:Introduce version="1.1" zipFileURL="http://bmi.osu.edu/~hastings/introduce/software/introduce_1-1.zip" />
<ns1:Extension version="1.1" compatibleIntroduceVersions="1.1" displayName="caGrid Data Service Extension" name="data" zipFileURL="http://bmi.osu.edu/~hastings/introduce/software/data.zip"/>
<ns1:Extension version="1.1" compatibleIntroduceVersions="1.1" displayName="caGrid Bulk Data Transfer" name="bdt" zipFileURL="http://bmi.osu.edu/~hastings/introduce/software/bdt.zip"/>
<ns1:Extension version="1.1" compatibleIntroduceVersions="1.0,1.1" displayName="caGrid Extensions Package" name="cabigextensions" zipFileURL="http://bmi.osu.edu/~hastings/introduce/software/cabigextensions.zip"/>
<ns1:Extension version="1.1" compatibleIntroduceVersions="1.0,1.1" displayName="caGrid Cancer Data Standards Repository" name="cadsr" zipFileURL="http://bmi.osu.edu/~hastings/introduce/software/cadsr.zip"/>
</ns1:Software>