Changeset 32432 for main/trunk/greenstone2
- Timestamp:
- 2018-09-07T19:39:40+12:00 (6 years ago)
- Location:
- main/trunk/greenstone2/perllib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/servercontrol.pm
r32166 r32432 385 385 # For GS2, we derive the URL from the llssite.cfg file. 386 386 387 my $url = &util::get_full_greenstone_url_prefix($gs_mode, $lib_name); # found largely identical method copied 388 # into util. Don't want duplicates, so calling that from here. 389 390 # either the url is still undef or it is now set 387 # note that unless we pass in $get_public_url=1, we now get the local http URL 388 # by default (e.g. http://127.0.0.1:httpPort/greenstone/library) 389 my $url = &util::get_full_greenstone_url_prefix($gs_mode, $lib_name); # found largely identical method copied 390 # into util.pm. Don't want duplicates, so calling that from here. 391 392 # either the url is still undef or it is now set 391 393 #print STDERR "\n@@@@@ final URL:|$url|\n" if $url; 392 394 #print STDERR "\n@@@@@ URL still undef\n" if !$url; -
main/trunk/greenstone2/perllib/util.pm
r32345 r32432 1292 1292 # 1293 1293 # Designed to work with a server included with GS. 1294 # - For GS3, we ask ant for the library URL.1295 1294 # - For GS2, we derive the URL from the llssite.cfg file. 1295 # - For GS3, we ask ant for the library URL. For GS3, we get the local *http* URL 1296 # by default, something like http://127.0.0.1:<httpPort>/greenstone3/library). 1297 # Pass in $get_public_url=1 to get something like 1298 # <default.protocol>://<tomcat.server>:<default.port>/greenstone/library 1296 1299 1297 1300 sub get_full_greenstone_url_prefix 1298 1301 { 1299 my ($gs_mode, $lib_name ) = @_;1302 my ($gs_mode, $lib_name, $get_public_url) = @_; 1300 1303 1301 1304 # if already set on a previous occasion, just return that … … 1371 1374 # app.name is stored in app.path by build.xml. Need to move app.name in build.properties from build.xml 1372 1375 1373 # Or, run the new target get- default-servlet-url1376 # Or, run the new target get-local-http-servlet-url / get-default-servlet-url 1374 1377 # the output can look like: 1375 1378 # … … 1385 1388 # - see http://stackoverflow.com/questions/799968/whats-the-difference-between-perls-backticks-system-and-exec 1386 1389 1387 # The get- default-servlet-urlant target can be run from anywhere by specifying the1390 # The get-local-http-servlet-url (or get-default-servlet-url) ant target can be run from anywhere by specifying the 1388 1391 # location of GS3's ant build.xml buildfile. Activate.pl can be run from anywhere for GS3 1389 1392 # GSDL3SRCHOME will be set for GS3 by gs3-setup.sh, a step that would have been necessary 1390 1393 # to run the activate.pl script in the first place 1391 1394 1395 # The default is to get-local-http-servlet-url (of the form http://127.0.0.1:<httpPort>/greentone3/library) 1392 1396 my $full_build_xml = &FileUtils::javaFilenameConcatenate($ENV{'GSDL3SRCHOME'},"build.xml"); 1393 1397 1394 my $perl_command = "ant -buildfile \"$full_build_xml\" get-default-servlet-url"; 1398 my $perl_command = $get_public_url ? "get-default-servlet-url" : "get-local-http-servlet-url"; 1399 $perl_command = "ant -buildfile \"$full_build_xml\" $perl_command"; 1395 1400 1396 1401 if (open(PIN, "$perl_command |")) {
Note:
See TracChangeset
for help on using the changeset viewer.