Changeset 32830 for main/trunk/greenstone2/perllib/servercontrol.pm
- Timestamp:
- 2019-02-28T22:00:57+13:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/servercontrol.pm
r32826 r32830 117 117 sub config { 118 118 my $self = shift(@_); 119 my ($command, $check_message_against_regex, $expected_error_code, $silent ) = @_;119 my ($command, $check_message_against_regex, $expected_error_code, $silent, $oai_servlet) = @_; 120 120 121 121 my $library_url = $self->get_library_URL(); #$self->{'library_url'}; 122 122 if($oai_servlet) { # if asked to contact the oaiserver servlet, then 123 # replace the library servlet name with oaiserver servlet name 124 $library_url =~ s@([^/]*?)$@$oai_servlet@; 125 } 123 126 124 127 # Gatherer.java's configGS3Server doesn't use the site variable … … 279 282 } 280 283 elsif ($gs_mode eq "gs3") { 284 $self->print_msg("\t- Main library servlet\n"); 281 285 my $DEACTIVATE_COMMAND = "?a=s&sa=d&st=collection&sn="; 282 286 my $check_message_against_regex = "collection: $qualified_collection deactivated"; 283 287 $self->config($DEACTIVATE_COMMAND.$qualified_collection, $check_message_against_regex); 288 289 # and deactivate the collection on OAIserver url too. 290 # NOTE: if it's not an OAI collection, then the message that the collection is "not enabled for OAI" is EXPECTED. Another possible valid outcome. 291 $self->print_msg("\t- OAI servlet\n"); 292 $DEACTIVATE_COMMAND = "?deactivate="; 293 $check_message_against_regex = "(collection\: $qualified_collection deactivated|collection\: $qualified_collection is not enabled for OAI.)"; 294 $self->config($DEACTIVATE_COMMAND.$qualified_collection, $check_message_against_regex, undef, undef, "oaiserver"); 284 295 } 285 296 } … … 297 308 } 298 309 elsif ($gs_mode eq "gs3") { 310 $self->print_msg("\t- Main library servlet\n"); 299 311 my $ACTIVATE_COMMAND = "?a=s&sa=a&st=collection&sn="; 300 312 my $check_message_against_regex = "collection: $qualified_collection activated"; 301 313 $self->config($ACTIVATE_COMMAND.$qualified_collection, $check_message_against_regex); 314 315 # and activate the collection on OAIserver url too. 316 # NOTE: if it's not an OAI collection, then the message that the collection is "not enabled for OAI" is EXPECTED. Another possible valid outcome. 317 $self->print_msg("\t- OAI servlet\n"); 318 $ACTIVATE_COMMAND = "?activate="; 319 $check_message_against_regex = "(collection\: $qualified_collection activated|collection\: $qualified_collection is not enabled for OAI.)"; 320 $self->config($ACTIVATE_COMMAND.$qualified_collection, $check_message_against_regex, undef, undef, "oaiserver"); 302 321 } 303 322 } … … 544 563 sub config_old { 545 564 my $self = shift(@_); 546 my ($command, $check_message_against_regex, $expected_error_code, $silent ) = @_;565 my ($command, $check_message_against_regex, $expected_error_code, $silent, $oai_servlet) = @_; 547 566 548 567 my $library_url = $self->get_library_URL(); #$self->{'library_url'}; 549 568 if($oai_servlet) { # if asked to contact the oaiserver servlet, then 569 # replace the library servlet name with oaiserver servlet name 570 $library_url =~ s@([^/]*?)$@$oai_servlet@; 571 } 550 572 551 573 # Gatherer.java's configGS3Server doesn't use the site variable
Note:
See TracChangeset
for help on using the changeset viewer.