AcePerl
view release on metacpan or search on metacpan
README.ACEBROWSER view on Meta::CPAN
location of scripts in URL space:
$ROOT = '/movies';
EXTENDING ACEBROWSER
Acedb is fundamentally object based. In addition to having a name,
each object has a class, such as "Sequence". Acebrowser takes
advantage of this object structure by allowing you to assign one or
more displays to a class. Each display is a CGI script that fetches
the desired object from the database, formats it, and displays it as
HTML or an image.
Whenever Acebrowser is called upon to display an object, it consults
the configuration file to determine what displays are registered for
the object, and then presents a row of display names across the top of
the window. In Acebrowser jargon, this line of displays is called the
"type selector." The user can change the display to use by selecting
the corresponding link.
Three generic displays, which will work with all databases, come with
Acebrowser:
tree an HTML representation of the Acedb object which
presents the object in the form of a collapsible outline.
xml an XML representation of the Acedb object
pic a clickable GIF image, as returned from gifaceserver.
Writing New Display Scripts
---------------------------
To register a new display script with the system, you will need to do
three things:
1. Write the script. The easiest way to do this is to take the
moviedb "misc/movie" script, copy it, and go from there.
The script will be invoked with the CGI parameters "name" and "class",
corresponding to the name and class of the Acedb object to display.
For example, if the script is located in /cgi-bin/ace/newscript, it
will be invoked as:
http://your.site/cgi-bin/ace/newscript?name=foo;class=bar
2. Register the display with the %DISPLAYS hash in the configuration
file, by adding a hash entry like the following:
newdisplay => {
url => "/cgi-bin/ace/newscript",
label => 'New Display',
icon => '/ico/layout.gif',
},
The hash key, in this case "newdisplay", is a symbolic name for the
display. It can correspond to the acual name of the CGI script, or
not. The hash value is itself an anonymous hash containing the
required keys "url" and "label", and the optional key "icon". "url"
gives the path to the script that will display, and "label" gives a
human readable label for the link that Acebrowser puts in the type
selector. The "icon" key, if present, will display the indicated icon
in the type selector.
3. Bind this display to the class (or classes) for which this display
is valid, by adding an entry to the %CLASSES array. For example:
NewObject => ['newdisplay'],
This indicates that whenever Acebrowser is called upon to display an
object of type "NewObject", it will display the object using the CGI
script designated by the "newdisplay" display. If you have several
displays that are appropriate for a class, you can bind them all to
the class in the following fashion:
NewObject => ['newdisplay','newerdisplay','newestdisplay'],
When creating a link for an Acedb object, Acebrowser will choose the
first display in the array. When the object is displayed, all three
of the alternative displays will appear in the type selector.
More information on writing display scripts can be found in the
documentation for Ace::Browser::AceSubs. From the command line, run:
perldoc Ace::Browser::AceSubs
Writing New Searches
--------------------
To create a new search,
1. Write a script following the model of one of the existing scripts.
Ace::Browser::SearchSubs exports subroutines that are useful in
managing the multiple pages of results produced by most search
scripts.
2. Register the new script in the @SEARCHES array. Provide an
explanatory name for the search script, and a pointer to its URL.
More information on writing search scripts can be found in the
documentation for Ace::Browser::SearchSubs. From the command line, run:
perldoc Ace::Browser::SearchSubs
FOR HELP
Please write to the Acedb newsgroup, acedb@sanger.ac.uk for help or to
report possible bugs. If you get really stuck, write to the author,
lstein@cshl.org.
Lincoln D. Stein
September 24, 2001
( run in 0.529 second using v1.01-cache-2.11-cpan-d8267643d1d )