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

View of /FigWebServices/myseed.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (download) (annotate)
Mon Dec 5 19:12:12 2005 UTC (13 years, 11 months ago) by olson
Branch: MAIN
CVS Tags: mgrast_dev_08112011, rast_rel_2009_05_18, mgrast_dev_08022011, rast_rel_2014_0912, rast_rel_2008_06_18, myrast_rel40, rast_rel_2008_06_16, mgrast_dev_05262011, rast_rel_2008_12_18, mgrast_dev_04082011, rast_rel_2008_07_21, rast_rel_2010_0928, rast_2008_0924, mgrast_version_3_2, mgrast_dev_12152011, rast_rel_2008_04_23, mgrast_dev_06072011, rast_rel_2008_09_30, rast_rel_2009_0925, rast_rel_2010_0526, rast_rel_2014_0729, mgrast_dev_02212011, rast_rel_2010_1206, caBIG-05Apr06-00, mgrast_release_3_0, mgrast_dev_03252011, rast_rel_2010_0118, mgrast_rel_2008_0924, mgrast_rel_2008_1110_v2, rast_rel_2009_02_05, rast_rel_2011_0119, mgrast_rel_2008_0625, mgrast_release_3_0_4, mgrast_release_3_0_2, mgrast_release_3_0_3, mgrast_release_3_0_1, mgrast_dev_03312011, mgrast_release_3_1_2, mgrast_release_3_1_1, mgrast_release_3_1_0, mgrast_dev_04132011, rast_rel_2008_10_09, mgrast_dev_04012011, rast_release_2008_09_29, mgrast_rel_2008_0806, mgrast_rel_2008_0923, mgrast_rel_2008_0919, rast_rel_2009_07_09, rast_rel_2010_0827, mgrast_rel_2008_1110, myrast_33, rast_rel_2011_0928, rast_rel_2008_09_29, mgrast_rel_2008_0917, rast_rel_2008_10_29, mgrast_dev_04052011, mgrast_dev_02222011, caBIG-13Feb06-00, rast_rel_2009_03_26, mgrast_dev_10262011, rast_rel_2008_11_24, rast_rel_2008_08_07, HEAD
Changes since 1.1: +17 -0 lines
add license words

# -*- perl -*-
#
# 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.
#


=pod 

=head1


Generate a myseed page that will allow people to set different settings. All this page will do is set the cookies, it is upto the other pages to respect the cookie settings and display the information as selected.

Overall format is a series of menus, one for each of the most commonly used pages, that is shown or hidden using the javascript. 

=cut

use FIG;

use strict;
use HTML;
use CGI;
use raelib;
my $cgi = new CGI;
my $raelib=new raelib;
my $fig;
eval {
    $fig = new FIG;
};

if ($@ ne "")
{
    my $err = $@;

    my(@html);

    push(@html, $cgi->p("Error connecting to SEED database."));
    if ($err =~ /Could not connect to DBI:.*could not connect to server/)
    {
        push(@html, $cgi->p("Could not connect to relational database of type $FIG_Config::dbms named $FIG_Config::db on port $FIG_Config::dbport."));
    }
    else
    {
        push(@html, $cgi->pre($err));
    }
    &HTML::show_page($cgi, \@html, 1);
    exit;
}


my $html=["<title>MySEED Options</title>"];


############### initial settings
#
# At the moment this is just username, but we can put other things here too.
#

my ($cookie, $data)=$raelib->cookie($cgi);


$cgi->param('user') ? $data->{"user"} = $cgi->param('user') : 1 ; 

push @$html, $cgi->start_form(), "<div style='text-align: center'>MySEED Settings</div>",
	"Please enter your username: ", $cgi->textfield(-name=>"user", -value=>$data->{"user"}, -size=>20), $cgi->p;


############## settings for the default seed entry point
#
# 

if (0)
{
   # I can't do this at the moment, because we'd have to put redirects in each of the pages, and I can't figure out how
   # to let you come back to the original page easily

   # settings for index.cgi
   my $entry={
    "start.cgi" => "Basic SEED Entry Point",
    "index.cgi" => "Advanced SEED Entry Point",
    "organisms.cgi?show=cyano" => "CyanoSEED",
    "organisms.cgi?show=rohwer" => "Rohwer Metagenomes",
   };
   
   $data->{"entry"} = $cgi->param('entry') or "start.cgi";
   
   
   push @$html, (
             "\n<a href=\"javascript:toggleLayer('indexcgisettings');\" title=\"Show index.cgi settings\">Settings for the SEED entry page</a>\n",
	     "<div id=indexcgisettings>\n",
	     "Default FIG start page: &nbsp; ", $cgi->popup_menu(-name=>"entry", -value=>[sort keys %$entry], -labels=>$entry, -default=>$data->{"entry"}), "</div>\n"
	     );
}  


################## Settings for subsys.cgi
#
# we can set the default views for subsys.cgi

map {$cgi->param($_) ? eval {$data->{$_}=$cgi->param($_)} : eval {$data->{$_}=0}} (qw[subsys_fp_sort subsys_fp_genomes subsys_sort subsys_clusters subsys_minusone]);

#print STDERR map {"$_\t". $data->{$_}."\n"} keys %$data;


my $fp=['Classification','Subsystem','Curator', 'Number of Roles', 'Version'];
 
my $ss_sort =
{
 "by_variant" => "Variant Code",
 "by_pattern" => "Patterns",
 "unsorted"   => "None",
 "by_phylo"   => "Phylogeny",
 "alphabetic" => "Alphabetical",
 "by_tax_id"  => "Taxonomy",
};

push @$html, (
             "\n<a href=\"javascript:toggleLayer('subsyscgisettings');\" title=\"Show subsys.cgi settings\">Settings for Subsystems display</a>\n",
	     "<div id=subsyscgisettings\n",
             $cgi->b("Settings for the subsystems classification and selection page"), "\n<ul>\n",
	     $cgi->p("Sort subsystem classification page by : ", $cgi->popup_menu(-name=>'subsys_fp_sort', -value=>$fp, -default=>$data->{'subsys_fp_sort'}, -label=>"")),
             $cgi->p("Show number of genomes on first subsystem page: ", $cgi->checkbox(-name=>"subsys_fp_genomes", -checked=>$data->{'subsys_fp_genomes'}, -label=>"")),
	     "\n</ul>\n",
             $cgi->b("Settings for the subsystems view page"), "\n<ul>\n",
	     $cgi->p("Color the page by features that are in clusters: ", $cgi->checkbox(-name=>"subsys_clusters", -checked=>$data->{'subsys_clusters'}, -label=>"")),
	     $cgi->p("Sort the organisms by: ", $cgi->popup_menu(-name=>'subsys_sort', -values=>[keys %$ss_sort], -labels=>$ss_sort)),
	     $cgi->p("Show organisms with a minus one variant code: ", $cgi->checkbox(-name=>"subsys_minusone", -checked=>$data->{'subsys_minusone'}, -label=>"")),
	     "\n</ul>\n",
	     "</div>",
	    );



push @$html, ($cgi->p, $cgi->submit, $cgi->reset, $cgi->p); 





($cookie, $data)=$raelib->cookie($cgi, $data);
&HTML::show_page($cgi, $html, 1, undef, undef, undef, $cookie);





MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3