This directory contains design, documentation, and development materials associated with the SEEK EcoGrid (ecogrid).


Building the GAR file

The build.xml file can be used to build the Metacat Ecogrid implementaion gar file.

Overview
First you build the gar using the command "ant gar",  the gar file will be created in the directory build/lib directory, then you may deploy it to globus toolkit or tomcat.

Detailed steps for building the GAR File from scratch:
You may modify the build file build.xml to create your own ecogrid implementation. The main steps are:

1. Create a directory under src/ecoinformatics/ecogrid and put the implementaion source code there.

2. Put the lib files (e.g. jar files) into lib directory.

3. Modified the build.xml. The main property you need changes are:

impl.package.dir the directory to put your implementation source code
impl.package.name the package name of your implementation
impl.class.name the class name of your implementation
baseURL the base url which your service will be deployed.
clientProxyURL as same as baseURL
service.name service name in service container
service.instance instance name created by service factory


Detailed steps for building the GAR File by pulling the source code from the SEEK repository:

The main steps are (assume the user is "foo"):

1. First you must build Metacat. The best thing to do is to pull the source code directly from the SEEK repository.
Location org.ecoinformatics.org/cvs
Pull: cvs co -P metacat
To build Metacat you may also need to pull the utilities directory

2. Pull the source from SEEK under seek/projects/ecogrid
Location org.ecoinformatics.org/cvs
Pull: cvs co -P seek/projects/ecogrid

The build file will be:
/home/foo/seek/projects/ecogrid/src/build.xml

The implementation will be in:
/home/foo/seek/projects/ecogrid/src/ecoinformatics/ecogrid

3. Modified the build.xml. The main properties you need changes are:

Property Name
 Description
Example Value
impl.package.dir The directory to put your implementation source code
Note: This is the directory where the source of the metacat implementation must reside. But the value is relative to the "src" directory, not relative to the directory where build file is located.
org/ecoinformatics/ecogrid/metacat/impl
impl.package.name The package name of your implementation
org.ecoinformatics.ecogrid.metacat.impl
impl.class.name The class name of your implementation MetacatImpl
baseURL The base url which your service will be deployed. http://localhost:8080/ogsa/services
clientProxyURL As same as baseURL http://localhost:8080/ogsa/services
service.name Service name in service container metacat
service.instance Instance name created by service factory
Note: This needs to point to the metcat directory, where ever it is that you pulled or built it etc.
../../../metacat


What should we do if we need to update resultset.xsd and/or query.xsd?

Because there are some bugs in AXIS, some stub files which automatically generated could NOT match the schema. So we had to modify the stubs files manually. The modified stub files are: ANDType.java, ORType.java and AnyContentType.java. In cvs, those files have correct implementation.

So if you change something in resultset.xsd and query.xsd which has no relation to the three java files (in schema they are AND, OR, and AnyContent complextTypes), you could NOT commit the changes of those three java file to CVS. You should delete the modified copy and check out the cvs newest version for them. The other java files can be checked into cvs.

If you change something about those three files, you should merge the new copy and cvs version before you commit the file.

Deploying the GAR

IMPORTANT: If you have already deployed into GLOBUS
If you have already deployed into Globus, you should first "undeploy":
ant undeploy -Dgar.id=org
(The org is prefix of file name in gt3/undeploy/org-undeploy.xml)


Deploying
To deploy the EcoGrid Metacat GAR file you MUST deploy it into both Globus and Tomcat.


First, deploy the EcoGrid Metacat GAR file into Globus:

Change directory to the root of your globus installation (this would be your $GLOBUS_DIRECTORY env. var.)
Execute the following command:
cd $GLOBUS_DIRECTORY
ant deploy -Dgar.name=/home/foo/seek/projects/ecogrid/build/lib/org.ecoinformatics.ecogrid.EcogridSoap.MetacatImpl.gar


Then deploy into Tomcat:

IMPORTANT: Before deploying into Tomcat make sure the mime-types have set up correctly for gt3:


cd $CATALINEA_HOME
vi conf/web.xml


Add these line anywhere in the file:
<mime-mapping>
   <extension>gwsdl</extension>
   <mime-type>text/xml</mime-type>
</mime-mapping> <mime-mapping>
   <extension>wsdl</extension>
   <mime-type>text/xml</mime-type>
</mime-mapping> <mime-mapping>
   <extension>xsd</extension>
   <mime-type>text/xml</mime-type>
</mime-mapping>

Now deploy into Tomcat:

ant deployTomcat -Dtomcat.dir=yourtomcathomedir


IMPORTANT: When you try to deploy services to Tomcat, the old server-config.wsdd in tomcat/webapps/ogsa/WEB-INF will NOT be overwritten by a new version of it. This will cause problems and the new service will not be found.

To fixed this we have two options described below:

OPTION #1:
The first approach is to run "ant redeployTomcat":
cd $GLOBUS_DIRECTORY
ant reDeployTomcat -Dgar.name=/home/foo/seek/projects/ecogrid/build/lib/org.ecoinformatics.ecogrid.EcogridSoap.MetacatImpl.gar

"ant reDeployTomcat" will delete everything in $tomcat/webapps/ogsa and then copy them from gt3, but "ant deployTomcat" doesn't delete the files before copying. So "ant redployTomcat" will make sure the server-config.wsdd file will be updated.

NOTE: Sometimes we don't want delete everything in ogsa directory, so option #1 will not work. (We have to use "ant deployTomcat", see the second option below.)


OPTION #2:
If you must use the "ant deployTomcat" and modify the build-services.xml file in gt3 home directory. (Don't forget make a backup copy before you modify it)

In the target named "deployWebapp", add a parameter - overwrite="yes" in the third copy command. The lines will look like:

<copy toDir="${webapps.dir}/ogsa/WEB-INF/" overwrite="yes">
  <fileset dir="./" casesensitive="yes">
    <include name="*.wsdd"/>
  </fileset>
</copy>

Note: the only thing we changed is adding a overwrite="yes" in copy command.

cd $GLOBUS_DIRECTORY
cp build-services.xml build-services.xml.bak
vi build-services.xml 
(change as described above)
ant deployTomcat -Dtomcat.dir=yourtomcathomedir