One of the goals of WDB was to provide an easy - yet flexible - way to make
database information available. In the simple case no coding should be
necessary. However if special behavior is needed it should be possible to
add it - without changing the core system. Also if some special
behavior has been defined for one field in a form it should be easy to
reuse this in other forms.
As examples of such special behavior can be mentioned :
( Some of these conversions can be implemented using database views, however
this usually makes it either impossible or very inefficient to search on
the corresponding field. )
The way this is obtained in WDB is by using Form Definition Files
(fdfs). When a new query form has to be added to the system all that
is needed is to create a new fdf file specifying what fields should be in
the form and how they should be presented to the user.
ßForm attributes
An fdf is composed of a set of form attributes, and a set of field attributes for each field in the form. Examples of form attributes include :
Field attributes describe how to find the field in the database and how to present it to the user. Examples of field attributes include :
ßExample of a Form Definition Files.
The following fdf file demonstrates several of the features of WDB.
NAME = preprints TITLE = ESO Preprints Database DATABASE = library TABLE = preprint ORDER = authors DOCURL = /eso/preprint.html RECTOP = $val{'title'} COMMENTS_TO= malbrech@eso.org PERL = require "eso_util.pl"; # Include extra perl functions #------------------------------------ FIELD = date label = Received type = int length = 10 from_db = &cvdatein( $val{'date'}, "DD MMM YY" ); to_db = &cvdateout( $val ); default = '>01-Jan-'.`date +%y` no_tab FIELD = authors label = Authors type = char length = 255 tablen = 20 from_db = &textohtml($val{'authors'}) FIELD = title label = Title type = char length = 255 from_db = "<em>".&textohtml($val{'title'})."</em>" url = "$WDB/eso/$form{'NAME'}/query/".&cgi_encode($val{'title'}) no_full key FIELD = reference label = Reference from_db = "$val{'institute'}, <em>$val{'numb'}</em>" computed no_tab no_query FIELD = institute column = inst label = Institute type = char length = 255 no_tab no_full FIELD = numb type = char hidden