#!/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