Net-Z3950-Simple2ZOOM-1.04/0000755000175000017500000000000011213227655013372 5ustar mikemikeNet-Z3950-Simple2ZOOM-1.04/Makefile.PL0000644000175000017500000000277511213227327015353 0ustar mikemike# $Id: Makefile.PL,v 1.10 2009-06-08 15:31:35 mike Exp $ use 5.008; use ExtUtils::MakeMaker; use strict; my $yazver = `yaz-config --version`; if (!$yazver) { die qq[ ERROR: Unable to call script: yaz-config If you are using a YAZ installation from the Debian package "yaz", you will also need to install "libyaz-dev" in order to build this module. ]; } chomp($yazver); check_version($yazver, "3.0.10"); WriteMakefile( NAME => 'Net::Z3950::Simple2ZOOM', VERSION_FROM => 'lib/Net/Z3950/Simple2ZOOM.pm', # finds $VERSION PREREQ_PM => { "Data::Dumper" => 2.121, "XML::Simple" => 2.14, "Net::Z3950::SimpleServer" => 1.08, "Net::Z3950::ZOOM" => 1.19, "LWP::UserAgent" => 2.033, "URI::Escape" => 3.28, "XML::LibXML" => 1.59, "MARC::Record" => 1.38, "MARC::File::XML" => 0.84, # Debian package libmarc-xml-perl "Time::HiRes" => 1.86, }, ABSTRACT_FROM => 'lib/Net/Z3950/Simple2ZOOM.pm', AUTHOR => 'Sebastian Hammer and colleagues', EXE_FILES => [ 'bin/simple2zoom' ], ); sub check_version { my($got, $want) = @_; my($gmajor, $gminor, $gtrivial) = ($got =~ /(\d+)\.(\d+)\.(\d+)/); my($wmajor, $wminor, $wtrivial) = ($want =~ /(\d+)\.(\d+)\.(\d+)/); if (($gmajor < $wmajor) || ($gmajor == $wmajor && $gminor < $wminor) || ($gmajor == $wmajor && $gminor == $wminor && $gtrivial < $wtrivial)) { print <<__EOT__; *** ERROR! Simple2ZOOM requires at least version $want of YAZ, but you only have version $got. __EOT__ exit 1; } } Net-Z3950-Simple2ZOOM-1.04/README0000644000175000017500000000240410643461737014261 0ustar mikemike$Id: README,v 1.2 2007-07-06 15:46:39 mike Exp $ Net-Z3950-Simple2ZOOM ===================== This module implements a program, simple2zoom, which acts as a general-purpose gateway between the two standard information retrieval protocols ANSI/NISO Z39.50-2003 and SRU/SRW. It's not likely that the library modules will be useful for any other purpose. Information about Z39.50 is available at the maintenancy agency site: http://www.loc.gov/z3950/agency/document.html Information about SRU and its brother SRW is available from: http://www.loc.gov/standards/sru/ INSTALLATION To install this module type the following: perl Makefile.PL make make test make install DEPENDENCIES This module requires these other modules and libraries: - the Net::Z3950::SimpleServer Perl module - the Net::Z3950::ZOOM Perl module These in turn rely on the YAZ toolkit's Generic Frontend Server (for the server side) and ZOOM API (for the client side) to handle the Z39.50 and SRU/SRW protocol mechanics. COPYRIGHT AND LICENCE Copyright (C) 2007 by Index Data. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available. Net-Z3950-Simple2ZOOM-1.04/Changes0000644000175000017500000001325611213227615014670 0ustar mikemike$Id: Changes,v 1.40 2009-06-08 15:34:37 mike Exp $ Revision history for Perl extension Net::Z3950::Simple2ZOOM. 1.04 Mon Jun 8 16:31:57 BST 2009 - Fix off-by-one in Present handler, as suggested by Simon Jacob of the National Library of Australia. 1.03 Mon Apr 14 11:35:24 BST 2008 Improvements to _format_grs1(), provided by Simon Jacob of the National Library of Australia : - The namespace prefix "x" is made available for GRS-1 record configuration to refer to the top-level namespace. - Multiple occurrences of the same XML element are now translated into separate occurrences of the corresponding GRS-1 element rather than being concatenated into a single value. Also: - Reporting of exception-handling is now requested by setting the S2Z_EXCEPTION_DEBUG environment variable to 1 (or 2 for extra verbosity). 1.02 Fri Nov 23 12:10:35 GMT 2007 - Use the present handler to optimise situations in which the client is requesting multiple records in a single bite: previously, the server would be hit once for each record. 1.01 Wed Sep 26 13:18:47 BST 2007 - Use Time::HiRes to instrument where time is spent. Operation timings are emitted if the module-global $TIME is set (so at present the only way to turn this on and off is by tweaking the boolean in the source code). 1.00 Fri Sep 21 15:44:50 BST 2007 - Add new "gsafd" database to test.xml. This is an OCLC SRU server that correctly implements result-set IDs and RSID searching. - Otherwise identical to v0.94 (which was really the last of the 1.0-prerelease versions). With this version, the software is ready for public release. 0.94 Fri Sep 14 15:42:48 BST 2007 - Corrected handling of queries that include result-set references. - Result-set reference handling is now configurable to use either a corresponding result-set reference at the back end or a re-executed query. - Documentation of the above. 0.93 Wed Sep 12 11:04:10 BST 2007 - Correct handling of record-surrogate diagnostics provided by ZOOM-C (when YAZ version 3.0.12 or better is available). 0.92 Mon Sep 10 18:43:59 BST 2007 - Pass username/password tokens through into ZOOM-C. - Support for translating result-set IDs in Type-1 queries. - Initial searches do not fetch any records (presentChunk is set to 0) so that subsequent records fetches, when the client's fetch request has arrived and so the required schema is known, do not get bad cache-hits. - Request MARCXML schema if client wants USMARC records. - Correct handling of completeness attributes. - Handle BIB-1 relation attributes. - Correctly generate and recognise cql.resultSetId for result-set references, rather than cql.resultSet as before. - Detect, parse, translate and report surrogate diagnostic records. - Configurable schema handling: each database may nominate a set of Z39.50 schema OIDs which, if requested, cause a particular SRU schema to be requested from the back-end, and the resulting records translated into the appropriate MARC format. NOTE that in its current form this only works for the specific though common combination of Z39.50 front-end, SRU back-end and MARC record syntax. 0.91 Sat Sep 1 10:38:21 BST 2007 - Support for CCL queries added to the YAZ GFS, therefore to SimpleServer, therefore to Simple2ZOOM. Requires YAZ version 3.0.9 or later. - Added new files to etc directory to configure CCL support: yazgfs.xml is a YAZ GFS configuration file, and ccl-qualifiers maps qualifiers to BIB-1 attributes. - Support for the Scan service. - Support translation of truncation attributes 101 (process # in search term) and 104 (Z39.58) into CQL. (Only partial in the latter case since CQL wildcards have no equivalent of /ana?4titan/.) - Support for the Delete Result Set service -- sort of. Since SRU in fact has no analogous service, all the gateway can do is accept Delete requests and quietly no-op. - Configurable HTTP-based authentication. - Add a trivial sample authenticator script, etc/sru-auth - Add etc/README to describe the increasing number of files in that directory. - Support for the Sort service, subject to several provisos, the most important being that due to limitations in ZOOM-C (as of YAZ 3.0.10), sorting no-ops against SRU 1.1 back-ends. It works correctly against both Z39.50 and SRU 1.2 back-ends. - Support for the SUTRS record syntax. - Support for the MARC record syntax. - Simple support for the GRS-1 record syntax. 0.90 Fri Aug 10 23:26:00 BST 2007 (INITIAL RELEASE of 10th August 2007 -- 1.0 pre-release) Basic Z39.50/SRU Gateway implementing connection management and the Init, Search and Present services, including Type-1 to CQL query translation, and XML to Z39.50 response record translation. NOT INCLUDED IN THIS RELEASE although is was scheduled to be: handling CCL queries by translation into CQL. 0.10 Fri Jul 6 16:59:47 BST 2007 - Functionally equivalent to the old code, but now packaged in a CPAN-friendly way. Version number bumped to 0.10 in this initial "null release" to match the version number 0.1 in the pre-framework code, which has been distributed to some customers, since the functionality is identical. 0.01 Fri Jul 6 16:12:13 2007 - original version; created by h2xs 1.23 with options -X --name=Net::Z3950::Simple2ZOOM --compat-version=5.8.0 --omit-constant --skip-exporter --skip-ppport (The core code is rather older than this, and goes back at least to Seb's CVS revision 1.1 of the main script, checked in on 31st March 2006. The date above marks the first version to be Perl-module packaged, as a step towards making a public release.) Net-Z3950-Simple2ZOOM-1.04/META.yml0000644000175000017500000000151011213227655014640 0ustar mikemike--- #YAML:1.0 name: Net-Z3950-Simple2ZOOM version: 1.04 abstract: Gateway between Z39.50 and SRU/SRW license: ~ author: - Sebastian Hammer and colleagues generated_by: ExtUtils::MakeMaker version 6.42 distribution_type: module requires: Data::Dumper: 2.121 LWP::UserAgent: 2.033 MARC::File::XML: 0.84 MARC::Record: 1.38 Net::Z3950::SimpleServer: 1.08 Net::Z3950::ZOOM: 1.19 Time::HiRes: 1.86 URI::Escape: 3.28 XML::LibXML: 1.59 XML::Simple: 2.14 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.3.html version: 1.3 Net-Z3950-Simple2ZOOM-1.04/bin/0000755000175000017500000000000011213227655014142 5ustar mikemikeNet-Z3950-Simple2ZOOM-1.04/bin/simple2zoom0000755000175000017500000001100710670234527016351 0ustar mikemike#!/usr/bin/perl -w ######################## # simple2zoom -- Swiss-army simpleserver-->zoom gateway # Copyright (c) 2006 Index Data # Written by Sebastian Hammer and Mike Taylor # $Id: simple2zoom,v 1.18 2007-09-07 11:43:19 mike Exp $ # # Run like this: # perl -I../lib ./simple2zoom -c ../etc/test.xml @:9998 # # Dynamically configurable using virtual database-name like: # cfg:key1=val1&key2=val2... # For example: # cfg:preferredRecordSyntax=xml&address=localhost:8018//IR-Explain---1 # But PLEASE BE AWARE that, like Unix filenames with spaces in, # complex "database names" like these often get parsed when you don't # want them to. Neither yaz-client nor zoomsh handles Z-target # strings with database-names like these "correctly" (i.e. in the way # we want them to). # # To run the server from its source, use: # cd /usr/local/src/cvs/simple2zoom/bin && perl -I../lib ./simple2zoom -c ../etc/test.xml -- -S -f ../etc/yazgfs.xml # For a simple regression-test, use: # cd /usr/local/src/cvs/simple2zoom/bin && perl -I../lib ./simple2zoom -c ../etc/test.xml -- -1 -f ../etc/yazgfs.xml & (sleep 1; ( echo "find mineral"; echo "format sutrs"; echo "show 1") | yaz-client localhost:9998/gils ) use Getopt::Std; use Net::Z3950::Simple2ZOOM; use strict; use warnings; my %opts; if (!getopts("c:", \%opts)) { print STDERR "Usage: $0 [-c ] [-- YAZ-options]\n"; exit 1; } my $s2z = new Net::Z3950::Simple2ZOOM($opts{c}); $s2z->launch_server("simple2zoom", @ARGV); =head1 NAME simple2zoom - generic Swiss Army Server for proxying between IR standards =head1 SYNOPSIS C [ C<-c> I ] [ C<--> I ] [ I ... ] =head1 DESCRIPTION C provides a generic gateway between the Z39.50 and SRU/SRW Information Retrieval protocols. Because it relies on the C and C modules for the server and client funcationality respectively, because both of these modules are based on the YAZ toolkit, and because YAZ transparently handles all three standard IR protocols (ANDI/NISO Z39.50, SRU and SRW), it can function as a gateway from any and to any of these protocols. However, its principle purpose is as a Z39.50 server that proxies requests through to a backend by acting as an SRU client. The following command-line options govern how the gateway functions: =over 4 =item -c configFile Specifies that the named I should be used to configure the functionality of the gateway: if this option is not specified, then the file C is used. The format of the configuration file is described separately in C, and a sample configuration file, C, is supplied in the C directory of the distribution. =item -- Indicates the end of C-specific options. This is required if YAZ options are to be specified, so that C doesn't try to interpret them itself. =item I Command-line arguments subsequent to the C<--> option are interpreted by the YAZ backend server as described at http://www.indexdata.dk/yaz/doc/server.invocation.tkl These options provide the means to control many aspects of the gateway's functioning: for example, whether the server forks a new process for each client or runs a single process using C; how (if at all) to interpret incoming SRU requests; whether and how to log protocol packets for debugging. =item I One or more YAZ-style listener addresses may be specified, and the server will accept connections on those addresses: for example, C<@:9998>, C or C. If no explicit listener addresses are provided, the server listens on port 9999. =back =head1 SEE ALSO The C module. The C manual for the configuration-file format. The C module. The C module (in the C distribution). =head1 AUTHOR Sebastian Hammer Equinn@miketaylor.org.ukE Mike Taylor Emike@indexdata.comE The development of C, and the C library that provides its functionality, has been partially sponsored by the National Library of Australia, whose contribution we gratefully acknowledge. =head1 COPYRIGHT AND LICENCE Copyright (C) 2007 by Index Data. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available. =cut Net-Z3950-Simple2ZOOM-1.04/etc/0000755000175000017500000000000011213227655014145 5ustar mikemikeNet-Z3950-Simple2ZOOM-1.04/etc/yazgfs.xml0000644000175000017500000000064210660104533016166 0ustar mikemike tcp:@:9998 ../etc/ccl-qualifiers Net-Z3950-Simple2ZOOM-1.04/etc/test.xml0000644000175000017500000001231710676446525015665 0ustar mikemike http://memory.loc.gov:80/cgi-bin/sru2.0/ammem cql title http://memory.loc.gov:80/cgi-bin/sru2.0/ppoc cql title localhost:9999/Default marc-8 z3950.loc.gov:7090/voyager marc-8 http://z3950.loc.gov:7090/voyager marc-8 cql title creator http://localhost:9999/Default cql title localhost:8018/IR-Explain---1 localhost:8018/IR-Explain---1 cql dc.title http://localhost:8018/IR-Explain---1 http://localhost:8018/IR-Explain---1 cql dc.title tcp:localhost:9999/default 001 245$a 100$a 600$a 600$b 260$c 999$a 999$z (1,14) (2,1) (2,2) (2,21) (3,should-not-appear) (3,admin)(1,16) (3,admin)(2,6) (2,sw) http://localhost:9999/default search cql dc.title http://alcme.oclc.org/srw/search/GSAFD cql dc.title cql dc.title any Net-Z3950-Simple2ZOOM-1.04/etc/simple2zoom.rnc0000644000175000017500000000165210672516074017141 0ustar mikemike# $Id: simple2zoom.rnc,v 1.10 2007-09-14 14:35:40 mike Exp $ # Simple2ZOOM configuration XML is not in any namespace. start = element client { element authentication { text }?, database*, search? } database = element database { attribute name { text }, element zurl { text }, element resultsetid { "id" | "search" | "fallback" }?, element nonamedresultsets { empty }?, option*, element charset { text }?, search?, schema*, element sutrs-record { field* }?, element usmarc-record { field* }?, element grs1-record { field* }? } option = element option { attribute name { text }, text } search = element search { element querytype { "cql" }, map* } map = element map { attribute use { text }, element index { text }? } schema = element schema { attribute oid { text }, attribute sru { text }, attribute format { text }, attribute encoding { text } } field = element field { attribute xpath { text }, text } Net-Z3950-Simple2ZOOM-1.04/etc/init-script0000755000175000017500000000332610643460147016345 0ustar mikemike#! /bin/sh # # Start/stop script for the simple2zoom SRU gateway # # $Id: init-script,v 1.1 2007-07-06 15:31:51 mike Exp $ # set -e PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DESC="SRU/Z39.50 Gateway" NAME=simple2zoom BASEDIR=$(dirname $0) DAEMON=$BASEDIR/$NAME PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME LOGFILE=$BASEDIR/sru.log SOCKET=tcp:@:8888 USER=www-data # Gracefully exit if the package has been removed. test -x $DAEMON || exit 0 # # Function that starts the daemon/service. # d_start() { if [ -f $PIDFILE ] ; then echo echo "Already running as pid $(cat $PIDFILE)" exit 1; fi $DAEMON -D -p $PIDFILE -l $LOGFILE -u $USER $SOCKET > $LOGFILE 2>&1 } # # Function that stops the daemon/service. # d_stop() { kill $(cat $PIDFILE) rm $PIDFILE } case "$1" in start) echo -n "Starting $DESC: $NAME" d_start echo "." ;; stop) echo -n "Stopping $DESC: $NAME" d_stop echo "." ;; #reload) # # If the daemon can reload its configuration without # restarting (for example, when it is sent a SIGHUP), # then implement that here. # # If the daemon responds to changes in its config file # directly anyway, make this an "exit 0". # # echo -n "Reloading $DESC configuration..." # d_reload # echo "done." #;; restart|force-reload) # # If the "reload" option is implemented, move the "force-reload" # option to the "reload" entry above. If not, "force-reload" is # just the same as "restart". # echo -n "Restarting $DESC: $NAME" d_stop sleep 1 d_start echo "." ;; *) # echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 0 Net-Z3950-Simple2ZOOM-1.04/etc/README0000644000175000017500000000345410666001161015024 0ustar mikemike$Id: README,v 1.2 2007-08-31 11:58:41 mike Exp $ This directory contains auxiliary files that are not part of Simple2ZOOM itself but which can be used to configure it, test configurations, start and stop it, etc. test.xml -- a sample Simple2ZOOM main configuration file, containing minimal definitions of many different targets, useful for development and testing. nla.xml -- the beginnings of a main configuration file suitable for use by the National Library of Australia. simple2zoom.rnc -- Relax-NG Compact schema constraining the main configuration file format. (The format is described in prose in the Net::Z3950::Simple2ZOOM::Config manual.) simple2zoom.rng, simple2zoom.xsd, simple2zoom.dtd -- automatically generated schemas constraining the main configuration file format using other constraint languages: Relax-NG XML, W3C Schema and DTD (Document Type Definition). Makefile -- controls generation of the additional schemas from the Relax-NG Compact master schema, and checks that test.xml validates correctly. yazgfs.xml -- A YAZ GFS (Generic Frontend Server) configuration file, as described at http://indexdata.com/yaz/doc/server.vhosts.tkl Its purpose is to use the file ccl-qualifiers. ccl-qualifiers -- a simple set of CCL qualifiers indicating how Simple2ZOOM (actually the YAZ GFS) should translate them in the Type-1 attributes. To enable CCL support, use the "-f yazgfs.xml" command-line option. init-script -- a template for a startup/shutdown script that can be used as part of a System-V style init configuration (e.g. placed in the /etc/init.d directory of a Debian GNU/Linux installation). This WILL NEED EDITING to allow for specific details of the installation. sru-auth -- a trivial example of a mod_perl or CGI script that can perform Init authentication for Simple2ZOOM. Net-Z3950-Simple2ZOOM-1.04/etc/simple2zoom.rng0000444000175000017500000000533011213226213017121 0ustar mikemike id search fallback cql Net-Z3950-Simple2ZOOM-1.04/etc/ccl-qualifiers0000644000175000017500000000242710660104355016774 0ustar mikemike# CCL field mappings # $Id: ccl-qualifiers,v 1.1 2007-08-13 16:38:05 mike Exp $ # # The rule below is used when no fields are specified term t=l,r s=al # # Simple rule for a field called "clean" clean t=l,r # # Rules for some BIB-1 fields au u=1 s=pw ti u=4 s=pw isbn u=7 issn u=8 cc u=20 su u=21 s=pw date u=30 r=r dp u=31 r=r da u=32 r=r la u=54 s=pw ab u=62 s=pw note u=63 s=pw af u=1006 s=pw # Qualifier alias tiau ti au # # Rules for a few GILS fields north gils-attset,u=2040 r=o south gils-attset,u=2041 r=o east gils-attset,u=2038 r=o west gils-attest,u=2039 r=o distributor gils-attset,u=2000 s=pw distributorname gils-attset,u=2001 s=pw # Explain fields ExplainCategory exp1,1=1 HumanStringLanguage exp1,1=2 DatabaseName exp1,1=3 TargetName exp1,1=4 AttributeSetOID exp1,1=5 RecordSyntaxOID exp1,1=6 TagSetOID exp1,1=7 ExtededServiceOID exp1,1=8 DateAdded exp1,1=9 DateChanged exp1,1=10 DateExpires exp1,1=11 ElementSetName exp1,1=12 # Define or operator @or or # Define and operator @and and # Define and not operator @not not andnot # Whether CCL is case sensitive or not. @case 1 # default stop words # @stop.* the of a # stop words for ti # @stop.ti art Net-Z3950-Simple2ZOOM-1.04/etc/nla.xml0000644000175000017500000001033210657160723015443 0ustar mikemike http://z3950.loc.gov:7090/voyager marc-8 cql dc.title dc.identifier bath.issn dc.identifier dc.identifier dc.subject dc.subject dc.subject dc.subject dc.subject dc.subject dc.date dc.title dc.subject nla.publisher dc.language nla.geographicAreaCode nla.illLibrarySymbol nla.countryStateProvice nla.coden bath.notes dc.format dc.creator dc.creator dc.creator dc.creator dc.identifier dc.date dc.date nla.publisher dc.format dc.identifier dc.identifier dc.subject dc.identifier nla.countryStateProvice nla.australian dc.format nla.governmentPublication nla.bibliographicLevel dc.identifier nla.seriesType rec.identifier Net-Z3950-Simple2ZOOM-1.04/etc/simple2zoom.dtd0000444000175000017500000000216011213226212017103 0ustar mikemike Net-Z3950-Simple2ZOOM-1.04/etc/sru-auth0000755000175000017500000000146110662554344015652 0ustar mikemike# $Id: sru-auth,v 1.1 2007-08-21 12:21:56 mike Exp $ # In order to test the authentication feature of Simple2ZOOM, we need # an authenticator script, accessible via HTTP. The simplest way to # provide that is as a simple bit of HTML::Mason running under the # conveniently available IRSpy distribution. Since this is only for # testing, a hardwired user register is good enough. use strict; use warnings; use CGI; my %register = ( mike => "fish", simon => "frog 123", admin => "Tom&jErry", ); my $cgi = new CGI(); my $user = $cgi->param('user'); my $pass = $cgi->param('pass'); if (defined $user && defined $pass && $register{$user} eq $pass) { print $cgi->header(); print "OK\n"; warn "good"; } else { print $cgi->header(-status => "401 Authorization Required"), warn "bad"; } Net-Z3950-Simple2ZOOM-1.04/etc/Makefile0000644000175000017500000000114010666001131015567 0ustar mikemike# $Id: Makefile,v 1.6 2007-08-31 11:58:17 mike Exp $ STUFF = simple2zoom.rng simple2zoom.dtd simple2zoom.xsd lint: lint-rng lint-schema lint-dtd lint-rng: test.xml simple2zoom.rng xmllint --relaxng simple2zoom.rng --noout test.xml lint-dtd: test.xml simple2zoom.dtd xmllint --dtdvalid simple2zoom.dtd --noout test.xml lint-schema: test.xml simple2zoom.xsd xmllint --schema simple2zoom.xsd --noout test.xml all: $(STUFF) %.rng: %.rnc rm -f $@ trang $? $@ chmod 444 $@ %.dtd: %.rnc rm -f $@ trang $< $@ chmod 444 $@ %.xsd: %.rnc rm -f $@ trang $< $@ chmod 444 $@ clean: rm -f $(STUFF) Net-Z3950-Simple2ZOOM-1.04/etc/simple2zoom.xsd0000444000175000017500000000720111213226213017130 0ustar mikemike Net-Z3950-Simple2ZOOM-1.04/t/0000755000175000017500000000000011213227655013635 5ustar mikemikeNet-Z3950-Simple2ZOOM-1.04/t/Net-Z3950-Simple2ZOOM.t0000644000175000017500000000024410643460211017307 0ustar mikemike# $Id: Net-Z3950-Simple2ZOOM.t,v 1.1 2007-07-06 15:32:25 mike Exp $ use Test::More tests => 1; BEGIN { use_ok('Net::Z3950::Simple2ZOOM') }; # That's all for now. Net-Z3950-Simple2ZOOM-1.04/lib/0000755000175000017500000000000011213227655014140 5ustar mikemikeNet-Z3950-Simple2ZOOM-1.04/lib/Net/0000755000175000017500000000000011213227655014666 5ustar mikemikeNet-Z3950-Simple2ZOOM-1.04/lib/Net/Z3950/0000755000175000017500000000000011213227655015420 5ustar mikemikeNet-Z3950-Simple2ZOOM-1.04/lib/Net/Z3950/Simple2ZOOM/0000755000175000017500000000000011213227655017440 5ustar mikemikeNet-Z3950-Simple2ZOOM-1.04/lib/Net/Z3950/Simple2ZOOM/Config.pod0000644000175000017500000002411610672516656021367 0ustar mikemike# $Id: Config.pod,v 1.15 2007-09-14 14:41:50 mike Exp $ use strict; use warnings; =head1 NAME Net::Z3950::Simple2ZOOM::Config - configuration file for the Simple2ZOOM gateway =head1 SYNOPSIS http://some.url/{user}/pwd={pass} http://z3950.loc.gov:7090/voyager marc-8 cql title creator =head1 DESCRIPTION The universal Swiss Army Gateway C is configured by a single file, named on the command-line, and expressed in XML. This file specifies which back-end databases are supported, how the back-ends are contacted, what character-sets they provide records in, and how to map Z39.50 searches to CQL. The structure of the file is pretty simple. =head2 Top Level =over 4 =item The top-level element is . It contains a single optional element, any number of elements and a single optional element. The second of these specifies how to interpret requests to search in the configured databases; the last provides query mapping specifications for dynamically specified databases. =item This element contains a URL template, specifying the address of an HTTP authentication server. The template must include the special strings C<{user}> and C<{pass}>, which are substituted with the username and password supplied in the Init request, if any. The resulting URL is actioned and the result examined: any successful response (HTTP status 200) indicates that the username/password combination is acceptable, and that the session can continue; any other response (e.g. 401 Authorization Required) results in the Init request being refused with BIB-1 diagnostic 1014 (Init/AC: Authentication System error). If the element is omitted from the configuration, no authentication credentials are required, and any that are provided are ignored. (A trivial example of an authentication server script is included in the Simple2ZOOM distribution, as C.) =item The element carries a C attribute specifying the Z39.50 database name by which is it is known to clients. It contains several complex elements, and is discussed in more detail below. =item Each element, whether contained within a specific (see below) or at the top level, consists of a single mandatory element followed by any number of s. The content of indicates the type of query that should be sent to the back-end server, with Simple2ZOOM reposible for translating incoming queries as required into that format. At present, the only supported value is C. =item Each element carries a C attribute, which is the numeric value of BIB-1 use attribute to be supported, and optionally contains a single element which in turn contains the name of the corresponding CQL index. Type-1 searches against the specified BIB-1 access point are mapped to CQL searches against the specified index. If the is omitted within a , then the generated CQL query term has no index specified. This can be useful for BIB-1 attributes such as 1016 (any) and 1035 (anywhere). =back =head2 Databases The element which describes each database contains the following elements in the specified order. In general, entries are of two kinds: those connecting through to a Z39.50 database will have no element, since no query mapping is necessary to translate an incoming Type-1 query; but those connecting to an SRU or SRW database will have a element with set to C and containing information on how to map from specified BIB-1 use attributes to CQL indexes. =over 4 =item Contains the target address of the back-end database (e.g. C or C). =item Optional. If provided, it must take one of the following values, and if it is omitted then the value C is assumed: =over 4 =item C When queries are received that include references to existing result-sets, these are translated into result-set references using the C index. It is an error if the server does not support this facility. =item C References to existing result-sets are rewritten as resubmissions of the query. This works on all servers, but does not reliably give precisely correct results if the database is updated between searches. =item C Result-set references are used when supported, but resubmissions of prior queries are used when this facility is unavailable. =back =item This is optional. If provided, it is empty and indicates that the back-end database does not support named result sets. =item