#! /usr/bin/perl
#
# A list of links to important data
#
# Absolute paths
# Root of the IFA corpus non-speech distribution
$HomeDir = "$ENV{HOME}/SLcorpus" unless $HomeDir;     # Labels, transcriptions and so on

#
# Allow personalizing outside the distribution
# If there exists a Links.pl file in the parent
# directory of $HomeDir, then this file is used
# instead of the current file. So, copy this file
# to $HomeDir/../ and change it to point to your
# IP addresses/directories. I use this to handle
# 4 computers with 3 databases and 5 distributions.
#
# Skip this file when there is another one higher up
if(-e "$HomeDir/../Links.pl" && !$Done)
{
	$Done = 1;
	do "$HomeDir/../Links.pl";
	return 1;
};

# Default MAIN server URL's (will automatically switch to a local (CGIservlet) 
# server when present)
my $DefaultStaticServer = "http://145.18.230.99/IFAcorpus";
my $DefaultDynamicServer = "http://145.18.230.99/corpus";

# If you want to dish up the static data from some other server set the
# environment variable USE_DEFAULT_STATIC_SERVER
my $UseDefaultStaticServer = $ENV{USE_DEFAULT_STATIC_SERVER};  # Force the default static server

# I normally put the following lines in the httpd.conf file
# For the document root
#     Alias /IFAcorpus/ "/persephone/"
# For the dynamic HTML server
#     ScriptAlias /corpus "/persephone/SLcorpus/WWW/CGIscriptor/CGIscriptor.pl"
#
# This puts the static server at http://host/IFAcorpus
# and the dynamic server at http://host/corpus
# Block this if you want to force the use of the default servers
if($ENV{'HTTP_HOST'})
{
	$DefaultStaticServer = "http://$ENV{'HTTP_HOST'}/IFAcorpus" unless $UseDefaultStaticServer;
	$DefaultDynamicServer = "http://$ENV{'HTTP_HOST'}/Service/corpus";
};

# PostgreSQL database address and other data
# Read-Only access
$DBMSaddress = "localhost";	# Obviously, this should be set to where the database lives
$DBMSname = "ifacorpus";

# These are only used for READ-ONLY access
# Write access is given only to TRUSTED clients
$DBMSuser = "www-data";
$DBMSpassword = "";

# The CVS repository (public access)
$CVSpassword = 'anonymous';
$CVSsource = 'pserver:anonymous@uvafon.hum.uva.nl:/u/cvs';

#
# Some relative paths: e.g., /persephone/SLcorpus and /persephone/SLspeech
$CorpusDirName = 'SLcorpus';
$DataDirName = 'SLspeech';

# A HTTP server URL for dishing up the corpus data directly
# This is something of a kludge to get it to run locally in CGIservlet
# I expect the Dunamic (DHTML) server to live where the requesting server
# lives.
my $DynamicPort = $ENV{'SERVER_PORT'};

# Assign a port to the static server, but only if it is NOT the default port: 80 and there IS a port
my $StaticPort = $DynamicPort;
++$StaticPort if $DynamicPort != 80 && $DynamicPort > 0;

# See whether to use the local servlet or the main Apache server
my $CurrentSTATICserver = $ENV{'SERVER_SOFTWARE'} =~ /CGIservlet\.pl/ && !$UseDefaultStaticServer
                          ? "http://$ENV{'HTTP_HOST'}" : $DefaultStaticServer;
$CurrentSTATICserver =~ s/\:$DynamicPort$/\:$StaticPort/g if $DynamicPort > 80;

# USE $CorpusServer and $DataServer in your scripts!
$CorpusServer = "$CurrentSTATICserver/$CorpusDirName";
$DataServer   = "$CurrentSTATICserver/$DataDirName";

# The Dynamic HTML (scripted) server
# This is something of a kludge to get it to run localy in CGIservlet
$CurrentDYNAMICserver = $ENV{'SERVER_SOFTWARE'} =~ /CGIservlet\.pl/ ? "http://$ENV{'HTTP_HOST'}" : $DefaultDynamicServer;

# USE $DHTMLServer in your scripts!
$DHTMLServer = "$CurrentDYNAMICserver";

# The real paths to the datafiles
$DataPath = "$HomeDir/../SLspeech";  # The recorded speech (can be a link)

#
# Relative paths, should be identical for URL's and real paths
$Sentences = "sentences";
$Chunks = "chunks";
$OGGchunks = "oggchunks";
$CenterOfGravity = "CenterOfGravity";
$Intensity = "Intensity";
$Pitch = "Pitch";
$SmoothPitch = "SmoothPitch";
$Formants = "Formants";
$SmoothFormants = "SmoothFormants";

# The "distribution"
$LabelPath = "$HomeDir/Labels";
$SentenceLabels = "$LabelPath/sentences";
$ChunkLabels = "$LabelPath/chunks";
$ValidationLabels = "$LabelPath/validation";
$Scripts = "$HomeDir/scripts";
$DatabaseTables = "$HomeDir/DatabaseFiles";
$DatabaseScripts = "$HomeDir/DatabaseFiles/scripts";
$TranscriptionsDir = "$HomeDir/Transcriptions";

#
###############################################################################
#
# Copyright R.J.J.H. van Son © 2000, 2001
#
# Author Rob van Son
# Institute of Phonetic Sciences & ACLC
# University of Amsterdam
# Herengracht 338
# NL-1016CG Amsterdam, The Netherlands
# Email: Rob.van.Son@hum.uva.nl
#        ifa@hum.uva.nl
# WWW  : http://www.fon.hum.uva.nl/rob/
# mail:  Institute of Phonetic Sciences
#        University of Amsterdam
#        Herengracht 338
#        NL-1016CG Amsterdam
#        The Netherlands
#        tel +31 205252183
#        fax +31 205252197
#
# License for use and disclaimers
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
#
#######################################################
#
# make require happy
1;
