[Bio] / SeedViewer / seedviewer.cgi Repository:
ViewVC logotype

Diff of /SeedViewer/seedviewer.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4, Wed Nov 7 17:09:12 2007 UTC revision 1.28, Tue Jul 7 23:51:58 2009 UTC
# Line 1  Line 1 
1  use strict;  use strict;
2  use warnings;  use warnings;
3    no warnings 'once';
4    
5  use DBMaster;  use DBMaster;
6  use WebApplication;  use WebApplication;
7  use WebMenu;  use WebMenu;
8  use WebLayout;  use WebLayout;
9    use Tracer;
10    use FIGRules;
11    use FIG_Config;
12    use WebConfig;
13    
14  eval {  eval {
15      &main;      &main;
# Line 12  Line 17 
17    
18  if ($@)  if ($@)
19  {  {
20      my $cgi = new CGI();      my $error = $@;
21        Warn("Script error: $error") if T(SeedViewer => 0);
22    
23      print $cgi->header();      print CGI::header();
24      print $cgi->start_html();      print CGI::start_html();
25    
26      # print out the error      # print out the error
27      print '<pre>'.$@.'</pre>';      print '<pre>'.$error.'</pre>';
28    
29      print $cgi->end_html();      print CGI::end_html();
30    
31  }  }
32    
# Line 28  Line 34 
34    
35      # initialize cgi      # initialize cgi
36      my $cgi = new CGI();      my $cgi = new CGI();
37        # Initialize tracing.
38      # initialize db-master      ETracing($cgi);
39      my $dbmaster = DBMaster->new(-database => 'WebAppBackend');      if (FIGRules::nmpdr_mode($cgi)) {
40            Trace("NMPDR mode selected.") if T(3);
41            my $parms = $cgi->query_string();
42            if ($parms) {
43                $parms = "?$parms";
44            } else {
45                $parms = "?page=Home";
46            }
47            print CGI::redirect(-uri => "$FIG_Config::cgi_url/wiki/rest.cgi/NmpdrPlugin/SeedViewer$parms",
48                                -status => 301);
49        } else {
50      # initialize layout      # initialize layout
51      my $layout = WebLayout->new('./Html/SeedViewer.tmpl');          # Use the template file for the current mode-- NMPDR or SEED
52      $layout->add_css('./Html/default.css');          my $templateFile = TMPL_PATH . "/SeedViewer.tmpl";
53      $layout->add_css('./Html/seedviewer.css');          Trace("Template file is $templateFile") if T(3);
54            my $layout = WebLayout->new($templateFile);
55            # Choose the body/header style sheet according to the mode.
56            $layout->add_css("$FIG_Config::cgi_url/Html/seedviewer.css");
57            $layout->add_css("$FIG_Config::cgi_url/Html/commonviewer.css");
58            $layout->add_css("$FIG_Config::cgi_url/Html/css/default.css");
59      # build menu      # build menu
60      my $menu = WebMenu->new();          my $menu;
61            $menu = WebMenu->new();
62      $menu->add_category('&raquo;Navigate', '?page=Home');      $menu->add_category('&raquo;Navigate', '?page=Home');
63      $menu->add_entry('&raquo;Navigate', 'Search', '?page=Home');          $menu->add_entry('&raquo;Navigate', 'Startpage', '?page=Home');
     $menu->add_entry('&raquo;Navigate', 'Subsystems', '?page=SubsystemSelect');  
64      $menu->add_entry('&raquo;Navigate', 'Organisms', '?page=OrganismSelect');      $menu->add_entry('&raquo;Navigate', 'Organisms', '?page=OrganismSelect');
65            $menu->add_entry('&raquo;Navigate', 'Subsystems', '?page=SubsystemSelect');
66            $menu->add_entry('&raquo;Navigate', 'Scenarios', '?page=Scenarios');
67            $menu->add_entry('&raquo;Navigate', 'FigFams', '?page=FigFamViewer');
68            $menu->add_entry('&raquo;Navigate', 'BLAST Search', '?page=BlastRun');
69            if (defined($FIG_Config::teacher_db)) {
70      $menu->add_category('&raquo;Teacher', '?page=Teach', undef, ['edit', 'problem_list'], 96);      $menu->add_category('&raquo;Teacher', '?page=Teach', undef, ['edit', 'problem_list'], 96);
71      $menu->add_category('&raquo;Admin', '?page=Admin', undef, ['edit', 'scope', '*'], 99);              $menu->add_entry('&raquo;Teacher', 'Class Performance', '?page=Teach');
72                $menu->add_entry('&raquo;Teacher', 'Class Management', '?page=ManageClass');
73                $menu->add_entry('&raquo;Teacher', 'Problem Sets', '?page=ManageProblemSets');
74                $menu->add_entry('&raquo;Teacher', 'Annotation Resolve', '?page=ClassAnnotationResolve');
75            }
76      $menu->add_category('&raquo;Help', 'http://www.theseed.org', 'help', undef, 98);      $menu->add_category('&raquo;Help', 'http://www.theseed.org', 'help', undef, 98);
77      $menu->add_entry('&raquo;Help', 'What is the SEED', 'http://www.theseed.org/wiki/Home_of_the_SEED');      $menu->add_entry('&raquo;Help', 'What is the SEED', 'http://www.theseed.org/wiki/Home_of_the_SEED');
78      $menu->add_entry('&raquo;Help', 'HowTo use the SEED Viewer', 'http://www.theseed.org/wiki/SEED_Viewer_Tutorial');      $menu->add_entry('&raquo;Help', 'HowTo use the SEED Viewer', 'http://www.theseed.org/wiki/SEED_Viewer_Tutorial');
79      $menu->add_entry('&raquo;Help', 'Submitting Data to SEED', 'http://www.theseed.org/wiki/RAST_Tutorial');      $menu->add_entry('&raquo;Help', 'Submitting Data to SEED', 'http://www.theseed.org/wiki/RAST_Tutorial');
     $menu->add_entry('&raquo;Help', 'Contact', 'http://www.theseed.org/wiki/Contact');  
     $menu->add_entry('&raquo;Help', 'Register', '?page=Register');  
80    
81            # check which contact info to show
82            if (defined($FIG_Config::server_type) && ($FIG_Config::server_type eq 'MG-RAST')) {
83                $menu->add_entry('&raquo;Help', 'Contact', 'mailto:mg-rast@mcs.anl.gov', undef, ['login']);
84            } elsif (defined($FIG_Config::server_type) && ($FIG_Config::server_type eq 'RAST')) {
85                $menu->add_entry('&raquo;Help', 'Contact', 'mailto:rast@mcs.anl.gov', undef, ['login']);
86            } else {
87                $menu->add_entry('&raquo;Help', 'Contact', 'mailto:info@theseed.org');
88            }
89            $menu->add_entry('&raquo;Help', 'Register', '?page=Register');
90            $menu->add_entry('&raquo;Help', 'I forgot my Password', '?page=RequestNewPassword');
91      # initialize application      # initialize application
92      my $WebApp = WebApplication->new( { id => 'SeedViewer',      my $WebApp = WebApplication->new( { id => 'SeedViewer',
                                         dbmaster => $dbmaster,  
93                                          menu     => $menu,                                          menu     => $menu,
94                                          layout   => $layout,                                          layout   => $layout,
95                                          default  => 'Home',                                          default  => 'Home',
96                                        } );                                        } );
97            my $prefix = "Seed Viewer - ";
98            $WebApp->page_title_prefix($prefix);
99            $WebApp->show_login_user_info(1);
100      # run application      # run application
101      $WebApp->run();      $WebApp->run();
102        }
103  }  }

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.28

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3