[Bio] / FigWebServices / ErdbDocWidget.cgi Repository:
ViewVC logotype

View of /FigWebServices/ErdbDocWidget.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (download) (annotate)
Tue Jun 16 22:20:31 2009 UTC (10 years, 9 months ago) by parrello
Branch: MAIN
CVS Tags: rast_rel_2009_0925, rast_rel_2009_07_09
Changes since 1.2: +1 -1 lines
Fixed security problem with diagrams, added nmpdr-free POD support.

#!/usr/bin/perl -w

#
# Copyright (c) 2003-2006 University of Chicago and Fellowship
# for Interpretations of Genomes. All Rights Reserved.
#
# This file is part of the SEED Toolkit.
#
# The SEED Toolkit is free software. You can redistribute
# it and/or modify it under the terms of the SEED Toolkit
# Public License.
#
# You should have received a copy of the SEED Toolkit Public License
# along with this program; if not write to the University of Chicago
# at info@ci.uchicago.edu or the Fellowship for Interpretation of
# Genomes at veronika@thefig.info or download a copy from
# http://www.theseed.org/LICENSE.TXT.
#

use strict;
use Tracer qw(:DEFAULT PrintLine);
use ERDB;
use ERDBPDocPage;
use ERDBExtras;

=head1 ErdbDocWidget Script

This is a small script that generates the documentation widget for an [[ErdbPm]]
database. It is designed to fit inside an embedded frame. The widget appears as
a two-column table with a scrolling select control on the left and the
documentation for the selected component on the right.

The following CGI parameters are used.

=over 4

=item database

Name of the database to document.

=item rows

The estimated number of rows to display in the select box in order to make the
widget fit comfortably inside the frame.

=back

=cut

# Get the CGI query object.
my $cgi = CGI->new();
# Start the output page.
print CGI::header();
print CGI::start_html(-title => 'ERDB Database Documenter',
                      -style =>  { src => "$ERDBExtras::css_dir/ERDB.css" },
                      -script => { src => "$ERDBExtras::js_dir/ERDB.js" });
# Insure we recover from errors.
eval {
    # Get the parameters.
    my $database = $cgi->param('database') || 'Sapling';
    my $height = $cgi->param('height') || 900;
    # Get the datanase object.
    my $erdb = ERDB::GetDatabase($database);
    # Get a page creator.
    my $page = ERDBPDocPage->new(dbObject => $erdb);
    # Create the body HTML.
    my $html = CGI::div({ class => 'doc' }, $page->DocPage(boxHeight => $height));
    # Output it.
    PrintLine($html);
};

if ($@) {
    # Here we have a fatal error. Save the message.
    my $errorText = "SCRIPT ERROR: $@";
    # Issue a feed event.
    Warn($errorText);
    # Output the error message.
    PrintLine CGI::pre($errorText);
}
# Close the page.
PrintLine CGI::end_html();

1;

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3