[Bio] / WebApplication / WebConfig.pm Repository:
ViewVC logotype

View of /WebApplication/WebConfig.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.20 - (download) (as text) (annotate)
Tue Sep 29 13:48:57 2009 UTC (10 years, 8 months ago) by paczian
Branch: MAIN
CVS Tags: mgrast_dev_08112011, mgrast_dev_08022011, mgrast_dev_03052011, mobedac_release_05302012, mgrast_dev_05262011, mgrast_dev_04082011, rast_rel_2010_0928, mgrast_version_3_2, mgrast_dev_12152011, mgrast_dev_06072011, rast_rel_2010_0526, mgrast_dev_02212011, rast_rel_2010_1206, mgrast_release_3_0, mgrast_dev_03252011, rast_rel_2010_0118, rast_rel_2011_0119, 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, mgrast_dev_04012011, rast_rel_2010_0827, myrast_33, rast_rel_2011_0928, mgrast_dev_04052011, mgrast_dev_02222011, mgrast_dev_10262011
Changes since 1.19: +4 -4 lines
login dependencies are now all vs all

package WebConfig;

use strict;
use warnings;

use base qw(Exporter);
our @EXPORT = qw ( CSS_PATH TMPL_PATH JS_PATH IMAGES HMTL_PATH CGI_PATH TEMP_PATH TMPL_URL_PATH );
use Tracer;
use FIG_Config;

1;

#******************************************************************************
#* GLOBAL CONFIGURATION
#******************************************************************************

#
# File system path configurations.
#
use constant TMPL_PATH  => "$FIG_Config::fig/CGI/Html/";
use constant TMPL_URL_PATH  => "./Html/";
use constant CFG_PATH   => "$FIG_Config::fig_disk/config/WebApplication/";
use constant TEMP_PATH  => $FIG_Config::temp;
#
# URL path configurations.
#
use constant CGI_PATH   => "$FIG_Config::cgi_url/";
use constant CSS_PATH   => "$FIG_Config::cgi_url/Html/";
use constant JS_PATH    => "$FIG_Config::cgi_url/Html/";
use constant IMAGES     => "$FIG_Config::cgi_url/Html/";
use constant HTML_PATH  => "$FIG_Config::cgi_url/Html/";

#
# Database settings
#
our $DBNAME = 'WebAppBackend';
our $DBHOST = 'localhost';
our $DBUSER = 'root';
our $DBPWD  = '';
our $DBPORT = undef;
our $NODB   = undef;
#
# Default values for the web application
#
our $APPLICATION_NAME = 'WebApplication';
our $APPLICATION_URL  = 'http://bioseed.mcs.anl.gov/';
our $ADMIN_EMAIL = 'paczian@mcs.anl.gov';

#
# Login dependencies are used to grant login rights
# to web applications a backend depends on. 
# rf. to User->grant_login_right
#
our $LOGIN_DEPENDENCIES = { 'RAST'       => [ 'SeedViewer', 'MGRAST', 'PRAST' ],
			    'SeedViewer' => [ 'RAST', 'MGRAST', 'PRAST' ],
			    'MGRAST'     => [ 'RAST', 'SeedViewer', 'PRAST' ],
			    'PRAST'      => [ 'RAST', 'SeedViewer', 'MGRAST' ] };


#
# Method to import local configurations 
# from config/WebApplication/BackendName.cfg
#
sub import_local_config {
  my $application = shift;
  if (ref($application)) {
    $application = $application->backend->name();
  }
  no strict;
  {
    my $local = CFG_PATH.$application.'.cfg';
    unless ($return = do $local) {
      if ($@) {
        Warn("Couldn't parse $local: $@") if T(0);
      } elsif (! defined $return) {
        Warn("Couldn't do $local.") if T(1);
      } elsif (! $return) {
        Warn("Couldn't run $local.") if T(1);
      }
    }
  }
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3