#!/usr/local/bin/perl ############################################################################### # Program : main.cgi # Author : Eric Deutsch # $Id$ # # Description : This script authenticates the user, and then # displays the opening access page. # # SBEAMS is Copyright (C) 2000-2005 Institute for Systems Biology # This program is governed by the terms of the GNU General Public License (GPL) # version 2 as published by the Free Software Foundation. It is provided # WITHOUT ANY WARRANTY. See the full description of GPL terms in the # LICENSE file distributed with this software. # ############################################################################### ############################################################################### # Set up all needed modules and objects ############################################################################### use strict; use Getopt::Long; use FindBin; use File::Basename; use lib "$FindBin::Bin/../lib/perl"; use vars qw ($sbeams $sbeamsMOD $q $current_contact_id $current_username $PROG_NAME $USAGE %OPTIONS $QUIET $VERBOSE $DEBUG $TESTONLY $TABLE_NAME $PROGRAM_FILE_NAME $CATEGORY $DB_TABLE_NAME @MENU_OPTIONS); use SBEAMS::Connection qw($q $log); use SBEAMS::Connection::Settings; use SBEAMS::Connection::Tables; use SBEAMS::Connection::TabMenu; $sbeams = new SBEAMS::Connection; # use CGI; #$q = new CGI; ############################################################################### # Set program name and usage banner for command line use ############################################################################### $PROG_NAME = $FindBin::Script; $USAGE = <Authenticate() and exit if it fails or continue if it works. ############################################################################### sub main { #### Do the SBEAMS authentication and exit if a username is not returned exit unless ($current_username = $sbeams->Authenticate( #permitted_work_groups_ref=>['xxx','yyy'], #connect_read_only=>1, #allow_anonymous_access=>1, )); #### Read in the default input parameters my %parameters; my $n_params_found = $sbeams->parse_input_parameters( q=>$q,parameters_ref=>\%parameters); #$sbeams->printDebuggingInfo($q); #### Process generic "state" parameters before we start $sbeams->processStandardParameters(parameters_ref=>\%parameters); #### Decide what action to take based on information so far if (defined($parameters{action}) && $parameters{action} eq "???") { # Some action } else { $sbeams->display_page_header(); handle_request(ref_parameters=>\%parameters); $sbeams->display_page_footer(); } } # end main ############################################################################### # Handle Request ############################################################################### sub handle_request { my %args = @_; #### Process the arguments list my $ref_parameters = $args{'ref_parameters'} || die "ref_parameters not passed"; my %parameters = %{$ref_parameters}; #### Print out the current user information $sbeams->printUserContext(); $current_contact_id = $sbeams->getCurrent_contact_id(); #### Write some welcoming text print qq~

Welcome to the Systems Biology Experiment Analysis Management System (SBEAMS) interface. Please check your current work group and current project listed above and change it via the pull down menus if desired, or use the list of projects below.

The modules available to you are listed on the navigation bar on the left. Enter the interface for one of the available modules by clicking on it.

This system is still under active development. Please report bugs, problems, difficulties, and suggestions to your local $DBTITLE administrator: $DBADMIN.

~; #### If this is an ISB site, display the in-development IntegrateResultsets #### This is not expected to work at other site yet. if ($sbeams->getSite() eq 'ISB') { print qq~

To integrate resultsets from queries in multiple modules (e.g., Interactions, Microarray, and Proteomics) and visualize with Cytoscape, try out the new, experimental IntegrateResultsets interface.

~; } my $html_ref = $sbeams->getMainPageTabMenu( cgi => $q ); print qq~
$$html_ref ~; } # end handle_request