[Koha] Koha's Z39.50 Server

Joshua Ferraro jmf at kados.org
Sat Jan 10 09:23:33 NZDT 2004


Hiya,

I've just committed a _basic_ Z3950 Server to CVS (in the HEAD Branch; in
the z3950/server/ directory) and I wanted to make a few comments about it.

(BTW: is everyone ok with moving the files in z3950 to z3950/client/ ?)

First of all, the it's built using Indexdata's SimpleServer perl module
Version 0.07, so if you want to use it you will have to install SimpleServer
which you can get from:

http://ftp.indexdata.dk/pub/simpleserver/

(BTW: whoever is doing the Koha installation script and documentation on
dependencies may want to add SimpleServer).

Secondly, you will need to change the leader information in Koha's
MARCgetbiblio subroutine in Biblio.pm to reflect the following (or if you
know how to manipulate the leader you can change it to reflect your data;
this example leader should be functional for all MARC21 data).  Look for
the following near line 700:

#---- TODO : the leader is missing
        $record->leader('                        ');

and change it to:

#---- TODO : the leader is partly fixed for MARC21
        $record->leader('     nac  22     1u 4500');

(BTW, Paul, you said to remind you to commit this change to CVS; I'm not
sure but I wouldn't be surprised if UNIMARC's leaders were a bit different,
so maybe we should hold off on that; also, I've also got some other leader
qualms but they will have to wait for another email)

So the actual server is implemented in a single Perl script for now (I
plan to break it up for the next version) and you can get it from CVS or
from my website at:

http://kados.org/LibraryScience/zed-koha-server.pl

(it's there for the folks who don't use CVS)

You may need to change the permissions on the script--as root run:

[jmf at koha]koha#chmod 755 zed-koha-server.pl

Run the zed-koha-server.pl script as root:

[jmf at koha]#./zed-koha-server.pl

The server will take care of managing the network connections for you (it
runs on port 9999), and it will spawn a new process whenever a new
connection is received.  The script implements a search handler and a
fetch handler which allows Z3950 clients to query and retrieve records
in MARC21 (the only record format it supports so far).  It's set up to log
to the terminal so you will need to keep the terminal running or the script
will stop (I think it's the same with Koha's Z3950-Client; some day it would
be nice to log to a file and run it as a service...).

Let me say a word about holdings data.  Right now, for historical reasons,
most MARC21 installations of Koha probably use the 852 tag to store holdings
data (actually I'm not sure there are any other MARC21 installations of Koha
besides Nelsonville :-) ).
For example, Nelsonville Public Library uses the following:
852a  Organization code
852b  Home branch
852h  Classification
852p  Barcode

However, many Z3590 clients aren't set up to pull holdings data from the
852x fields but from the 952x/942x fields.  So for now I've hard-coded the
server to automatically duplicate the data like this:

## Convert from 852/4 to 952:
## 942a --> 852a  Organization code
## 952b --> 852b  Home branch
## 942k --> 852h  Classification
## 952p --> 852p  Barcode

So the MARC record has the data in both places.

If you're fluent in Perl and you look through the documentation for
SimpleServer you will see that I have implemented query-parsing using a
series of very clumsy substitutions.  Right now I'm working on rewriting
the search_handler to use the RPN member which will allow for much cleaner
parsing of the query and will make it much easier to implement new features
like Boolean.  But the clumsy version should work fine in most
cases--Nelsonville Public Library System has been using it for about two
months to interface with the statewide resource sharing program MORE with
no problems.

I think that's it.  Let me know how it works out or if you have any
questions.

--
Joshua Ferraro



More information about the Koha mailing list