Metware developers
This page is intended to contain information for developers on the Metware project.
Contents
SVN
To check out the latest version of the Metware code, use:
svn co https://metware.svn.sourceforge.net/svnroot/metware metware svn co http://metware.svn.sourceforge.net/svnroot/metware/MetBeans/trunk MetBeans svn co http://metware.svn.sourceforge.net/svnroot/metware/BigMet/trunk BigMet svn co http://metware.svn.sourceforge.net/svnroot/metware/MetWeb/trunk MetWeb
Requirements
- Java version 1.5
- PostgreSQL
- Tomcat version 5.5.25
- ANT 1.7.0
Libraries
There are a bunch of libraries necessary to compile everything, here a short list:
- Xerces (xercesImpl.jar) for XML-parsing
- Servlet API (servlet.jar) shipped with Java EE/Tomcat/WebLogic
Installation
The following steps have to be made to install Metware on your system:
- Download the latest stable version of Metware (via SVN)
- Database setup
- Tomcat setup
- Several modules have to be compiled:
- 1. BigMet
- 2. MetBeans
- 3. MetWeb Core (.WAR creation)
- 4. MetDriver
Database setup
When PostgreSQL is installed you can make use of the tool createdb to create the database for Metware. If you run into problems, you might take a look at the PostgreSQL createdb tutorial
- Create the database
-
#createdb metware_db
- Import SQL dump from file in Metware directory into PostgreSQL
-
#psql metware_db < metware/BigMet/trunk/onto/metware.sql
Tomcat setup
You will need the PostgreSQL JDBC drivers, located in tomcat/common/lib for any database connectivity. The driver can be downloaded from http://jdbc.postgresql.org/
Furthermore you have to add the connection information to the Tomcat-configuration file, which is often located in a directory like /etc/tomcat/server.xml. There should be added a section (replace the following variables; $metware_db=database name, $metware_user=database user, $metware_host=url to machine)
<Resource name="jdbc/$metware_db" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="$metware_user" driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://$metware_host:3306/$metware_db"/>
1. Compiling & Installing BigMet
- Step into the Bigmet trunk directory
-
#cd metware/BigMet/trunk
- Use ANT to compile the source code (might be necessarry to pass the location of Xerces), it will automatically look for the build.xml file and try to compile the Java sources
-
#ant -DxercesImpl.jar=path/to/java/lib/xercesImpl.jar -Dsqltarget=pgsql
If everything goes fine, you should see a succesful build
Buildfile: build.xml
compileSQLGenerator:
checkXerces:
[echo] Xerces2 found: true
runSQLGenerator:
[java] Creating SQL for MySQL...
[java] SKOSifying: src/main/onto/metware.skos
[java] Found file.
build:
jarLibrary:
make:
BUILD SUCCESSFUL
Total time: 0 seconds
The next step is installing the compiled JAR and documentation into a directory (default is /usr/local/)
-
#ant install -Dprefix=/usr/local
If everything goes fine, you should see a succesful installation (something like this)
Buildfile: build.xml
install:
[echo] Installing in: /usr/local
[mkdir] Created dir: /usr/local/share/doc/metware/bigmet
[copy] Copying 3 files to usr/local/share/doc/metware/bigmet
[mkdir] Created dir: /usr/local/share/doc/metware/bigmet/onto
[copy] Copying 3 files to /usr/local/metware/bigmet/onto
[copy] Copying 1 file to /usr/local/share/java
BUILD SUCCESSFUL
Total time: 0 seconds
2. Compiling MetBeans
- Step into the MetBeans trunk directory
-
#cd metware/MetBeans/trunk
- Use ANT again to compile the source code (might be necessarry to pass the location of Xerces), it will automatically look for the build.xml file and try to compile the Java sources (default directory is /usr/local)
-
#ant -Dprefix=/usr/local -DxercesImpl.jar=path/to/java/lib/xercesImpl.jar
If everything goes fine here too, you should see a succesful compilation
Buildfile: build.xml
compileBeanGenerator:
checkXerces:
[echo] Xerces2 found: true
runBeanGenerator:
[java] SKOSifying: /usr/local/share/doc/metware/bigmet/onto/metware.skos
[java] Found file.
[java] Found an addon 'metid_metabolites_addon_pubchem' for 'metid_metabolites'.
[java] Processing table: metchar_putative_metabolites_identities
[java] Creating java file for MetcharPutativeMetabolitesIdentitiesBean...
[java] Creating JUnit java file for MetcharPutativeMetabolitesIdentitiesBeanTest...
[java] Creating java file for MetcharPutativeMetabolitesIdentitiesQueryBean...
(...etc...)
compileLibrary:
[javac] Compiling 58 source files to /home/username/metware-metbeans-0.3/build
jarLibrary:
[jar] Building jar: /home/username/metware-metbeans-0.3/metware-metbeans.jar
javadoc:
[javadoc] Generating Javadoc
[javadoc] Javadoc execution
[javadoc] Loading source files for package net.sf.metware.beans...
test:
[junit] Running net.sf.metware.BeansTestSuite3
(...etc...)
BUILD SUCCESSFUL
Total time: 6 seconds
3. Compiling MetWeb Core (.WAR creation)
- Step into the MetWeb Core directory
-
#cd metware/MetWeb/Core
- Use ANT again to compile the source code (might be necessarry to pass the location of Xerces and the Servlet API), it will automatically look for the build.xml file and try to compile the Java sources (default directory is /usr/local)
-
#ant -Dprefix=/usr/local -DxercesImpl.jar=path/to/java/lib/xercesImpl.jar -Dservlet-api.jar=/path/to/lib/servlet.jar
If everything goes fine here too, you should see a succesful compilation (the actual output will be much longer, but just to give you an indication):
Buildfile: build.xml
compileFacesConfigCreator:
runFacesConfigCreator:
[java] SKOSifying: /usr/local/share/doc/metware/bigmet/onto/metware.skos
[java] Found file.
[java] Processing table: metchar_putative_metabolites_identities
(...)
[java] Processing table: metmeta_sample
compileSessionBean:
compileJSFGenerator:
checkXerces:
[echo] Xerces2 found: /var/lib/tomcat5/webapps/axis/WEB-INF/lib/xercesImpl.jar
runJSFGenerator:
[mkdir] Created dir: /home/user/metware/MetWeb/Core/WebContent/metraw
[mkdir] Created dir: /home/user/metware/MetWeb/Core/WebContent/metmeta
[java] Creating SQL database ${metwaredbname}...
(...)
[java] SKOSifying: /home/user/metware/share/doc/metware/bigmet/onto/metware.skos
[java] Found file.
war:
[war] Building war: /home/user/metware/MetWeb/Core/Core.war
build:
BUILD SUCCESSFUL
4. Compiling MetDriver
- Step into the MetDriver trunk directory
-
#cd metware/MetDriver/trunk
- Use ANT to compile the source code (might be necessarry to pass the location of saaj), it will automatically look for the build.xml file and try to compile the Java sources
-
#ant -Dsaaj.jar=path/to/java/lib/saaj.jar
Metware modules
- BigMet
- This module contains the MetWare ontology and SQL design
- MetBeans
- Java Beans library to interact with SQL database
- MetFlow
- MetDriver
- MetWeb
- The HTML-based GUI to the datawarehouse
- MetRAW
- mzMLEditor
- ProtoRAW
- the prototype storage facility (currently Python based)
Eclipse EE setup
Download Eclipse EE from Eclipse.org (Europe) and start Eclipse.
Get the important modules via SVN:
svn co https://metware.svn.sourceforge.net/svnroot/metware/BigMet/trunk BigMet svn co https://metware.svn.sourceforge.net/svnroot/metware/MetBeans/trunk MetBeans svn co https://metware.svn.sourceforge.net/svnroot/metware/MetWeb/trunk MetWeb
Import the three modules, one by one, by choosing File -> Import -> General -> Existing Project into Workspace, and select as root folder the BigMet and MetBeans folders created in the svn co commands. Also import the Core/ folder from the MetWeb checkout.
Be sure the Build Path is also set correctly by right-clicking on the MetBeans project (which launches Properties). Then select Java Build Path and click on the Projects tab. From there on add BigMet and Core to the Build Path.
Developer tools and reference documentation
Miscellaneous
- Metware pastebin
- Metware IRC logs
- IRC: /join #metware
- PGAdmin tunnel:
ssh -L 5432:localhost:5432 username@wsx.grid.sara.nl
then connect from PGAdmin to localhost port 5432 to use the tunnel.