[Koha] Problem with Z39.50 servers, bug (and fix) in processz3950queue?

Marilen Corciovei marilen.corciovei at nemesisit.ro
Tue Apr 11 23:46:59 NZST 2006


Hello everybody,

I am strugling with koha and Z39.50 servers for a while now. Apparently
no server except UNIV OF NORTHERN WALES 147.143.2.5:210 INNOPAC worked
for me. So I decided to write a simple program in perl to test the
Z39.50 functionality. After solving problems revealed here:
http://lists.indexdata.dk/pipermail/net-z3950/2003-October/000356.html
and here:
http://lists.indexdata.dk/pipermail/net-z3950/2002-July/000136.html I
managed to write a working program:

#!/usr/bin/perl

use Net::Z3950;

#$conn = new Net::Z3950::Connection("LIBRARY.MIT.EDU", 9909,
databaseName => "mit01")
#$conn = new Net::Z3950::Connection("Z3950cat.bl.uk", 9909, databaseName
=> "BLAC")
#$conn = new Net::Z3950::Connection("z3950.nls.uk", 7290, databaseName
=> "Endeavor")
#$conn = new Net::Z3950::Connection("bobcat.nyu.edu", 210, databaseName
=> "GEAC")
$conn = new Net::Z3950::Connection("z3950.loc.gov", 7090, databaseName
=> "Voyager")
    or die $!;
$conn->option('preferredRecordSyntax',
	              Net::Z3950::RecordSyntax::USMARC);
$rs = $conn->search("\@attr 1=7 \"3764353651\"")
    or die $conn->errmsg();
#$rs->option(preferredRecordSyntax => "SUTRS");
#$rs->option(preferredRecordSyntax => "XML");
#$rs->option(elementSetName => "B");

my $n = $rs->size();
$rs->present(1, $n);
print "found $n records:\n";
foreach $i (1..$n) {
    $rec = $rs->record($i) or die $rs->errmsg();
    print $rec->render();
}

$conn->close();

Then I looked in the processz3950queue and found:

eval { $conn->option(preferredRecordSyntax =>
Net::Z3950::RecordSyntax::USMARC);} if ($globalsyntax eq "MARC21");
eval { $conn->option(preferredRecordSyntax =>
Net::Z3950::RecordSyntax::UNIMARC);} if ($globalsyntax eq "UNIMARC");

however there is no MARC21 choice in z3950servers.tmpl:

<select name="syntax">
         <option value="USMARC">USMARC</option>
         <option value="UNIMARC">UNIMARC</option>
</select>

I realized then that changing MARC21 to USMARC fixes the problem. Now I
can succesfully use the library of congress in my searches. 

eval { $conn->option(preferredRecordSyntax =>
Net::Z3950::RecordSyntax::USMARC);} if ($globalsyntax eq "USMARC");

Hopefully this will come handy for someone else to running into the same
problem.

Best regards,
Len

Marilen Aretius Corciovei
J2EE, Linux Consultant
http://len.is-a-geek.org
http://www.nemesisit.ro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.katipo.co.nz/pipermail/koha/attachments/20060411/319493c2/attachment.html


More information about the Koha mailing list