Plack-App-Catmandu-OAI
view release on metacpan or search on metacpan
sets
Type: array reference of hash references
Description: an array of OAI-PMH sets and the CQL query to retrieve
records in this set from the Catmandu::Store. Each object must have
the following attributes:
* setSpec: a short string for the same of the set * setName: a longer
description of the set * setDescription: an optional and repeatable
container that may hold community-specific XML-encoded data about the
set. Should be string or array of strings. * cql: the CQL command to
find records in this set in the Catmandu::Store
Required: false
granularity
Type: non empty string
Description: datestamp granularity. Default: YYYY-MM-DDThh:mm:ssZ.
This is validated against the returned record timestamps
Required: false
collectionIcon
Type: hash reference
Description: object containing attributes for collectionIcon as used
in the Identify response:
* url (required) * link * title * width * height
Required: false
get_record_cql_pattern
Type: non empty string
Description: CQL query template to use when fetching a single record.
Defaults to _id exact "%s". Note that the record identifier key as
defined by the catmandu bag is taken into account (which is _id by
default)
Required: true
datestamp_pattern
Type: non empty string
Description: datestamp pattern for OAI parameters from and until.
Example: %Y-%m-%dT%H:%M:%SZ
Required: true
template_options
An optional hash of configuration options that will be passed to
Catmandu::Exporter::Template or Template
As this is meant as a drop in replacement for
Dancer::Plugin::Catmandu::OAI all arguments should be the same.
So all arguments can be taken from your previous dancer plugin
configuration, if necessary:
use Dancer;
use Catmandu;
use Plack::Builder;
use Plack::App::Catmandu::OAI;
my $dancer_app = sub {
Dancer->dance(Dancer::Request->new(env => $_[0]));
};
builder {
enable 'ReverseProxy';
enable '+Dancer::Middleware::Rebase', base => Catmandu->config->{uri_base}, strip => 1;
mount "/oai" => Plack::App::Catmandu::OAI->new(
%{config->{plugins}->{'Catmandu::OAI'}}
)->to_app;
mount "/" => builder {
# only create session cookies for dancer application
enable "Session";
mount '/' => $dancer_app;
};
};
METHODS
to_app
returns Plack application that can be mounted. Path rebasements are
taken into account
AUTHOR
Nicolas Franck, <nicolas.franck at ugent.be>
IMPORTANT
This module is still a work in progress, and needs further testing
before using it in a production system
LICENSE AND COPYRIGHT
This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
( run in 1.205 second using v1.01-cache-2.11-cpan-800906f7e73 )