Jade: Installation Guide

Lincoln D. Stein, lstein@cshl.org
Cold Spring Harbor Laboratory, NY
Danielle et Jean Thierry-Mieg, mieg@kaa.crbm.cnrs-mop.fr
CRBM-CNRS, Montpellier

Contents


Where to Download

To use the socket server version of AceDB (www.wormbase.org, port 2007) you will need the experimental Jadex library. Otherwise, for the older RPC version of AceDB, use jade version 1.0j.

The Jade class libraries and installation guide can be downloaded from the following locations:

United States
http://stein.cshl.org/jade/distrib/

France
http://alpha.crbm.cnrs-mop.fr/jade/distrib/jade.tar.Z

Introduction

Jade is a Java library that provides live graphical access to one or more database servers maintained on the Internet or a local area network. The current implementation provides interfaces to ACEDB database servers as well as to flat files. The interface between the Java and the database layers is sufficiently generic that with a moderate amount of effort Jade can be adapted to serve data from other object-oriented or relational databases (we would be happy to collaborate on such a project).

Jade is still a work in progress. The underlying database interface layer is stable and well documented, but the graphical layers are liable to change without notice. Some of this instability is due to the labile nature of Java itself, which has undergone dramatic changes to the Abstract Windows Toolkit (AWT) in recent months.

This document describes the steps required to install Jade over an ACEDB database.

Requirements

It is assumed that the reader has experience installing and configuring Unix Internet daemons and World Wide Web servers. Some experience with the ACEDB database is also required.

Jade consists of several software components, some of which are optional:

  1. An ACEDB database server. Running in this mode, ACEDB has no graphical front end, but responds to network queries in text-only mode.
  2. A small network daemon called jade2ace that transforms requests from Java clients into RPC procedure calls that the database server understands.
  3. A Java class library that implements Jade's graphical and non-graphical methods.
  4. (optional) A database browsing applet that uses Jade to create a browsable view of any ACEDB database.
  5. (optional) Entries in ACE's schema (.wrm) and database (.ace) that dynamically map ACEDB objects to certain types of graphical displays in the browsing applet.
  6. (optional) A Web server to serve the browser applet.
The ACEDB server, jade2ace and the Web server may all live on the same machine, or they may be split up among several different machines. Due to Java's restrictive security model, if you wish to use the generic browsing applet, then the Web server and jade2ace must run on the same host. However the ACEDB server may still reside anywhere.

Because only the Unix version of the ACEDB server is currently supported, you must have a Unix machine available to install the database itself. In addition, jade2ace is designed to operate under the supervision of the Unix inetd super daemon. It may work with Windows and Macintosh versions of inetd, but this has not been tried.

The ACEDB server and jade2ace are part of the standard ACEDB 4_5e release. However jade2ace is only available in source code form. Therefore you will need an ANSI-compliant C compiler as well.

The Jade class library and the Web server can run on any platform that supports the TCP/IP protocol.

You will need a Java interpreter in order to run Jade. Many modern Web browsers, including Internet Explorer and Netscape Navigator, have built-in Java interpreters that are suitable. However, as the Java language has been evolving rapidly, you may find that not all features work correctly on older Java-capable browsers.

We provide the Jade class libraries in precompiled form as well as in source code. If you wish to use the ACEDB browser applet and class libraries as is, you only need the precompiled libraries. However, if you wish to extend the applet or libraries, you will need a Java compiler. A freely-distributable compiler is available in the form of the Java Development Kit, which has been ported to multiple platforms (see below for a partial list). Any of the commercial development environments, such as Visual Age or Java Studio should work too.

Java Development Kit Download Sites
OS Site
Solaris http://java.sun.com/
Windows NT http://java.sun.com/
Macintosh http://java.sun.com/
Linux http://www.blackdown.org/
Digital Unix (OSF/1) http://www.osf.org/mall/web/JDK/
HPUX http://www.osf.org/mall/web/JDK/
AIX http://www.osf.org/mall/web/JDK/

Installing the ACE Database and Network Server

There are two parts to installing JADE. You must install the ACEDB database and network server, and you must install the JADE client libraries. This section describes how to get an ACEDB server up and running. If you already have ACE installed, then you will want to skim this section and proceed to the next section, where we describe how to configure and test the JADE client.

ACEDB is an object oriented database system which was first distributed in 1990 to maintain the genetic and molecular data of the nematode C.elegans. It was written in collaboration with Richard Durbin and with the help and contribution of many other programmers. In 1995, ACEDB was rewritten to follow a client/server paradigm in which aceserver, the database server, uses the network to respond to requests for data from several database clients. The client/server version of ACE is fast, scaleable and reliable. It runs on everything from 486 portables to high-end DEC servers.

Compiling aceserver

You will need to install ACEDB 4_5e or later to use Jade. If you do not already have this version, you may download it in either source or binary form from these locations:
     
ftp://ncbi.nlm.nih.gov/repository/acedb/
     
ftp://ftp.crbm.cnrs-mop.fr/pub/unix/acedb/
Decompress the distribution with uncompress, and then unpack it with tar. One safe way to do this is:
% mkdir ace
% cd ace
% zcat ../ace.4_5e.tar.Z | tar xvf -

The installation directions can be found in the file wdoc/README, along with a script to automate the build and install process in wtools/INSTALL. Follow the directions to create and install the standard X-windows graphical database and associated utilities.

The INSTALL script does not, by default, install the aceserver and jade2ace binaries. However, they should be created in the bin.your_machine_architecture directory that is created during the build process. If for some reason these two programs have not been built, follow these directions:

  1. Type make.
  2. The makefile will now complain that you've "forgotten" to set the environment variable ACEDB_MACHINE and prompt you with a list of known platforms. Select the one that best describes your system, for example:
          setenv ACEDB_MACHINE SOLARIS_4_OPT (solaris with optimization)
          
  3. Type make aceserver aceclient jade2ace tace. This will compile aceserver, the server itself, aceclient, a command-line client, jade2ace, the Java interface, and a simple standalone query interface to the database called tace.
The executables will end as files bin.$ACEDB_MACHINE/jade2ace, bin.$ACEDB_MACHINE/aceserver, and bin.$ACEDB_MACHINE/tace, where $ACEDB_MACHINE is the machine architecture specified above.

You'll now want to copy these three files into the ACEDB home directory, which you selected during the execution of the INSTALL script. We will call this home directory $ACEDB throughout the rest of this document:

  % cp bin.$ACEDB_MACHINE/{jade2ace,aceserver,aceclient,tace} $ACEDB/bin
  % chmod +x $ACEDB/bin/{jade2ace,aceserver,acelient,tace}
You may now load up ACEDB with data from raw data files as described in the ACEDB installation documentation, and in any documentation that accompanies the data release. When this is done, test that the client/server version of ACEDB is functioning properly. First launch the database -- don't worry about what the various command line mean just yet:
% $ACEDB/bin/aceserver $ACEDB 20000 1200:1200:0
Database directory: /usr/local/acedb
Now run aceclient by issuing the command:
% $ACEDB/bin/aceclient localhost -port 20000
acedb@localhost> status
// Reponse: 1628 bytes.
// 
************************************************
  //   ACEDB version 4.5, linked Mar  3 1998
  // Data directory /usr/local/acedb/, release 4-0
            // Session : 2, User ,  Write Access No 
            // Global Address 29
            // Stream level 2
  // Disk: 442 blocks used,  3526 blocks available.
  //         : 0 blocks allocated and 0 freed in this session.
lots more information deleted for brevity
************************************************

// 0 Active Objects 
acedb@localhost> shutdown
// Reponse: 24 bytes.
// 0 Active Objects 
acedb@localhost> quit
//Bye
shutdown command and quit, the server application should exit.

Arranging for aceserver to Run Automatically

We recommend that you install aceserver as a named RPC service on your machine. This allows it to be launched automatically when needed, and shut down after a predetermined period of inactivity.

If you have a choice of machines to install aceserver on, you should choose a fast machine with plenty of local disk space available for the databases. Although possible, it is not recommended that you have the server read its database from a network mounted (e.g. NFS) disk.

To have aceserver launched automatically, you will need to add it to the /etc/rpc list of registered services, and to convince the inetd super-daemon to launch it when necessary.

aceserver uses the Sun portmapper service to dynamically assign it a port to use for its RPC calls. Some, but not all, implementations of portmapper expect the programs under portmapper's control to begin with the prefix rpc. To be safe, you should create a symbolic link to alias aceserver to rpc.acedb like this:

lrwxrwxrwx   1 lstein   lstein   9 Apr  1 13:59 rpc.acedb -> aceserver*
Next you need to choose a RPC service number for aceserver to listen on. This is a bit of black magic. Pick a service number greater than 100000 that isn't already mentioned in /etc/rpc. In this document, we'll assume port 500000, which is well out of the range used by other services. Open /etc/rpc and add a line like the following to the bottom:
acedb		500000
If you wish to run multiple ACEDB databases, just declare them, using a different name and port number for each one.

Next you must tell inetd to automatically launch aceserver when it is needed. Open /etc/inetd.conf and add a line like the following (you will need to be root to do this):

acedb/1  stream  rpc/tcp  wait   acedb  /usr/local/acedb/bin/rpc.acedb
    rpc.acedb /usr/local/acedb/elegans 500000 1200:1200:0
Please notice that the line above has been folded in order to fit it onto the page. There should be no line break in the actual entry. Full details on the various fields in /etc/inetd.conf can be found in the manual page for inetd. Important things to notice are:
  1. The first field of the line contains the name of the database as it appears in /etc/rpc, suffixed with a slash and a number indicating the version.
  2. The third field should be rpc/tcp, rather than tcp.
  3. The fourth field must be wait, to indicate that aceserver will continue to run and listen for incoming requests after the initial transaction is finished.
  4. The fifth field gives the name of the user to run the server as. On our system we use a pseudo-account called acedb that has read/write privileges to the ACEDB database directory. This is safer than running the server as root. You can run the server under your own account if you wish.
  5. We use the rpc.acedbsymbolic link rather than aceserver itself to avoid finicky portmappers. The arguments passed to the server must include the same RPC service number that is listed in the /etc/rpc. Replace the path to the database directory and the various timeout parameters with values appropriate for your needs. If you run aceserver without any command-line arguments, it will print out a good usage summary that explains the arguments.
You will need to signal the inetd daemon to reread its configuration file. Find out the process numbers of the daemon, and, while logged in as root, send it a HUP signal. If you are a Unix guru, this magical incantation will do the trick:
kill -HUP `ps -aux | grep inetd | grep -v grep | perl -nae 'print $F[1]," "'`
Now test the inetd side of the equation by running aceclient localhost -port 500000. You should get a prompt and be able to type queries and other commands (try typing "help").

If this doesn't work, you may have to send a HUP signal to the portmapper daemon as well (Linux systems sometimes show this behavior). Do so in the same you you did with inetd. Now, if you run the command rpcinfo -p localhost you should see that the server is registered with portmapper:

% rpcinfo -p localhost
 program vers proto   port
  100000    2   tcp    111  portmapper
  100000    2   udp    111  portmapper
  100005    1   udp    666  mountd
  100005    2   udp    666  mountd
  100005    1   tcp    669  mountd
  100005    2   tcp    669  mountd
  100003    2   udp   2049  nfs
  100003    2   tcp   2049  nfs
  500000    1   udp   1136  acedb
  500000    1   tcp   5687  acedb
This confirms that portmapper is correctly reconfigured.

Special Considerations for Solaris

Solaris systems are different from others. First, the location of the configuration files have changed. The files are /etc/inet/rpc and /etc/inet/inetd.conf. In addition to editing /etc/inet/rpc, you must edit /etc/inet/services as well. Add a line like the following to /etc/inet/services:
acedb		500000/tcp
The format of inetd.conf is, blessedly, unchanged.

Solaris does not have a portmap daemon, so don't worry about trying to restart it.

There are also some problems in certain versions of Solaris relating to apparent bugs in Sun's implementation of RPC. Quoting from the ACE SERVER.INSTALLATION guide:

Known SOLARIS bug:

ON solaris 5.5, the server does not connect when registered with inetd
this is due apparently to a bug in rpcgen

Symptom:
if you start the server in foreground:
  rpc.acedbd $ACEDB 600:600:0

all works ok and the client works

but started by inetd, the server can be seen as running:
  ps -elf | grep ace

but you cannot connect with the client

To fix this:

setenv ACEDB_MACHINE SOLARIS_4_OPT
make aceserver gifaceserver
cd bin.SOLARIS_4_OPT
rm -f  rpcace_svc.c
cp ../wrpc/rpcace_svc.crick rpcace_svc.c
touch rpcace_svc.c
rm aceserver gifaceserver rpcace_sp.o
cd ..
make aceserver gifaceserver

**************

problem is the following:
rpcace_svc.c is a c code automatically generated by rpcgen
this code is bugged
rpcace_svc.crick is a version that was generated under solaris.5.5.1

rpcace_svc.c is actually included in rpcace_sp.c at compile time
this is why you must rm rpcace_sp.o, then force recompilation

If Things Still aren't Working

Some systems may be balky when you first install a new aceserver. The database may not show up with rpcinfo, or inetd may hang when first starting it up. Things that seem to work in these cases include:
  1. Sending a HUP signal to portmapper.
  2. Killing and restarting portmapper completely (beware, you'll also have to restart all RPC services, such as NFS!).
  3. Sending more HUP signals to inetd.
  4. Killing and restarting inetd completely (usually harmless).
If all fails, a clean reboot of the machine usually gets things back to a rational state.

The file $ACEDB/server.log will contain a record of the server activity. Since it grows without limit, you will have to empty it from time to time using a command like:

cp /dev/null $ACEDB/server.log

Installing jade2ace

Unlike aceserver, jade2ace is a simple Berkeley-style socket program. Configuration and installation is similar to aceserver, but a lot less complicated.

You'll need to declare a TCP service port for jade2ace in /etc/services, then edit /etc/inetd.conf to launch jade2ace to handle incoming transactions.

Pick a TCP port for jade2ace to run on. Again, this is a bit of sorcery. Choose a port that is greater than 1000, not already mentioned in /etc/services, and not one of the undocumented ports in the 6000-7000 range that the X Windows systems likes to tromp on. Also, because of limitations in the Java representation of an integer, the port you choose should be lower than 32,767. We will use 5000 for our examples.

Open /etc/services, and add a line like the following:

jade2ace             5000/tcp
If you are planning to run multiple servers side by side, you can add additional names and ports at this time.

Open /etc/inetd.conf and add a line like the following:

jade2ace stream tcp  nowait acedb
   /usr/local/acedb/bin/jade2ace jade2ace -host localhost -port 500000
Please note that the line above has been folded to fit on the page. Keep the actual entry on a single line.

Things to notice about this entry:

  1. The first field must correspond exactly to the name of the service listed in /etc/services.
  2. List "stream" and "tcp" as the socket characteristics.
  3. Specify "nowait" in the fourth field. This indicates that jade2ace quits immediately after processing each transaction, rather than staying around for subsequent ones.
  4. You can specify any user account in the fifth field. jade2ace does not open any files or access devices, so does not need any special permissions. You can run it as nobody if you prefer.
  5. In the arguments to jade2ace, specify a connection to localhost at the port that aceserver listens to. You can have jade2ace establish a connection to a remote host if you prefer. Type jade2ace -h to get a list of other command line arguments.
You should now send a HUP signal to inetd as before. jade2ace should now be functional. To test, you may telnet to the jade2ace port. Type:
% telnet localhost jade2ace
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
200 Ace server ready and waiting
help
302 - Commands:
302 -    FIND   SHOW   FOLLOW    TABLE   NTABLE MODEL  GIF
302 -    LIST     IS   QUERY     UNDO    QUIT   HELP
302 - You need to know the Ace query language to use this
302 - service.  Sorry.
302 End of HELP info
quit
201 A bientot
Connection closed by foreign host.

Installing the Jade Distribution and Browser Applet

Obtaining the Jade distribution

The primary distribution sites for Jade are:
  1. http://stein.cshl.org/jade/
  2. http://alpha.crbm.cnrs-mop.fr/jade/distrib/jade.tar.Z
  3. ftp://ftp.crbm.cnrs-mop.fr/pub/unix/jade/jade.1_0e.tar.Z
The documentation can be found at:
  1. http://stein.cshl.org/jade/docs/jade.db.AceObject.html
  2. http://alpha.crbm.cnrs-mop.fr/jade/distrib/programming.doc.tar.Z
If you are using an FTP (as opposed to a Web-based client), please be sure to use binary mode to download the tar files.

Unpacking the Jade distribution

Download jade.tar.Z to a directory with at least 20 MB of free space, uncompress and untar it with the command:
zcat jade.tar.Z | tar xvf -
This will create a directory jade.version_number containing:
jade
This is a directory tree that contains Jade's compiled class libraries. There are several different subdirectories in this tree. db contains class files implementing the core database access routines, graphics contains core graphics and display routines, berkeley, whitehead and grassplot contain the code for contributed viewers, and the remaining directories contain utilities and test code of various sorts.

The file JadeBrowser.class is an applet file for the generic ACEDB browser. TestJade.class is a standalone application that runs a variety of tests on the Java to ACEDB connectivity layer and can be used to verify an installation.

install
This subdirectory contains files that provide meta information that allow ACEDB to interoperate with the generic browsing applet. This information is not necessary for Jade itself. models.jade.ace contains a new model type that defines the relationship between a Jade display and an ACE object, meta.jade.ace defines a few such relationships, and tables.jade.ace defines several canned queries that the browser applet uses to get its work done.

docs
This contains HTML documentation for the Jade API. To read, open the file packages.html with a Web browser.

src
This contains the source .java files for the Jade class library.
lignage
This directory contains contributed source code for a pedigree display class, courtesy of J. Barnett and S. Cartinhour.

bin
This directory contains demos of flatfile and relational database access. Currently it is undocumented.

Installing the Jade Class Libraries

The jade directory tree should be recursively copied to the location of other Java libraries on your system. If you are using the JDK, this is often /usr/local/java/lib or /usr/local/jdkX.XX/lib. Or you can move the tree to any other directory named in the CLASSPATH environment variable.

If you are intending to use the ACEDB browser applet, then you must install the jade tree into some part of the Web server document tree. We keep all our Java class libraries and applets in a java subdirectory. Adjust according to your preferences.

Testing Jade Connectivity

If you have a standalone Java interpreter (such as comes with the JDK) you can now test that Jade is installed and working on your system. Change your current directory to the top of the Jade distribution and type java TestJade alpha.crbm.cnrs-mop.fr 20100. This program attempts to connect to an ACEDB database server located at the CRBM in Montpellier, France using the indicated host name and port. If it is successful, it will print out some diagnostic output indicating successful execution. Otherwise you will see error messages indicating a problem.

If the connection to France is slow, this test may take a few minutes to complete. Please be patient. If you are in the United States, you might wish to try a closer server located in New York. The command-line invocation will be:

java TestJade stein.cshl.org 20006

If the test fails immediately with a "can not connect" error, then chances are that the remote database is temporarily down. Try again later. See the caveats about the range of port numbers at the end of the next section for another common problem.

Updating the ACE Database Models to Support the Browser Applet

If you plan on using the browser applet, you'll have to add some information to the database to support its views, and this is a good time to do so. This information is stored in the file meta.jade.ace.

The file install/tace.in contains the appropriate commands to update the database using tace. Run it this way:

% cd install
% $ACEDB/bin/tace < tace.in
Database directory: /usr/local/acedb
Type ? for a list of options
acedb> // 6 objects read with 0 errors
// New models read, save your work before quitting
// 0 Active Objects 
acedb> // 1 objects read with 0 errors// 1 Active Objects 
acedb> // 8 objects read with 0 errors// 8 Active Objects 
acedb> // 8 Active Objects 
// A bientot 
Previous versions of the Jade installation guide instructed you to paste the contents of models.jade.ace into the main wspec/models.wrm file. This is no longer necessary, as the Jade model is now hard-coded into ACEDB.

Installing the Browser Applet

To use the generic browsing applet you will need to create an HTML file that contains the appropriate <APPLET> tag and parameters. You will also need to have an appropriately configured jade2ace running on the Web server machine (but not necessarily a local ACEDB server). See the next section for details.

Create an HTML file containing an <APPLET> tag following this model:

<applet codebase="/java" code="jade.JadeBrowser" width=400 height=160> <param name="title" value="Welcome to ACEDB"> <param name="netclient" value="stein.cshl.org"> <param name="port" value="20006"> </applet>
Replace codebase with the location of your Java class libraries and applets. Replace the value of the netclient parameter with the host name of the machine that jade2ace is running on (currently it must be the same host as the Web server). Replace the value of the port parameter with the port that jade2ace is listening to (see below for details).

When you fetch this page with a Java-capable Web browser, you should see a welcome banner. The banner will be orange while the applet attempts to establish a connection to ACEDB, and turn green when the connection is successful.

If the applet fails for some reason, the banner will turn bright red. Open the Java console window to see what might have gone wrong. Typical errors include connection timeouts to a non-running server and security violations due to an attempt to connect to a jade2ace running on a different machine than the Web server. Another common gotcha is that Java doesn't have unsigned integers, only signed ones. On Digital Unix/alpha machines (which Jade was developed on) this doesn't pose a problem because integers are four bytes long. But on some other architectures they are two bytes, leading to unexpected problems when a high-numbered port is opened. If you are unable to establish a connection and are using a high-numbered port, try using a port number that is within Java's byte range (i.e., no higher than 32,767).


Extending JADE

JADE was originally conceived as a transparent interface between Java and ACEDB. Objects residing in ACEDB databases are serialized, transported across the network, and reconstituted on the other end as rich and fully functional Java objects.

Although it is tempting to use these Java objects directly as the basis for graphical displays, our experience with ACEDB development has convinced us that a less tightly-integrated approach is desirable. Data displays should be decoupled from the schema as much as possible. Instead, the correspondence between a database object and its graphical representation should be determined by an explicit, documented linkage. The user interface should also take care that any graphical element that appears on the screen is associated with a corresponding object in the database [Jean, is this what you meant?].

To implement this behavior, all the data that drives our graphic displays is retrieved from the database in the form of simple tables declared by name on the server side. The tables are essentially simplified "views" on the more complex object-oriented ACEDB schema. This system has the following advantages:

  1. Since the table definition is external to the Java source code, the programmer of the display is automatically documenting his way of accessing the data.
  2. Before loading the table definition on the server side, the data curator can adapt the definition to the schema of the server.
  3. The same table, from the display point of view, can be retrieved from very different schemas. This provides the desired decorrelation between the programming of the display and the construction of the schema and ensures the reusability of the graphic interface.
  4. If the relevant data is lacking from the schema on the server side the table cannot be constructed and retrieved, and it is now straightforward to remove the corresponding menu entries from the display.
  5. Any type of server can be used to feed the display. In particular one can even develop a new display from files taken from the local file system without accessing a database server, and substitute the socket only when the display is ready.
  6. A beneficial side effect of this method is that the preprocessing is transferred to the server side, which is often faster than the client and which has the freedom to buffer the results if this seems adequate.
For example, in our running demos, indicated below, we use the same display code to show the lineage of the nematode (Cells in the schema, with mothers and daughters) and cereals genealogy (Nodes in the schema, with children and parents). Only the table definitions on the servers differ.

At any time, data retrieved from the first server can indicate the address of some other server to which Jade can establish independent connections (see below). Depending on the applications, the data retrieved from different servers can be merged or maintained separately.

Jade is also capable of representing and retrieving ACEDB objects in their full object-oriented tree form, translating ACEDB pointers into Java-style references. We use this possibility in the plain Tree-display of the objects, which implements hypertext facility. However, to write a graphic display, like a genetic map, in the object-oriented form, sacrifices some of Jade's portability, because it assumes a certain database structure and schema.

In the section on updating the ACE database models, we showed you how to modify the ACEDB database to support this indirect linkage between displays and objects. To add your own displays, you will need to do three things:

  1. Create a mapping from the ACE object type to the Java class that will be used to display it. More information on this is given below.
  2. Create one or more table queries to fetch the data you'll need from the database and store it into the database as a named query. The procedure is described below.
  3. Create a new Java class to display the object. It will be automatically invoked when the browser applet needs to display an object of the appropriate kind.

Mapping from Object to Display

Specifying the mapping between ACE objects and graphical displays is, fortunately, very straightforward. The browser applet uses a Jade database object named "default" to determine what Java classes to invoke to display particular types of objects. If no specific display class is mentioned, the applet invokes a generic text tree display.

The Jade object supports two tag types, StandaloneDisplay and Display. StandaloneDisplay is used for "top level" display classes that are not associated with a single database object, such as those responsible for selecting among multiple objects. For example, in the grass database demo database, you will find the definition:

Jade : default
StandAloneDisplay        jade.grassplot.MapSetPick
The jade.grassplot.MapSetPick display code is responsible for finding all Oxford grid maps in the database and displaying them in a selection list for the user to choose among. By following the Jade graphical class conventions, the browser is able to automatically determine its name and createf a menu entry labeled "Oxford Grid Selector" in the Display menu of the Jade main window. When the menu item is selected, the class is invoked. [XXX ? Jean, can we distribute the full grassdb demo, along with the appropriate Jade and table .ace files so that people can see? ]

When there is a one-to-one correspondence between a database object and a display, you should use the Display tag. Consider this definition:

Jade : default
Display  Chromosome jade.maps.Vmap
Display  Sequence   jade.maps.Vmap   map.interval link.interval
There are two Display tags here. In the first case, objects of type "Chromosome" are mapped to the Java class "jade.maps.Vmap" (vertical genetic map). Like standalone displays, this Java class is expected to implement the Jade graphical interfaces described below. Whenever the browser needs to fetch a Chromosome from the database, the class's constructor will be called and passed the database object. It is free to make additional database queries in order to fetch other information that it might need.

The second Display line, which maps Sequence objects to jade.maps.Vmap, is more interesting. Internally, jade.maps.Vmap invokes a table query named "map.interval" to fetch the list of intervals between all the loci on the genetic map. However, in this case we wanted to reuse the genetic map display to show the relationship between contigs across a large assembled sequence. However, the ACEDB genetic and physical map models are very different. In this case, two optional fields remap all requests for the "map.interval" table query to requests to the "link.interval" table query. The two tables have a very different definition on the server side, but export semantically equivalent tables to the display code. Thus the genetic map display is tricked into displaying a physical map, with little programming effort on our part.

Writing table definitions

The way to actually write table definitions is out of the scope of this document, since this is an ACEDB-specific application. It would be done in a completelly different way for a different sort of server.

The important feature on the server (jade2ace) side is to be able to answer a request of the form:

NTABLE table_name [param1 param2 param3...]
The table name refers to a predefined query in the database, and the remaining arguments are optional run time parameter values to be bound to the query at run time.

The format of the ACEDB table definition file Jade.tables.ace is undocumented. However, table definitions are easily constructed using the acedb xace graphic interface, starting the Table-Maker from the main menu, and saving the definition as an ace object via the new "Save Def" button. Unfortunatelly, the current ace.4_3 interface does not correctly allow the handling of run-time parameters. One must finish the preparation by viewing the resulting table definition in tree-update mode and adding the desired parameters by using the values "%1", "%2", "%3" to indicate the first, second, third parameters, and so forth. The resulting Table class object should then be exported as an .ace file.

Writing the Display Code

The hardest part of this process is the last step, that of writing the Java code. Unfortunately this is incompletely documented and liable to change as we move from JDK 1.0 to JDK 1.2.

All Jade displays must implement the Displayable interface and declare the following method:

public String nickName ()  { return "Some descriptive string" ; }
In the case of standalone displays, the nickName() method is used to generate a menu item that invokes the display.

Each display class should declare a constructor which takes a single AceObject argument. When the class is instantiated, it can use the AceObject to fetch information about the object it is responsible for displaying. It can also use the AceObject to access other objects in the database that it needs information about.

Please refer to the (incomplete) programmer's API, and to the code itself for examples of how to do this. More detailed information will be forthcoming in future releases.

Connecting to several servers

Jade can import data from several servers in parallel. This is specified in the html document in the parameter otherdbs. In the example of the multimap display of the grass database of the USDA (Barnet,Bigwood, Cartinhour), we have the definition
<applet code=jade.maps.Welcome.class width=400 height=150>
<param name="title" value="Grass@beta">
<param name="netclient" value="alpha.crbm.cnrs-mop.fr">
<param name="port" value="50000">
<param name="otherdbs" value="ricegenes 20211 maizedb 20213 graingenes 20212 sorghumdb 20214">
These lines associate the names ricegenes, maizedb... to the ports number 20211 and 20212... corresponding on the same host to the jade2ace services of the rice, maize... servers.

The first connection is established with the web host on the principal port, 20210 in this example. Later on, the display may require additional connections to other servers.

Inside the Java display code, the need to call the secondary servers is hard coded, including a name recognition system, and results in a call:

jade.db.MultiAccess.display("ricegenes", "Map", locus.name)
This will open the rice database and perform a Map display of the correct marker.

The relevant point is that although the need to call the rice server is part of the display code, the actual location of the server is part of the configuration of the main server.

The grass demo is running at http://alpha.crbm.cnrs-mop.fr/jade/grass.html,


Demos

A variety of demos can be found running at:
C. elegans
http://alpha.crbm.cnrs-mop.fr/jade/jade.html
Grass
http://alpha.crbm.cnrs-mop.fr/jade/grass.html
Astronomy
http://alpha.crbm.cnrs-mop.fr/jade/astrid.html

Recompiling the Applet and Class Libraries

The simplest way to recompile this distribution is to recompile all .java files simultaneously with a command like the following:
% javac -d . src/jade/*.java src/jade/*/*.java
You will see a number of deprecation warnings. This is nothing to be concerned with.

If you have the GNU make utility, you can make use of it to achieve a slightly quicker and more intelligent type of recompilation. Here's an example:

% cd jade
% make
Each of the subdirectories, db, grassplot, etc. has its own Makefile. To rebuild just the contents of that subdirectory, change to it and type make.

Credits, Copyright and Distribution

Acknowledgements

It is a pleasure to acknowledge the contributions of Doug Bigwood, John Barnet and Sam Cartinhour. Their distributed grass database is a perfect test for the jade communication system. Together, we realised on this example that the importation of data via predefined tables, which we were using for convenience in the C.elegans genetic map demo, should really be promoted to a strict rule to allow portability to other schemas, reusability, and abstraction from the particular type of server.

Copyright Information

Copyright © 1996-1998 Danielle et Jean Thierry-Mieg and Lincoln Stein. All rights reserved.

This document and software may be redistributed as long as it is distributed in full and the above copyright statement remains intact. Any additions or modifications should be expressly labeled as such.

THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

Danielle et Jean Thierry-Mieg

Lincoln D. Stein

Last modified: Fri Apr 12 15:20:24 EDT 2002