Changeset 16415

Show
Ignore:
Timestamp:
15.07.2008 16:35:38 (11 years ago)
Author:
ak19
Message:

Introduced GSDL3HOME variable for the case where a GS3server is remote

Location:
greenstone3/trunk/web/WEB-INF/cgi
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/web/WEB-INF/cgi/gliserver.pl

    r16405 r16415  
    369369    # Show the values of some important environment variables 
    370370    $installation_status .= "\n"; 
    371     $installation_status .= "GSDL3SRCHOME: " . $ENV{'GSDL3SRCHOME'} . "\n" unless ($gsdl_cgi->greenstone_version() == 2); 
     371    if($gsdl_cgi->greenstone_version() != 2) { 
     372    $installation_status .= "GSDL3SRCHOME: " . $ENV{'GSDL3SRCHOME'} . "\n"; 
     373    $installation_status .= "GSDL3HOME: " . $ENV{'GSDL3HOME'} . "\n"; 
     374    } 
    372375    $installation_status .= "GSDLHOME: " . $ENV{'GSDLHOME'} . "\n"; 
    373376    $installation_status .= "GSDLOS: " . $ENV{'GSDLOS'} . "\n"; 
  • greenstone3/trunk/web/WEB-INF/cgi/gsdlCGI.pm

    r16405 r16415  
    260260 
    261261    return $gsdlhome; 
     262} 
     263 
     264sub get_gsdl3_home { 
     265    my $self = shift @_; 
     266    my ($optional) = @_; 
     267     
     268    if (defined $self->{'gsdl3home'}) { 
     269    return $self->{'gsdl3home'}; 
     270    } 
     271 
     272    my $gsdl3home = $self->get_config_info("gsdl3home", $optional); 
     273 
     274    if(defined $gsdl3home) { 
     275    $gsdl3home =~ s/(\/|\\)$//; # remove trailing slash 
     276    $self->{'gsdl3home'} = $gsdl3home; 
     277    } 
     278    return $gsdl3home; 
    262279} 
    263280 
     
    387404sub setup_gsdl { 
    388405    my $self = shift @_; 
     406    my $optional = 1; # ignore absence of specified properties in gsdl(3)site.cfg if not found 
    389407 
    390408    my $gsdlhome = $self->get_gsdl_home(); 
     
    395413    my $library_url = $self->get_library_url_suffix(); # best to have GSDLOS set beforehand 
    396414    $self->{'library_url_suffix'} = $library_url; 
    397      
     415 
     416    require "$gsdlhome/perllib/util.pm"; 
     417 
    398418    if($self->{'greenstone_version'} == 3) { 
    399419    my $gsdl3srchome = $self->get_gsdl3_src_home(); 
    400     $ENV{'GSDL3SRCHOME'} = $gsdl3srchome;    
     420    $ENV{'GSDL3SRCHOME'} = $gsdl3srchome; 
     421 
     422    my $gsdl3home = $self->get_gsdl3_home($optional); 
     423    # if a specific location for GS3's web folder is not provided, 
     424    # assume the GS3 web folder is in the default location 
     425    if(!defined $gsdl3home) {  
     426        $gsdl3home = &util::filename_cat($ENV{'GSDL3SRCHOME'}, "web"); 
     427        $self->{'gsdl3home'} = $gsdl3home; 
     428    }  
     429    $ENV{'GSDL3HOME'} = $gsdl3home; 
    401430    }  
    402  
    403     require "$gsdlhome/perllib/util.pm"; 
     431    
    404432     
    405433    my $gsdl_bin_script = &util::filename_cat($gsdlhome,"bin","script"); 
     
    428456    # gsdl(3)site.cfg can specify JAVA_HOME and FEDORA_HOME along with Fedora's version. Both 
    429457    # are needed (by scripts g2f-import and g2f-buildcol) when using Greenstone 2 with Fedora. 
    430     my $optional = 1; # ignore absence of these properties in gsdl(3)site.cfg if not found 
    431  
    432458    if(!defined $ENV{'JAVA_HOME'}) { 
    433459    $ENV{'JAVA_HOME'} = $self->get_java_home($optional);