Ignore:
Timestamp:
2017-03-14T20:10:07+13:00 (7 years ago)
Author:
ak19
Message:

Found servercontrol::get_library_url() largely duplicated in util.pm as get_fullgreenstone_url_prefix(). Merging the two functions. Tested that solr-jdbm-demo collection still rebuilds (with and without tomcat running, and with and without port change between sessions).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/servercontrol.pm

    r31516 r31518  
    365365
    366366sub get_library_URL {
     367    my $self = shift(@_);
     368   
     369    # For web servers that are external to a Greenstone installation,
     370    # the user can pass in their web server's library URL.
     371    if($self->{'library_url'}) {
     372    return $self->{'library_url'};
     373    }
     374   
     375    # For web servers included with GS (like tomcat for GS3 and server.exe
     376    # and apache for GS2), we work out the library URL:
     377    my ($gs_mode, $lib_name); # gs_mode can be gs3 or gs2, lib_name is the custom servlet name
     378    $gs_mode = $self->{'gs_mode'};
     379    $lib_name = $self->{'library_name'};
     380   
     381    # If we get here, we are dealing with a server included with GS.
     382    # For GS3, we ask ant for the library URL.
     383    # For GS2, we derive the URL from the llssite.cfg file.
     384
     385    my $url = &util::get_full_greenstone_url_prefix($gs_mode, $lib_name); # found largely identical method copied
     386            # into util. Don't want duplicates, so calling that from here.
     387   
     388    # either the url is still undef or it is now set
     389    #print STDERR "\n@@@@@ final URL:|$url|\n" if $url;     
     390    #print STDERR "\n@@@@@ URL still undef\n" if !$url;
     391   
     392    if (defined $url) {
     393        $self->{'library_url'} = $url;
     394    }
     395
     396    return $url;
     397}
     398
     399sub OLD_get_library_URL {
    367400    my $self = shift(@_);   
    368401   
Note: See TracChangeset for help on using the changeset viewer.