AceWWW.pm
AceWWW.pm is a perl module for marking up Aceobj's (from Aceobj.pm) with html
for displaying on the World Wide Web. Three routines are used for this formatting:
- columnize arranges the object into neat columns;
- externalMarkup adds rule-based markup to point to other web pages or
external databases;
- ace2html actually produces html, using the columns and external markup
set up by the other routines.
External Markup
The main feature of this module is the system for adding links to external data
sources. Each rule specifies what objects to mark up, and what URL(s) to add at
a specific point within the object. All external links are added as a marked up
name listed within brackets
after the node that matched the rule, rather than marking up the node itself. This
makes it clear what information is in the database itself and what is external.
It is also possible to provide multiple links at any given node; in fact,
different rules may apply to the same node. The rules must supply the name to
appear for the link along with the form for the URL to use.
The rule files are in perl, and should evaluate to a reference to
a list (ie, [ ... ]). Each rule, in turn, is a reference to an associative
array with the the following keys and values:
- root - the matching criterion for the root node of the object
(see Aceobj.pm documentation for information
on matching criteria)
- branch - the matching criteria for finding the path to mark up
(given as a reference to a list of criteria, or a single criterion)
- node - which node in the path to mark up (if not the last)
- keys - to set up the @keys array (used in markup; must be a reference
to a subroutine)
- urls - external URLs to add (each URL can be specified as a reference
to a has table with keys name and URL, or as an identifier
in another table; these forms can be mixed in the same list)
Some of these are optional: if root is omitted, only the branch
condition is checked, and omitting branch cuases the root node to be
marked up. The keys routine is required only if the value of the node
and the value of the root node are not sufficient to complete the URL. For
more information about markup rules, see our paper
(
A World-Wide Web Server for ACEDB based on Tace) from the
ACE'95 conference proceedings, though there have been several changes. The
most important of the changes is that subroutines are now allowed as matching
criteria, instead of only as the value for keys. Also, Aceobj.pm
now has less cryptic methods for accessing acedb objects. Several example
rules are listed in mendel.emr, which is used for adding links to the
Mendel
database on AGIS.
Finally, note that AceWWW.pm contains a fair amount of code which is
specific to AGIS, and relies upon other homegrown library routines. A
future development may be to change AceWWW.pm to use a standard
library of html/WWW routines, such as CGI.pm.