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

NAME

SeeAlso::Client - SeeAlso Linkserver Protocol Client

DESCRIPTION

This class can be used to query a SeeAlso server. It can also be used as SeeAlso::Source to proxy another SeeAlso server, for instance to wrap a SeeAlso Simple server as a SeeAlso Full server.

SYNOPSIS

  $response = seealso_request ( $baseurl, $identifier );
  print $response->toJSON() . "\n" if ($response);

  $client = SeeAlso::Client->new( $baseurl, ShortName => "myClient" );
  $response = $client->query( $identifier );

METHODS

new ( [ BaseURL => ] $BaseURL, [ %description ] ] )

Creates a new SeeAlso client. You must specify a BaseURL as string or URI object or this method will croak:

  $client = new SeeAlso::Client( $BaseURL );
  $client = new SeeAlso::Client( BaseURL => $BaseURL );

query ( $identifier )

Given an identifier (either a SeeAlso::Identifier object or just a plain string) queries the SeeAlso Server of this client and returns a SeeAlso::Response object on success. On failure this method just croaks.

baseURL ( [ $url ] )

Get or set the base URL of the SeeAlso server to query by this client.

You can specify a string or a URI/URI::http/URI::https object. If the URL contains a 'format' parameter, it is treated as a SeeAlso Simple server (plain JSON response), otherwise it is a SeeAlso Full server (unAPI support and OpenSearch description). This method may croak on invalid URLs.

Returns the URL as string.

queryURL ( $identifier [, $callback ] )

Get the query URL with a given identifier and optionally callback parameter. The query parameter can be a simple string or a SeeAlso::Identifier object (its normalized representation is used). If no identifier is given, an empty string is used. This method may croak if the callback name is invalid.

getFormats

Try to retrieve a list of formats via unAPI (experimental).

FUNCTIONS

seealso_request ( $baseurl, $identifier )

Quickly query a SeeAlso server an return the SeeAlso::Response. This is almost equivalent to

  SeeAlso::Client->new($baseurl)->query($identifier)

but in contrast seealso_request never croaks on errors (but may return undef). This method is exportet by default.

AUTHOR

Jakob Voss <jakob.voss@gbv.de>

LICENSE

Copyright (C) 2007-2009 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.