Changeset 24379
- Timestamp:
- 2011-08-09T22:21:36+12:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/downloaders/Z3950Download.pm
r17284 r24379 251 251 $strShow = "show $intStartNumber+$intRecordsLeft"; 252 252 $intRecordsLeft = 0; 253 254 253 254 } 255 255 256 256 $strResponse .= $self->get($strShow,$numRecords); 257 257 258 258 if ($strResponse eq ""){ 259 259 print STDERR "<<ERROR: failed to get $numRecords records>>\n"; … … 276 276 my $strFileName = $self->generateFileName($intMaxRecords); 277 277 278 $strOutputDir =~ s/"//g; #" 279 280 my $strOutputFile = &util::filename_cat($strOutputDir,$self->{'host'},"$strFileName.marc"); 278 $strOutputDir =~ s/"//g; #" 279 280 # remove any http:// prefix from the hostname to generate folder-name to store records in 281 my $foldername = $self->{'host'}; 282 $foldername =~ s@^http:\/\/(.*)@$1@; 283 284 my $strOutputFile = &util::filename_cat($strOutputDir,$foldername,"$strFileName.marc"); 281 285 # prepare subdirectory for record (if needed) 282 286 my ($strSubDirPath,$unused) = $self->dirFileSplit($strOutputFile); … … 316 320 while (my $strLine = <$output>) 317 321 { 318 319 322 if ($strLine =~ m/Records: ([\d]*)/i ){ 320 323 $readRecord = 1; 321 324 next; 325 } elsif ($strLine =~ m/<record/i){ # XML output such as from Library of Congress 326 $strFullOutput .= $strLine; 327 $readRecord = 1; 328 next; 322 329 } 323 330 324 return $strFullOutput if ($strLine =~ m/nextResultSetPosition|Not connected/i); 331 if ($strLine =~ m/\<\/record\>/i) { # end of XML, include the closing tag and then terminate below 332 $strFullOutput .= $strLine; 333 } 334 335 return $strFullOutput if ($strLine =~ m/nextResultSetPosition|Not connected|\<\/record\>/i); 325 336 326 337 next if(!$readRecord); … … 389 400 $url = $self->{'url'} unless defined $url; 390 401 391 my $strOpen = $self->start_yaz( );392 393 $strOpen = $self->run_command_with_output("open $url","^Options ");402 my $strOpen = $self->start_yaz($url); 403 404 $strOpen = $self->run_command_with_output("open $url","^Options|Connecting...OK."); 394 405 395 406 $strOpen =~ s/Z> //g;
Note:
See TracChangeset
for help on using the changeset viewer.