#!/usr/bin/perl
package ConfigPathdictyBase_base;

## Author : Shuai Weng
## Date :   July 2001
## Description : This package is to be used by dictyBase programs to 
##               get file paths. It is a subclass of ConfigFile.
##
## See documentation for the usage details. 
##    
## http:///usr/local/dicty/www_dictybase/db/lib/html/dictyBase/programmer/ConfigPathdictyBase.html
##

use strict;
use vars qw (@ISA);

use lib "/usr/local/dicty/www_dictybase/db/lib/common";
use ConfigFile;
@ISA = qw (ConfigFile); # super class


####################################################################
sub dictyBaseMachineStem{
####################################################################
# This method returns the stem of the file path of the server root 
# of the machine where dictyBase is running.  If dictyBase moves to a different
# machine *hopefully* this is the main change that is required to
# still have everything work.

    my ($self) = @_;

    return $self->wineStem;

}

####################################################################
sub dictyBaseHtmlRoot {
####################################################################

    my $self = shift;

    return $self->dictyBaseMachineStem."html/html/";

}

####################################################################
sub tmpDir{
####################################################################
# This method returns the path of the tmp directory to be used by
# dictyBase/dictyBase cgi's

    my ($self) = shift;

    return $self->dictyBaseHtmlRoot."tmp/";

}

#####################################################################
sub helpDir{
#####################################################################
#

    my ($self) = shift;

    return $self->dictyBaseHtmlRoot."help/";

}

#####################################################################
sub gifDir{
#####################################################################
#
    my ($self) = shift;

    return $self->dictyBaseHtmlRoot."images/";

}

#####################################################################
sub dataDir {
#####################################################################
    return "/share/dictyBase/data/";
}

#####################################################################
sub logDir {
#####################################################################
    my ($self, $database) = @_;
    lc ($database);
    return "/share/$database/logs/";
}

#####################################################################
sub dataDir4web {
#####################################################################
    return "/usr/local/dicty/www_dictybase/db/data/";
}

#####################################################################
sub logDir4web {
#####################################################################
    return "/usr/local/dicty/www_dictybase/db/logs/";
}

#####################################################################
sub ftpPubDir {
#####################################################################
    return "/share/ftp/pub/";
}

#####################################################################
sub DictyosteliumFtpPubDir {
#####################################################################
    my ($self) = @_;
    return $self->ftpPubDir."Dictyostelium/";
}

#####################################################################
sub GCGDataDir {
#####################################################################
    return "/share/Dictyostelium/www-data/cgi-bin/gcg/dictyBase/";
}

#####################################################################
sub varTmpDir {
#####################################################################
    return "/var/tmp/";
}

#####################################################################
sub dcbinDir {
#####################################################################
    return "/usr/local/bin/";
}

#####################################################################
sub binDir {
#####################################################################
    return "/share/dictyBase/bin/";
}

#####################################################################
sub netbinDir {
#####################################################################
    return "/tools/net/bin/";
}

#####################################################################
1; ##################################################################
#####################################################################

=pod

=head1 Name

ConfigPathdictyBase.pm

=head1 Description

The ConfigPathdictyBase object can be used to retrieve various file paths 
that are used by dictyBase.

=head1 Instantiating a New ConfigPathdictyBase Object

To make a ConfigPathdictyBase object you simply:

my $configPath = ConfigPathdictyBase->new;

=head1 Accessors

Unless noted otherwise, accesors require no arguments.  All
directories returned by accessors will have a trailing slash character (/).

=head2 dictyBaseMachineStem

Usage : 

$configPath->dictyBaseMachineStem;

This method returns the root of the apache server.

=head2 tmpDir

Usage : 

$configPath->tmpDir;

This method returns the directory where all tmp files should be
located.  The directory is located under the apache html directory, so
can be used to write files and images that need to be read by a browser.

=head2 helpDir

Usage : 

$configPath->helpDir;

This method returns the directory where html help pages may be found.

=head2 gifDir

Usage : 

$configPath->gifDir;

This method returns the directory where image files may be found.


=head2 dateDir

Usage : 

$configPath->dataDir;

This method returns the directory where the datafiles may be found. 
The current version returns "/share/dictyBase/data/".


=head2 logDir

Usage : 

$configPath->logDir($database);

This method returns the directory where the log files may be found. 
The current version returns "/share/dictyBase/logs/" or "/share/dictyBase/logs/"
based on the database name (dictyBase or sdev).

=head2 dateDir4web

Usage : 

$configPath->dataDir4web;

This method returns the directory where the datafiles for web use 
may be found. The current version returns "/usr/local/dicty/www_dictybase/db/data/".

=head2 ftpPubDir 

Usage :

$configPath->ftpPubDir;

This method returns the root directory where ftp files may be found. 
The current version returns "/share/ftp/pub/".

=head2 DictyosteliumFtpPubDir 

Usage :

$configPath->DictyosteliumFtpPubDir;

This method returns the directory where Dictyostelium ftp files may be found. 
The current version returns "/share/ftp/pub/Dictyostelium/".

=head2 varTmpDir

Usage : 

$configPath->varTmpDir;

This method returns the directory where the tmp files may be found. 
The current version returns "/var/tmp/".

=head2 dcbinDir

Usage : 

$configPath->dcbinDir;

This method returns the bin directory for dc_ commands.
The current version returns "/usr/local/bin/".

=head2 netbinDir

Usage : 

$configPath->netbinDir;

This method returns the net bin directory.
The current version returns "/tools/net/bin/".


=head1 AUTHOR

Shuai Weng

shuai@genome.stanford.edu

=cut

