#!/bin/sh

# Get BioLegato environment variables.
if [ -f $BIRCH/admin/setblenv.profile.$BIRCH_PLATFORM.source ]
   then
      . $BIRCH/admin/setblenv.profile.$BIRCH_PLATFORM.source
fi

# Special code for text editors used by bioLegato and scripts called by bioLegato
# Nedit crashes in some Linux systems due to libraries set in BIRCHLIBS.
# nedit_wrapper unsets LD_LIBRARY_PATH before calling nedit.
# gedit opens all files in a single window. gedit_wrapper.sh forces
# gedit to open each file in different window.
# choose_edit_wrapper.sh returns the name of the wrapper to use
# for each editor, or just returns BL_TextEditor if there is no
# wrapper.
#BL_TextEditor=`choose_edit_wrapper.sh`
#export BL_TextEditor   

BIOLEGATO_HOME=$BIRCH/java/bioLegato
export BIOLEGATO_HOME


# The location of anciliary data files used by bioLegato.
BL_TABLES_DIR=$BIRCH/dat/blenzyme
export BL_TABLES_DIR

BL_PROPERTIES=$BIRCH/dat/blenzyme/blenzyme.properties
export BL_PROPERTIES

java -jar $BIOLEGATO_HOME/table.jar $*

BL_PROPERTIES=
export BL_PROPERTIES

# ------------------------ LOGGING ------------------------------
# Check to see if we can log when GDE is launched.
# If BIRCH is mounted read only, we don't crash the script

if [ "$BIRCH_LOGGING" -eq "1" ] 
    then
    echo `whoami` `date` >> $BIRCH/local/admin/biolegato.log
fi