NAME

SeeAlso::Response - SeeAlso Simple Response

DESCRIPTION

This class models a SeeAlso Simple Response which is practically the same as am OpenSearch Suggestions Response.

METHODS

new ( [ $query [, $completions, $descriptions, $urls ] )

Creates a new SeeAlso::Response object (this is the same as an OpenSearch Suggestions Response object). If the passed query parameter is an instance of SeeAlso::Identifier, the return of its normalized method is used.

add ( $label [, $description [, $uri ] ] )

Add an item to the result set. All parameters must be strings. The URI is not checked for well-formedness, so it is recommended to use a specific URI class like URI and pass a normalized version of the URI:

$uri = URI->new( $uri_str )->canonical

size

Get the number of entries in this response.

hasQuery

Returns whether a non-empty query has been provided.

toJSON ( [ $callback ] )

Return the response in JSON format and a non-mandatory callback wrapped around. There is no test whether the callback name is valid so far. The encoding will not be changed, please only feed response objects with UTF-8 strings to get UTF-8 JSON with this 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.