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

View of /WebApplication/WebConfig.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.14 - (download) (as text) (annotate)
Wed Sep 10 14:07:32 2008 UTC (11 years, 6 months ago) by wilke
Branch: MAIN
CVS Tags: rast_2008_0924, rast_rel_2008_09_30, mgrast_rel_2008_0924, mgrast_rel_2008_0625, rast_rel_2008_10_09, rast_release_2008_09_29, mgrast_rel_2008_0923, mgrast_rel_2008_0919, rast_rel_2008_09_29, mgrast_rel_2008_0917
Changes since 1.13: +1 -1 lines
changed default admin email address

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 );
use Tracer;
use FIG_Config;

1;

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

#
# File system path configurations.
#
use constant TMPL_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;

#
# 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' ] };


#
# 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