The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

PICA::Server - Server that can be searched for PICA+ records

SYNOPSIS

  my $server = PICA::Server->new(
      title => "My server",
      SRU => "http://my.server.org/sru-interface.cgi"
  );
  my $record = $server->getPPN('1234567890');

METHODS

new

Create a new Server. You can specify a title with title and the URL base of an SRU interface with SRU or a Z39.50 server with Z3950.

getPPN

Get a record specified by its PPN. Returns a PICA::Record object or undef. Only available for SRU at the moment.

cqlQuery

Perform a CQL query (SRU). If only one parameter is given, the full XML response is returned and you can parse it with PICA::SRUSearchParser.

If you supply an additional hash with Record and Field handlers (see PICA::Parser) this handlers are used. Afterwards the parser is returned.

z3950Query

Perform a Z39.50 query via ZOOM.If only one parameter is given, the ZOOM::ResultSet is returned and you can parse it with a PICA::PlainParser:

    my $n = $rs->size();
    for my $i (0..$n-1) {
        $parser->parsedata($rs->record($i)->raw());
    }

If you supply an additional hash with Record and Field handlers (see PICA::Parser) this handlers are used. Afterwards the parser is returned.

UTILITY FUNCTIONS

url_encode

Returns the fully URL-encoded version of the given string. It does not convert space characters to '+' characters. This method is based on CGI::Utils by Don Owens.

url_unicode_encode

Returns the fully URL-encoded version of the given string as unicode characters. It does not convert space characters to '+' characters. This method is based on CGI::Utils by Don Owens.

TODO

Better error handling is needed, for instance of the server is "System temporarily unavailable". PICA::SRUSearchParser should only be created once.

AUTHOR

Jakob Voss <jakob.voss@gbv.de>

LICENSE

Copyright (C) 2007 by Verbundzentrale Goettingen (VZG) and Jakob Voss

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.