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

Diff of /FigWebServices/frame.cgi

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

revision 1.1, Tue Feb 14 18:52:27 2006 UTC revision 1.2, Tue Feb 14 19:54:22 2006 UTC
# Line 1  Line 1 
 #!/usr/bin/env /disks/space0/fig/FIGdisk.v4/env/linux-gentoo/bin/perl  
   
 BEGIN {  
     @INC = qw(  
               /disks/space0/fig/FIGdisk.v4/dist/releases/cvs.1139429478/linux-gentoo/lib  
               /disks/space0/fig/FIGdisk.v4/dist/releases/cvs.1139429478/linux-gentoo/lib/FigKernelPackages  
               /disks/space0/fig/FIGdisk.v4/dist/cvs.1139429478/linux-gentoo/lib  
               /disks/space0/fig/FIGdisk.v4/dist/cvs.1139429478/linux-gentoo/lib/FigKernelPackages  
               /disks/space0/tmp/FIGdisk.v4/env/linux-gentoo/lib/perl5/5.8.7/i686-linux  
               /disks/space0/tmp/FIGdisk.v4/env/linux-gentoo/lib/perl5/5.8.7  
               /disks/space0/tmp/FIGdisk.v4/env/linux-gentoo/lib/perl5/site_perl/5.8.7/i686-linux  
               /disks/space0/tmp/FIGdisk.v4/env/linux-gentoo/lib/perl5/site_perl/5.8.7  
               /disks/space0/tmp/FIGdisk.v4/env/linux-gentoo/lib/perl5/site_perl  
               /disks/space0/tmp/FIGdisk.v4/dist/releases/current/linux-gentoo/lib  
               /disks/space0/tmp/FIGdisk.v4/dist/releases/current/linux-gentoo/lib/FigKernelPackages  
               /disks/space0/tmp/FIGdisk.v4/config  
               /disks/space0/fig/FIGdisk.v4/env/linux-gentoo/lib/perl5/5.8.7/i686-linux  
               /disks/space0/fig/FIGdisk.v4/env/linux-gentoo/lib/perl5/5.8.7  
               /disks/space0/fig/FIGdisk.v4/env/linux-gentoo/lib/perl5/site_perl/5.8.7/i686-linux  
               /disks/space0/fig/FIGdisk.v4/env/linux-gentoo/lib/perl5/site_perl/5.8.7  
               /disks/space0/fig/FIGdisk.v4/env/linux-gentoo/lib/perl5/site_perl  
               .  
               /disks/space0/fig/FIGdisk.v4/config  
   
 );  
 }  
1    
2  ##################################################  ##################################################
3  # includes  # includes
# Line 38  Line 12 
12  use FIG_Config;  use FIG_Config;
13  use FIG_CGI;  use FIG_CGI;
14    
15  use SeedComponents;  use FigWebServices::SeedComponents;
16    
17  ##################################################  ##################################################
18  # handle exceptions  # handle exceptions
# Line 49  Line 23 
23  };  };
24    
25  if($@) {  if($@) {
26        my $ex = $@;
27    print header(),start_html();    print header(),start_html();
28    print STDERR "EXCEPTION: $@\n";    print STDERR "EXCEPTION: $ex\n";
29    print "EXCEPTION: $@\n",end_html();    print "EXCEPTION: $ex\n",end_html();
30  }  }
31    
32  1;  1;
# Line 63  Line 38 
38  sub main {  sub main {
39    
40    # constant variables    # constant variables
41    use constant DOCUMENT_ROOT => "/disks/space0/fig/FIGdisk.v4/dist/releases/cvs.1139429478/linux-gentoo/CGI/Html/";    use constant DOCUMENT_ROOT => "$FIG_Config::fig/CGI/Html/";
42    use constant TEMPLATE_PATH => DOCUMENT_ROOT;    use constant TEMPLATE_PATH => DOCUMENT_ROOT;
43    use constant USER_DIR      => DOCUMENT_ROOT . "Users/";    use constant USER_DIR      => "$FIG_Config::fig/var/Users/";
44    
45    # initialize content variables    # initialize content variables
46    my $document_base = "./Html/";    my $document_base = "./Html/";
47    my $image_base    = $document_base . "images/";    my $image_base    = $document_base;
48    #  my $image_base    = $document_base . "images/";
49    my $configuration = "";    my $configuration = "";
50    my $preferences   = {};    my $preferences   = {};
51    
# Line 91  Line 67 
67                   cgi           => $cgi            };                   cgi           => $cgi            };
68    
69    # check for logged in user    # check for logged in user
70    my $user = "Guest";    $user = "Guest";
71    if (defined($cgi->param("user"))) {    if (defined($cgi->param("user"))) {
72      $user = $cgi->param("user");      $user = $cgi->param("user");
73    }    }
# Line 109  Line 85 
85  </form>  </form>
86  ~;  ~;
87    
88      # Ensure config dir and at least Guest's config file is present.
89    
90      &FIG::verify_dir(USER_DIR);
91    
92      my $user_conf = USER_DIR . $user;
93      if (! -f $user_conf)
94      {
95          open(FH, ">$user_conf");
96          print FH qq(extlinks,element,1,1,blue;intlinks,element,1,1,blue;services,element,1,1,blue;\n);
97          print FH qq({start_page=>"get_welcome",sort_subsystem=>"by_phylo",show_clusters_subsystem=>1}\n);
98    END
99      }
100    
101    # load configuration    # load configuration
102    open(FH, USER_DIR . $user) or die "Could not open configuration file";    open(FH, USER_DIR . $user) or die "Could not open configuration file";
103    my @conf;    my @conf;
# Line 126  Line 115 
115    
116    # process current action    # process current action
117    unless (defined($cgi->param("action"))) {    unless (defined($cgi->param("action"))) {
118      $content = eval("SeedComponents::Basic::" . $params->{user_preferences}->{start_page} . "(\$params)");      $content = eval("FigWebServices::SeedComponents::Basic::" . $params->{user_preferences}->{start_page} . "(\$params)");
119    } elsif ($cgi->param("action") eq "textsearch") {    } elsif ($cgi->param("action") eq "textsearch") {
120      $content = "You searched for " . $cgi->param("textsearch");      $content = "You searched for " . $cgi->param("textsearch");
121    } elsif ($cgi->param("action") eq "select_organism") {    } elsif ($cgi->param("action") eq "select_organism") {
# Line 136  Line 125 
125    }    }
126    
127    # generate common content    # generate common content
128    $title = SeedComponents::Framework::get_title($params);    $title = FigWebServices::SeedComponents::Framework::get_title($params);
129    $logo  = SeedComponents::Framework::get_logo($params);    $logo  = FigWebServices::SeedComponents::Framework::get_logo($params);
130    $menu  = SeedComponents::Framework::get_menu($params);    $menu  = FigWebServices::SeedComponents::Framework::get_menu($params);
131    
132    # create output template    # create output template
133    my $template = HTML::Template->new(filename => TEMPLATE_PATH . 'frame.tmpl');    my $template = HTML::Template->new(filename => TEMPLATE_PATH . 'frame.tmpl');

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3