The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Plack::App::SeeAlso - SeeAlso Server as PSGI application

VERSION

version 0.01

DESCRIPTION

This implements a SeeAlso Linkserver Protocol (SeeAlso) server as PSGI application. SeeAlso is based on unAPI and OpenSearch.

This module contains a SeeAlso client in form of three files (seealso.js, seealso.xsl, seealso.css). This client is served if no format-parameter was given, so you get a nice, human readable interface.

METHODS

new ( [ %options ] )

Creates a new SeeAlso server. Supported options are:

ShortName

Short name of the server (truncated to 16 characters)

LongName

Long name of the server (truncated to 48 characters)

Description

Verbal description of the server (truncated to 1024 characters)

Source

Verbal description of the source of the server (for Dublin Core element dc:source)

DateModified

Date/Time of last modification of the server (for qualified Dublin Core element Date.Modified)

Examples

A list of hash reference with id examples and optional response data.

Stylesheet

By default, an client interface is returned at /seealso.xsl, /seealso.js, and /seealso.css. A link to the interface is added if no format parameter was given. You can disable this interface by setting the Stylesheet option to undef or you set it to some URL of another XSLT file.

Formats

A hash reference with additional formats, for Plack::App::unAPI.

Query

A code reference to use as query method.

query ( $identifier )

You are expected to implement a query method. It receives a defined identifier (set to the empty string by default) as an argument and is expected to return either an Open Search Suggestions response or undef. An Open Search Suggestions response is an array reference with two to three elements:

  • The first element is the identifier, possibly normalized

  • The second, third, and fourth elements are array references with strings.

NOTES

This module sets the default MIME type for c<.xsl> files to text/xsl because browser will more likely complain otherwise. This setting is done with Plack::MIME and it may also affect other applications.

SEE ALSO

This module is basically a refactored clean-up of SeeAlso::Server. The unAPI handling is put in the module Plack::App::unAPI.

AUTHOR

Jakob Voss

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by Jakob Voss.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.