0abbb92dcf6a4c5ae60d1d1aa1a87e9054921c17
[simpleserver-moved-to-github.git] / SimpleServer.pm
1 ##
2 ##  Copyright (c) 2000-2006, Index Data.
3 ##
4 ##  Permission to use, copy, modify, distribute, and sell this software and
5 ##  its documentation, in whole or in part, for any purpose, is hereby granted,
6 ##  provided that:
7 ##
8 ##  1. This copyright and permission notice appear in all copies of the
9 ##  software and its documentation. Notices of copyright or attribution
10 ##  which appear at the beginning of any file must remain unchanged.
11 ##
12 ##  2. The name of Index Data or the individual authors may not be used to
13 ##  endorse or promote products derived from this software without specific
14 ##  prior written permission.
15 ##
16 ##  THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND,
17 ##  EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
18 ##  WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
19 ##  IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
20 ##  INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES
21 ##  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR
22 ##  NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
23 ##  LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
24 ##  OF THIS SOFTWARE.
25 ##
26 ##
27
28 ## $Id: SimpleServer.pm,v 1.32 2007-08-08 10:27:43 mike Exp $
29
30 package Net::Z3950::SimpleServer;
31
32 use strict;
33 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
34 use Carp;
35
36 require Exporter;
37 require DynaLoader;
38 require AutoLoader;
39
40 @ISA = qw(Exporter AutoLoader DynaLoader);
41 @EXPORT = qw( );
42 $VERSION = '1.06';
43
44 bootstrap Net::Z3950::SimpleServer $VERSION;
45
46 # Preloaded methods go here.
47
48 my $count = 0;
49
50 sub new {
51         my $class = shift;
52         my %args = @_;
53         my $self = \%args;
54
55         if ($count) {
56                 carp "SimpleServer.pm: WARNING: Multithreaded server unsupported";
57         }
58         $count = 1;
59
60         croak "SimpleServer.pm: ERROR: Unspecified search handler" unless defined($self->{SEARCH});
61         croak "SimpleServer.pm: ERROR: Unspecified fetch handler" unless defined($self->{FETCH});
62
63         bless $self, $class;
64         return $self;
65 }
66
67
68 sub launch_server {
69         my $self = shift;
70         my @args = @_;
71
72         if (defined($self->{INIT})) {
73                 set_init_handler($self->{INIT});
74         }
75         set_search_handler($self->{SEARCH});
76         set_fetch_handler($self->{FETCH});
77         if (defined($self->{CLOSE})) {
78                 set_close_handler($self->{CLOSE});
79         }
80         if (defined($self->{PRESENT})) {
81                 set_present_handler($self->{PRESENT});
82         }
83         if (defined($self->{SCAN})) {
84                 set_scan_handler($self->{SCAN});
85         }
86         if (defined($self->{SORT})) {
87                 set_sort_handler($self->{SORT});
88         }
89         if (defined($self->{EXPLAIN})) {
90                 set_explain_handler($self->{EXPLAIN});
91         }
92
93         start_server(@args);
94 }
95
96
97 # Register packages that we will use in translated RPNs
98 package Net::Z3950::APDU::Query;
99 package Net::Z3950::APDU::OID;
100 package Net::Z3950::RPN::And;
101 package Net::Z3950::RPN::Or;
102 package Net::Z3950::RPN::AndNot;
103 package Net::Z3950::RPN::Term;
104 package Net::Z3950::RPN::RSID;
105 package Net::Z3950::RPN::Attributes;
106 package Net::Z3950::RPN::Attribute;
107
108 # Must revert to original package for Autoloader's benefit
109 package Net::Z3950::SimpleServer;
110
111
112 # Autoload methods go after =cut, and are processed by the autosplit program.
113
114 1;
115 __END__
116 # Below is the stub of documentation for your module. You better edit it!
117
118 =head1 NAME
119
120 Net::Z3950::SimpleServer - Simple Perl API for building Z39.50 servers. 
121
122 =head1 SYNOPSIS
123
124   use Net::Z3950::SimpleServer;
125
126   sub my_search_handler {
127         my $args = shift;
128
129         my $set_id = $args->{SETNAME};
130         my @database_list = @{ $args->{DATABASES} };
131         my $query = $args->{QUERY};
132
133         ## Perform the query on the specified set of databases
134         ## and return the number of hits:
135
136         $args->{HITS} = $hits;
137   }
138
139   sub my_fetch_handler {        # Get a record for the user
140         my $args = shift;
141
142         my $set_id = $args->{SETNAME};
143
144         my $record = fetch_a_record($args->{OFFSET});
145
146         $args->{RECORD} = $record;
147         if (number_of_hits() == $args->{OFFSET}) {      ## Last record in set?
148                 $args->{LAST} = 1;
149         } else {
150                 $args->{LAST} = 0;
151         }
152   }
153
154   ## Register custom event handlers:
155   my $z = new Net::Z3950::SimpleServer(GHANDLE = $someObject,
156                                        INIT   =>  \&my_init_handler,
157                                        CLOSE  =>  \&my_close_handler,
158                                        SEARCH =>  \&my_search_handler,
159                                        FETCH  =>  \&my_fetch_handler);
160
161   ## Launch server:
162   $z->launch_server("ztest.pl", @ARGV);
163
164 =head1 DESCRIPTION
165
166 The SimpleServer module is a tool for constructing Z39.50 "Information
167 Retrieval" servers in Perl. The module is easy to use, but it
168 does help to have an understanding of the Z39.50 query
169 structure and the construction of structured retrieval records.
170
171 Z39.50 is a network protocol for searching remote databases and
172 retrieving the results in the form of structured "records". It is widely
173 used in libraries around the world, as well as in the US Federal Government.
174 In addition, it is generally useful whenever you wish to integrate a number
175 of different database systems around a shared, asbtract data model.
176
177 The model of the module is simple: It implements a "generic" Z39.50
178 server, which invokes callback functions supplied by you to search
179 for content in your database. You can use any tools available in
180 Perl to supply the content, including modules like DBI and
181 WWW::Search.
182
183 The server will take care of managing the network connections for
184 you, and it will spawn a new process (or thread, in some
185 environments) whenever a new connection is received.
186
187 The programmer can specify subroutines to take care of the following type
188 of events:
189
190   - Initialize request
191   - Search request
192   - Present request
193   - Fetching of records
194   - Scan request (browsing) 
195   - Closing down connection
196
197 Note that only the Search and Fetch handler functions are required.
198 The module can supply default responses to the other on its own.
199
200 After the launching of the server, all control is given away from
201 the Perl script to the server. The server calls the registered
202 subroutines to field incoming requests from Z39.50 clients.
203
204 A reference to an anonymous hash is passed to each handler. Some of
205 the entries of these hashes are to be considered input and others
206 output parameters.
207
208 The Perl programmer specifies the event handlers for the server by
209 means of the SimpleServer object constructor
210
211   my $z = new Net::Z3950::SimpleServer(
212                         INIT    =>      \&my_init_handler,
213                         CLOSE   =>      \&my_close_handler,
214                         SEARCH  =>      \&my_search_handler,
215                         PRESENT =>      \&my_present_handler,
216                         SCAN    =>      \&my_scan_handler,
217                         FETCH   =>      \&my_fetch_handler,
218                         EXPLAIN =>      \&my_explain_handler);
219
220 In addition, the arguments to the constructor may include GHANDLE, a
221 global handle which is made available to each invocation of every
222 callback function.  This is typically a reference to either a hash or
223 an object.
224
225 If you want your SimpleServer to start a thread (threaded mode) to
226 handle each incoming Z39.50 request instead of forking a process
227 (forking mode), you need to register the handlers by symbol rather
228 than by code reference. Thus, in threaded mode, you will need to
229 register your handlers this way:
230
231   my $z = new Net::Z3950::SimpleServer(
232                         INIT    =>      "my_package::my_init_handler",
233                         CLOSE   =>      "my_package::my_close_handler",
234                         ....
235                         ....          );
236
237 where my_package is the Perl package in which your handler is
238 located.
239
240 After the custom event handlers are declared, the server is launched
241 by means of the method
242
243   $z->launch_server("MyServer.pl", @ARGV);
244
245 Notice, the first argument should be the name of your server
246 script (for logging purposes), while the rest of the arguments
247 are documented in the YAZ toolkit manual: The section on
248 application invocation: <http://www.indexdata.dk/yaz/yaz-7.php>
249
250 In particular, you need to use the -T switch to start your SimpleServer
251 in threaded mode.
252
253 =head2 Init handler
254
255 The init handler is called whenever a Z39.50 client is attempting
256 to logon to the server. The exchange of parameters between the
257 server and the handler is carried out via an anonymous hash reached
258 by a reference, i.e.
259
260   $args = shift;
261
262 The argument hash passed to the init handler has the form
263
264   $args = {
265                                     ## Response parameters:
266
267              IMP_ID    =>  "",      ## Z39.50 Implementation ID
268              IMP_NAME  =>  "",      ## Z39.50 Implementation name
269              IMP_VER   =>  "",      ## Z39.50 Implementation version
270              ERR_CODE  =>  0,       ## Error code, cnf. Z39.50 manual
271              ERR_STR   =>  "",      ## Error string (additional info.)
272              USER      =>  "xxx"    ## If Z39.50 authentication is used,
273                                     ## this member contains user name
274              PASS      =>  "yyy"    ## Under same conditions, this member
275                                     ## contains the password in clear text
276              GHANDLE   =>  $obj     ## Global handler specified at creation
277              HANDLE    =>  undef    ## Handler of Perl data structure
278           };
279
280 The HANDLE member can be used to store any scalar value which will then
281 be provided as input to all subsequent calls (ie. for searching, record
282 retrieval, etc.). A common use of the handle is to store a reference to
283 a hash which may then be used to store session-specific parameters.
284 If you have any session-specific information (such as a list of
285 result sets or a handle to a back-end search engine of some sort),
286 it is always best to store them in a private session structure -
287 rather than leaving them in global variables in your script.
288
289 The Implementation ID, name and version are only really used by Z39.50
290 client developers to see what kind of server they're dealing with.
291 Filling these in is optional.
292
293 The ERR_CODE should be left at 0 (the default value) if you wish to
294 accept the connection. Any other value is interpreted as a failure
295 and the client will be shown the door, with the code and the
296 associated additional information, ERR_STR returned.
297
298 =head2 Search handler
299
300 Similarly, the search handler is called with a reference to an anony-
301 mous hash. The structure is the following:
302
303   $args = {
304                                     ## Request parameters:
305
306              GHANDLE   =>  $obj     ## Global handler specified at creation
307              HANDLE    =>  ref,     ## Your session reference.
308              SETNAME   =>  "id",    ## ID of the result set
309              REPL_SET  =>  0,       ## Replace set if already existing?
310              DATABASES =>  ["xxx"], ## Reference to a list of data-
311                                     ## bases to search
312              QUERY     =>  "query", ## The query expression
313              RPN       =>  $obj,    ## Reference to a Net::Z3950::APDU::Query
314
315                                     ## Response parameters:
316
317              ERR_CODE  =>  0,       ## Error code (0=Succesful search)
318              ERR_STR   =>  "",      ## Error string
319              HITS      =>  0        ## Number of matches
320           };
321
322 Note that a search which finds 0 hits is considered successful in
323 Z39.50 terms - you should only set the ERR_CODE to a non-zero value
324 if there was a problem processing the request. The Z39.50 standard
325 provides a comprehensive list of standard diagnostic codes, and you
326 should use these whenever possible.
327
328 The QUERY is a tree-structure of terms combined by operators, the
329 terms being qualified by lists of attributes. The query is presented
330 to the search function in the Prefix Query Format (PQF) which is
331 used in many applications based on the YAZ toolkit. The full grammar
332 is described in the YAZ manual.
333
334 The following are all examples of valid queries in the PQF. 
335
336         dylan
337
338         "bob dylan"
339
340         @or "dylan" "zimmerman"
341
342         @set Result-1
343
344         @or @and bob dylan @set Result-1
345
346         @and @attr 1=1 "bob dylan" @attr 1=4 "slow train coming"
347
348         @attrset @attr 4=1 @attr 1=4 "self portrait"
349
350 You will need to write a recursive function or something similar to
351 parse incoming query expressions, and this is usually where a lot of
352 the work in writing a database-backend happens. Fortunately, you don't
353 need to support anymore functionality than you want to. For instance,
354 it is perfectly legal to not accept boolean operators, but you SHOULD
355 try to return good error codes if you run into something you can't or
356 won't support.
357
358 A more convenient alternative to the QUERY member may be the RPN
359 member, which is a reference to a Net::Z3950::APDU::Query object
360 representing the RPN query tree.  The structure of that object is
361 supposed to be self-documenting, but here's a brief summary of what
362 you get:
363
364 =over 4
365
366 =item *
367
368 C<Net::Z3950::APDU::Query> is a hash with two fields:
369
370 Z<>
371
372 =over 4
373
374 =item C<attributeSet>
375
376 Optional.  If present, it is a reference to a
377 C<Net::Z3950::APDU::OID>.  This is a string of dot-separated integers
378 representing the OID of the query's top-level attribute set.
379
380 =item C<query>
381
382 Mandatory: a refererence to the RPN tree itself.
383
384 =back
385
386 =item *
387
388 Each node of the tree is an object of one of the following types:
389
390 Z<>
391
392 =over 4
393
394 =item C<Net::Z3950::RPN::And>
395
396 =item C<Net::Z3950::RPN::Or>
397
398 =item C<Net::Z3950::RPN::AndNot>
399
400 These three classes are all arrays of two elements, each of which is a
401 node of one of the above types.
402
403 =item C<Net::Z3950::RPN::Term>
404
405 See below for details.
406
407 =item C<Net::Z3950::RPN::RSID>
408
409 A reference to a result-set ID indicating a previous search.  The ID
410 of the result-set is in the C<id> element.
411
412 =back
413
414 (I guess I should make a superclass C<Net::Z3950::RPN::Node> and make
415 all of these subclasses of it.  Not done that yet, but will do one day.)
416
417 =back
418
419 =over 4
420
421 =item *
422
423 C<Net::Z3950::RPN::Term> is a hash with two fields:
424
425 Z<>
426
427 =over 4
428
429 =item C<term>
430
431 A string containing the search term itself.
432
433 =item C<attributes>
434
435 A reference to a C<Net::Z3950::RPN::Attributes> object.
436
437 =back
438
439 =item *
440
441 C<Net::Z3950::RPN::Attributes> is an array of references to
442 C<Net::Z3950::RPN::Attribute> objects.  (Note the plural/singular
443 distinction.)
444
445 =item *
446
447 C<Net::Z3950::RPN::Attribute> is a hash with three elements:
448
449 Z<>
450
451 =over 4
452
453 =item C<attributeSet>
454
455 Optional.  If present, it is dot-separated OID string, as above.
456
457 =item C<attributeType>
458
459 An integer indicating the type of the attribute - for example, under
460 the BIB-1 attribute set, type 1 indicates a ``use'' attribute, type 2
461 a ``relation'' attribute, etc.
462
463 =item C<attributeValue>
464
465 An integer indicating the value of the attribute - for example, under
466 BIB-1, if the attribute type is 1, then value 4 indictates a title
467 search and 7 indictates an ISBN search; but if the attribute type is
468 2, then value 4 indicates a ``greater than or equal'' search, and 102
469 indicates a relevance match.
470
471 =back
472
473 =back
474
475 Note that, at the moment, none of these classes have any methods at
476 all: the blessing into classes is largely just a documentation thing
477 so that, for example, if you do
478
479         { use Data::Dumper; print Dumper($args->{RPN}) }
480
481 you get something fairly human-readable.  But of course, the type
482 distinction between the three different kinds of boolean node is
483 important.
484
485 By adding your own methods to these classes (building what I call
486 ``augmented classes''), you can easily build code that walks the tree
487 of the incoming RPN.  Take a look at C<samples/render-search.pl> for a
488 sample implementation of such an augmented classes technique.
489
490
491 =head2 Present handler
492
493 The presence of a present handler in a SimpleServer front-end is optional.
494 Each time a client wishes to retrieve records, the present service is
495 called. The present service allows the origin to request a certain number
496 of records retrieved from a given result set.
497 When the present handler is called, the front-end server should prepare a
498 result set for fetching. In practice, this means to get access to the
499 data from the backend database and store the data in a temporary fashion
500 for fast and efficient fetching. The present handler does *not* fetch
501 anything. This task is taken care of by the fetch handler, which will be
502 called the correct number of times by the YAZ library. More about this
503 below.
504 If no present handler is implemented in the front-end, the YAZ toolkit
505 will take care of a minimum of preparations itself. This default present
506 handler is sufficient in many situations, where only a small amount of
507 records are expected to be retrieved. If on the other hand, large result
508 sets are likely to occur, the implementation of a reasonable present
509 handler can gain performance significantly.
510
511 The informations exchanged between client and present handle are:
512
513   $args = {
514                                     ## Client/server request:
515
516              GHANDLE   =>  $obj     ## Global handler specified at creation
517              HANDLE    =>  ref,     ## Reference to datastructure
518              SETNAME   =>  "id",    ## Result set ID
519              START     =>  xxx,     ## Start position
520              COMP      =>  "",      ## Desired record composition
521              NUMBER    =>  yyy,     ## Number of requested records
522
523
524                                     ## Respons parameters:
525
526              HITS      =>  zzz,     ## Number of returned records
527              ERR_CODE  =>  0,       ## Error code
528              ERR_STR   =>  ""       ## Error message
529           };
530
531
532 =head2 Fetch handler
533
534 The fetch handler is asked to retrieve a SINGLE record from a given
535 result set (the front-end server will automatically call the fetch
536 handler as many times as required).
537
538 The parameters exchanged between the server and the fetch handler are
539
540   $args = {
541                                     ## Client/server request:
542
543              GHANDLE   =>  $obj     ## Global handler specified at creation
544              HANDLE    =>  ref      ## Reference to data structure
545              SETNAME   =>  "id"     ## ID of the requested result set
546              OFFSET    =>  nnn      ## Record offset number
547              REQ_FORM  =>  "n.m.k.l"## Client requested format OID
548              COMP      =>  "xyz"    ## Formatting instructions
549              SCHEMA    =>  "abc"    ## Requested schema, if any
550
551                                     ## Handler response:
552
553              RECORD    =>  ""       ## Record string
554              BASENAME  =>  ""       ## Origin of returned record
555              LAST      =>  0        ## Last record in set?
556              ERR_CODE  =>  0        ## Error code
557              ERR_STR   =>  ""       ## Error string
558              SUR_FLAG  =>  0        ## Surrogate diagnostic flag
559              REP_FORM  =>  "n.m.k.l"## Provided format OID
560              SCHEMA    =>  "abc"    ## Provided schema, if any
561           };
562
563 The REP_FORM value has by default the REQ_FORM value but can be set to
564 something different if the handler desires. The BASENAME value should
565 contain the name of the database from where the returned record originates.
566 The ERR_CODE and ERR_STR works the same way they do in the search
567 handler. If there is an error condition, the SUR_FLAG is used to
568 indicate whether the error condition pertains to the record currently
569 being retrieved, or whether it pertains to the operation as a whole
570 (eg. the client has specified a result set which does not exist.)
571
572 If you need to return USMARC records, you might want to have a look at
573 the MARC module on CPAN, if you don't already have a way of generating
574 these.
575
576 NOTE: The record offset is 1-indexed - 1 is the offset of the first
577 record in the set.
578
579 =head2 Scan handler
580
581 A full featured Z39.50 server should support scan (or in some literature
582 browse). The client specifies a starting term of the scan, and the server
583 should return an ordered list of specified length consisting of terms
584 actually occurring in the data base. Each of these terms should be close
585 to or equal to the term originally specified. The quality of scan compared
586 to simple search is a guarantee of hits. It is simply like browsing through
587 an index of a book, you always find something! The parameters exchanged are
588
589   $args = {
590                                                 ## Client request
591
592                 GHANDLE         => $obj         ## Global handler specified at creation
593                 HANDLE          => $ref         ## Reference to data structure
594                 TERM            => 'start',     ## The start term
595                 NUMBER          => xx,          ## Number of requested terms
596                 POS             => yy,          ## Position of starting point
597                                                 ## within returned list
598                 STEP            => 0,           ## Step size
599
600                                                 ## Server response
601
602                 ERR_CODE        => 0,           ## Error code
603                 ERR_STR         => '',          ## Diagnostic message
604                 NUMBER          => zz,          ## Number of returned terms
605                 STATUS          => $status,     ## ScanSuccess/ScanFailure
606                 ENTRIES         => $entries     ## Referenced list of terms
607         };
608
609 where the term list is returned by reference in the scalar $entries, which
610 should point at a data structure of this kind,
611
612   my $entries = [
613                         {       TERM            => 'energy',
614                                 OCCURRENCE      => 5            },
615
616                         {       TERM            => 'energy density',
617                                 OCCURRENCE      => 6,           },
618
619                         {       TERM            => 'energy flow',
620                                 OCCURRENCE      => 3            },
621
622                                 ...
623
624                                 ...
625         ];
626
627 The $status flag should be assigned one of two values:
628
629   Net::Z3950::SimpleServer::ScanSuccess  On success (default)
630   Net::Z3950::SimpleServer::ScanPartial  Less terms returned than requested
631
632 The STEP member contains the requested number of entries in the term-list
633 between two adjacent entries in the response.
634
635 =head2 Close handler
636
637 The argument hash recieved by the close handler has two elements only:
638
639   $args = {
640                                     ## Server provides:
641
642              GHANDLE   =>  $obj     ## Global handler specified at creation
643              HANDLE    =>  ref      ## Reference to data structure
644           };
645
646 What ever data structure the HANDLE value points at goes out of scope
647 after this call. If you need to close down a connection to your server
648 or something similar, this is the place to do it.
649
650 =head2 Support for SRU and SRW
651
652 Since release 1.0, SimpleServer includes support for serving the SRU
653 and SRW protocols as well as Z39.50.  These ``web-friendly'' protocols
654 enable similar functionality to that of Z39.50, but by means of rich
655 URLs in the case of SRU, and a SOAP-based web-service in the case of
656 SRW.  These protocols are described at
657 http://www.loc.gov/sru
658
659 In order to serve these protocols from a SimpleServer-based
660 application, it is necessary to launch the application with a YAZ
661 Generic Frontend Server (GFS) configuration file, which can be
662 specified using the command-line argument C<-f> I<filename>.  A
663 minimal configuration file looks like this:
664
665   <yazgfs>
666     <server>
667       <cql2rpn>pqf.properties</cql2rpn>
668     </server>
669   </yazgfs>
670
671 This file specifies only that C<pqf.properties> should be used to
672 translate the CQL queries of SRU and SRW into corresponding Z39.50
673 Type-1 queries.  For more information about YAZ GFS configuration,
674 including how to specify an Explain record, see the I<Virtual Hosts>
675 section of the YAZ manual at
676 http://indexdata.com/yaz/doc/server.vhosts.tkl
677
678 The mapping of CQL queries into Z39.50 Type-1 queries is specified by
679 a file that indicates which BIB-1 attributes should be generated for
680 each CQL index, relation, modifiers, etc.  A typical section of this
681 file looks like this:
682
683   index.dc.title                        = 1=4
684   index.dc.subject                      = 1=21
685   index.dc.creator                      = 1=1003
686   relation.<                            = 2=1
687   relation.le                           = 2=2
688
689 This file specifies the BIB-1 access points (type=1) for the Dublin
690 Core indexes C<title>, C<subject> and C<creator>, and the BIB-1
691 relations (type=2) corresponding to the CQL relations C<E<lt>> and
692 C<E<lt>=>.  For more information about the format of this file, see
693 the I<CQL> section of the YAZ manual at
694 http://indexdata.com/yaz/doc/tools.tkl#tools.cql
695
696 The YAZ distribution include a sample CQL-to-PQF mapping configuration
697 file called C<pqf.properties>; this is sufficient for many
698 applications, and a good base to work from for most others.
699
700 If a SimpleServer-based application is run without this SRU-specific
701 configuration, it can still serve SRU; however, CQL queries will not
702 be translated, but passed straight through to the search-handler
703 function, as the C<CQL> member of the parameters hash.  It is then the
704 responsibility of the back-end application to parse and handle the CQL
705 query, which is most easily done using Ed Summers' fine C<CQL::Parser>
706 module, available from CPAN at
707 http://search.cpan.org/~esummers/CQL-Parser/
708
709 =head1 AUTHORS
710
711 Anders Sønderberg (sondberg@indexdata.dk),
712 Sebastian Hammer (quinn@indexdata.dk),
713 Mike Taylor (indexdata.com).
714
715 =head1 SEE ALSO
716
717 Any Perl module which is useful for accessing the database of your
718 choice.
719
720 =cut