Changeset 24386

Show
Ignore:
Timestamp:
10.08.2011 17:15:09 (8 years ago)
Author:
ak19
Message:

Undoing previous commit to Z3950: z3950 is not supposed to work like SRU protocol which Dr Bainbridge has found to be what the Library of Congress was returning (it was confusing because the yaz-client can communicate with servers implementing multiple protocols including Z3950 and SRU by issuing the same familiar commands).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/downloaders/Z3950Download.pm

    r24379 r24386  
    251251        $strShow = "show $intStartNumber+$intRecordsLeft"; 
    252252        $intRecordsLeft = 0; 
    253          
    254     } 
     253        
     254           } 
    255255     
    256256    $strResponse .= $self->get($strShow,$numRecords); 
    257  
     257          
    258258    if ($strResponse eq ""){ 
    259259        print STDERR "<<ERROR: failed to get $numRecords records>>\n"; 
     
    276276    my $strFileName = $self->generateFileName($intMaxRecords); 
    277277 
    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"); 
     278    $strOutputDir  =~ s/"//g; #" 
     279 
     280    my $strOutputFile = &util::filename_cat($strOutputDir,$self->{'host'},"$strFileName.marc"); 
    285281     # prepare subdirectory for record (if needed) 
    286282    my ($strSubDirPath,$unused) = $self->dirFileSplit($strOutputFile); 
     
    320316   while (my $strLine = <$output>) 
    321317   { 
     318    
    322319       if ($strLine =~ m/Records: ([\d]*)/i ){  
    323320       $readRecord = 1; 
    324321       next;   
    325        } elsif ($strLine =~ m/<record/i){ # XML output such as from Library of Congress 
    326        $strFullOutput .= $strLine; 
    327        $readRecord = 1; 
    328        next; 
    329322       } 
    330323       
    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); 
     324      return $strFullOutput if ($strLine =~ m/nextResultSetPosition|Not connected/i); 
    336325         
    337326      next if(!$readRecord); 
     
    400389   $url = $self->{'url'} unless defined $url; 
    401390 
    402    my $strOpen = $self->start_yaz($url); 
    403  
    404    $strOpen = $self->run_command_with_output("open $url","^Options|Connecting...OK.");   
     391   my $strOpen = $self->start_yaz(); 
     392 
     393   $strOpen = $self->run_command_with_output("open $url","^Options");   
    405394 
    406395   $strOpen =~ s/Z> //g;