How to use WDB

To use wdb to access a specific form you start Mosaic with a url of the form :


Where ...

http://server is the base URL to the HTTP server where you have installed WDB.

/cgi-bin/wdb/ is the path on the HTTP server to where you installed WDB. This example assumes that you have a special directory where you keep your CGI scripts called /cgi-bin. If your server are configured to run scripts depending on a file extension (say .cgi) then you'd have to rename the cgi script (say to wdb.cgi) and change to above path accordingly.

database is the name of the subdirectory where you have stored the fdf files you are trying to access - typically you would name this directory after the database the fdf files are accessing. (This would be a subdirectory to the directory you defined in $formdir in the configuration file.)
- If you only have one database and one or two fdf's this might seem ridiculous, but wdb was designed to handle a large number of fdf's in many different databases.

form-name is the name of the fdf file you want to use - without the '.fdf' extension.

mode is the mode in which you want to start WDB. This can be one of 'form', 'query' or 'default'. See below for details ....

keys is only used in the 'query' mode. See Query Mode for details.

Form Mode

In form mode wdb reads the form definition file and creates an HTML form in which the user can enter qualifiers. This is the normal use of WDB.

Here is an example This is the ESO Telescope Schedule Report located in $formdir/eso/sched_rep.fdf.

Query Mode

This mode is used by WDB internally as the action script to activate when the user press Search in the query form. However you can also use this mode to ask WDB to search for something in the database an present it according the fdf specified. The normal use of this is from an fdf file to provide hypertext links from one database row to another using the 'url' attribute. In fact you will need to use this in every fdf you write to provide access from the tabular output to the full-screen output.

For example :

FIELD = more label = More type = char length = 4 from_db= "MORE" url = "$WDB/mydb/$form{'NAME'}/query/$val{'key1'}::$val{'key2'}" computed forcetab no_query no_full This will create a hypertext link labeled 'MORE' in the tabular output which when activated will start WDB again using the same form, but this time searching on the two columns key1 and key2. Assuming these two columns together form the unique key on this form, this will lead to the full-screen output of the current row in the tabular output.

mkfdf will automatically add a field like the one above to your fdf files but you might want to modify it, or add url tags to other fields to create links from one form to another.

Default Mode

The default mode can be used to execute a default query. This is normally used in conjunction with the default field attribute in the fdf. The values in the 'default' field attributes are used as query constraints and the result shown in tabular output format.

Here is an example - The ESO Telescope allocation schedule starting from today :

Try to click on the Query button and see the default query in the 'Starting' field.

.... This page is still under construction ....