NAME

PICA::Source - Data source that can be queried for PICA+ records

SYNOPSIS

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

Instead or in addition to SRU you can use Z39.50 and unAPI.

METHODS

new ( [ %params ] )

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

getPPN ( $ppn [, $prefix ] )

Get a record specified by its PPN. Returns a PICA::Record object or undef. Only available for SRU and unAPI at the moment. If both are specified, unAPI is used.

cqlQuery ( $cql [, %handlers ] )

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 ( $query [, %handlers ] )

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-2009 by Verbundzentrale Göttingen (VZG) and Jakob Voß

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.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 267:

Non-ASCII character seen before =encoding in 'Göttingen'. Assuming UTF-8