- Timestamp:
- 2017-03-14T20:10:07+13:00 (7 years ago)
- Location:
- main/trunk/greenstone2/perllib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/servercontrol.pm
r31516 r31518 365 365 366 366 sub 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 399 sub OLD_get_library_URL { 367 400 my $self = shift(@_); 368 401 -
main/trunk/greenstone2/perllib/util.pm
r31517 r31518 1227 1227 sub get_full_greenstone_url_prefix 1228 1228 { 1229 my ($gs_mode, $lib_name) = @_; 1230 1229 1231 # if already set on a previous occasion, just return that 1230 1232 # (Don't want to keep repeating this: cost of re-opening and scanning files.) 1231 1233 return $ENV{'FULL_GREENSTONE_URL_PREFIX'} if($ENV{'FULL_GREENSTONE_URL_PREFIX'}); 1232 1234 1233 my $gs_mode = ($ENV{'GSDL3SRCHOME'}) ? "gs3" : "gs2"; 1235 # set gs_mode if it was not passed in (servercontrol.pm would pass it in, any other callers won't) 1236 $gs_mode = ($ENV{'GSDL3SRCHOME'}) ? "gs3" : "gs2" unless defined $gs_mode; 1234 1237 1235 1238 my $url = undef; … … 1328 1331 } 1329 1332 close(PIN); 1333 1334 if (defined $lib_name) { # url won't be undef now 1335 # replace the servlet_name portion of the url found, with the given library_name 1336 $url =~ s@/[^/]*$@/$lib_name@; 1337 } 1330 1338 } else { 1331 1339 print STDERR "util::get_full_greenstone_url_prefix() failed to run $perl_command to work out library URL for $gs_mode\n";
Note:
See TracChangeset
for help on using the changeset viewer.