Jakob Voß > SeeAlso-Server-0.57 > SeeAlso::Source

Download:
SeeAlso-Server-0.57.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.56   Source   Latest Release: SeeAlso-Server-0.71

NAME ^

SeeAlso::Source - a source of OpenSearch Suggestions reponses

SYNOPSIS ^

  my $source = SeeAlso::Source->new();
  my $source = SeeAlso::Source->new( sub { ... } );
  ...
  $source->description( "key" => "value" ... );
 ...
  $response = $source->query( $identifier );

new ( [ $query_method ] [, %description ] ] )

Create a new source. You can provide a query method (mQuery). The query method gets a SeeAlso::Identifier object and must return a SeeAlso::Response. The optional @description parameter is passed to the description method. Instead of providing a query method by parameter you can also derive a subclass and define the mQuery method.

description ( [ $key ] | $key => $value, $key => $value, ... )

Returns additional description about this source in a hash (no key provided) or a specific element of the description. The elements are defined according to elements in an OpenSearch description document. Up to now they are:

ShortName

A short name with up to 16 characters.

LongName

A long name with up to 48 characters.

Description

A description with up to 1024 characters.

BaseURL

URL of the script. Will be set automatically via CGI if not defined.

DateModified

Qualified Dublin Core element Date.Modified.

Source

Source of the data (dc:source)

Example[s]

An example query (a hash of 'id' and optional 'response').

about ( )

Return ShortName, Description, and BaseURL from the description of this Source. Undefined fields are returned as empty string.

query ( $identifier )

Given an identifier (either a SeeAlso::Identifier object or just a plain string) returns a SeeAlso::Response object by calling the query method.

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.

syntax highlighting: