Skip to content

Getting started with BII code

eamonnmag edited this page Jul 6, 2011 · 2 revisions

Overview

The BioInvestigation Index (or BII) encompasses code for:

  1. the BII web application (example instances can be seen at http://www.ebi.ac.uk/bioinvindex/ and http://discovery.hsci.harvard.edu/bioinvindex/) powered by JBoss Seam,
  2. the **database model, database persistence & database access objects (DAOs) **powered by Hibernate,
  3. Index creation powered by Lucene; and
  4. web services.

Getting started You need: A Database (e.g. MySQL, PostgreSQL, Oracle) | Maven 2.2.1 | JBoss AS 4.2.3.GA

Before you do anything, you should make sure you have these components downloaded!

, whereas JBoss AS (application server) is what you will need to run the web application.

What is Maven? The project relies on many dependencies, has many tests and needs to be easy to build. Maven is used to control the project dependencies, run tests and perform software life cycle operations. We suggest that you download version 2.2.1 (http://maven.apache.org/download.html) of the Maven project. We have noticed some inconsistencies in version 3.1 of Maven and we haven't throughly tested it yet, so it's better to go with 2.2.1 for now.

What is JBoss? JBoss is the application server (much like Apache Tomcat) we use to host the web application which is built using Enterprise technologies (JavaEE).

Setting up Profiles.xml When you check out the code, you will see that there is a file in the top level directory called profiles.xml.distro. You should copy this file and rename is as profiles.xml. Then, find the database profile suitable for you (MySQL, PostgreSQL, H2 or Oracle) and edit the profile to include the proper database connection url, username and password. Further to this, you need to configure where you Lucene index will be located (Lucene indexes make searching quicker). To do this, find the profile named index_local and edit the path to go to your preferred location. You should copy this file and place it in the EAR folder as well. We hope to remove this redundant operation soon!

Building from source

To build from source, go into the trunk directory (or top level directory of the checked out code) and run the following command, replacing h2 with your database profile:

mvn clean package -Dmaven.test.skip=true -Pdeploy,h2,index_local

Briefly put, this line tells maven to clean the current target folders (the place where the maven builds go), then package up the EAR (Enterprise Archive, it's like a WAR, only the enterprise version :)) to give you your web application. The option -Dmaven.test.skip=true tells Maven to skip the tests, since it should have been tested beforehand, and the last parts tells Maven which build profiles to use. In the example above, I've told maven to build the application using the deploy (to build the ear), h2 database and the index_local profiles.

When the maven package goal runs, it should complete (hopefully with no errors) and inside the ear/target directory, you will have a bii-<>.ear file. Copy this to the server/default/deploy directory of your JBoss installation and then start your JBoss server to hopefully see a BII web front end!

Clone this wiki locally