[Bio] / RAST / rast.cgi Repository:
ViewVC logotype

View of /RAST/rast.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (download) (annotate)
Thu Oct 16 22:30:43 2008 UTC (11 years, 1 month ago) by olson
Branch: MAIN
CVS Tags: mgrast_rel_2008_1110_v2, mgrast_rel_2008_1110, rast_rel_2008_10_29
Changes since 1.6: +3 -3 lines
Initial changes to support mod_perl with RAST/SeedViewer:

Template loading requires absolute path. We use TMPL_PATH for this.

add_css used to use TMPL_PATH, but css paths are in URL space, not in
filesystem space. Add new TMPL_URL_PATH to WebConfig and use that instead.

WebApplication::run should not exit; mod_perl doesn't like it and it isn't necessary. Just return.

use strict;
use warnings;

use DBMaster;
use WebApplication;
use WebMenu;
use WebLayout;
use WebConfig;

# read local WebConfig because we need it here
&WebConfig::import_local_config('RAST');

# choose a layout
my $layout = WebLayout->new("$FIG_Config::fig/CGI/Html/RAST.tmpl");
if ($WebConfig::RAST_TYPE eq 'metagenome') {
    $layout = WebLayout->new('./Html/RAST-MG.tmpl');
}
$layout->add_css(TMPL_URL_PATH.'/default.css');
$layout->add_css(TMPL_URL_PATH.'/rast.css');

# add site meter
my $site_meter = $FIG_Config::site_meter;
if ($site_meter) {
    $layout->add_javascript("http://s20.sitemeter.com/js/counter.js?site=s20nmpdr");
}

# create the menu
my $menu = WebMenu->new();

if ($WebConfig::RAST_TYPE eq 'metagenome') {
    $menu->add_category('Home', 'metagenomics.cgi', undef, [ 'login' ]);
} else {
    $menu->add_category('Home', 'rast.cgi', undef, [ 'login' ]);
}

$menu->add_category('Your Jobs', 'rast.cgi?page=Jobs', undef, [ 'login' ]);
$menu->add_entry('Your Jobs', 'Jobs Overview', 'rast.cgi?page=Jobs');
$menu->add_entry('Your Jobs', 'Upload New Job', 'rast.cgi?page=Upload');
$menu->add_category('Import Control', 'rast.cgi?page=ControlCenter', undef, [ 'import' ]);


# init the WebApplication
my $WebApp = WebApplication->new( { id       => 'RAST',
                                    menu     => $menu,
                                    layout   => $layout,
                                    default  => 'Home',
                                  } );
	
if ($WebConfig::RAST_TYPE eq 'metagenome') {
    $WebApp->page_title_prefix('MG-RAST - ');
} else {
    $WebApp->page_title_prefix('RAST Server - ');
}

$WebApp->run();

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3