Plack-App-Catmandu-SRU

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN

  "dist_author" => [
    "=over 4"
  ],
  "dist_name" => "Plack-App-Catmandu-SRU",
  "dist_version" => "0.02",
  "license" => "perl",
  "module_name" => "Plack::App::Catmandu::SRU",
  "recursive_test_files" => 1,
  "requires" => {
    "Catmandu" => "1.20",
    "Catmandu::Exporter::Template" => "0.11",
    "Plack" => 0,
    "SRU" => "1.01",
    "Type::Tiny" => 0,
    "namespace::clean" => 0,
    "perl" => "v5.20.0"
  },
  "test_requires" => {
    "Test::More" => "0.88"
  }
);

META.json  view on Meta::CPAN

      },
      "develop" : {
         "requires" : {
            "Dist::Milla" : "v1.0.22",
            "Test::Pod" : "1.41"
         }
      },
      "runtime" : {
         "requires" : {
            "Catmandu" : "1.20",
            "Catmandu::Exporter::Template" : "0.11",
            "Plack" : "0",
            "SRU" : "1.01",
            "Type::Tiny" : "0",
            "namespace::clean" : "0",
            "perl" : "v5.20.0"
         }
      },
      "test" : {
         "requires" : {
            "Test::More" : "0.88"

META.yml  view on Meta::CPAN

no_index:
  directory:
    - eg
    - examples
    - inc
    - share
    - t
    - xt
requires:
  Catmandu: '1.20'
  Catmandu::Exporter::Template: '0.11'
  Plack: '0'
  SRU: '1.01'
  Type::Tiny: '0'
  namespace::clean: '0'
  perl: v5.20.0
resources:
  bugtracker: https://github.com/LibreCat/Plack-App-Catmandu-SRU/issues
  homepage: https://github.com/LibreCat/Plack-App-Catmandu-SRU
  repository: https://github.com/LibreCat/Plack-App-Catmandu-SRU.git
version: '0.02'

README  view on Meta::CPAN


      * fix - Optionally an array of fixes to apply to the records before
      they are transformed into XML

      * template - The path to a Template Toolkit file to transform your
      records into this format

    template_options

      An optional hash of configuration options that will be passed to
      Catmandu::Exporter::Template or Template

    content_type

      Set a custom content type header, the default is text/xml.

    title

      Title shown in databaseInfo

    description

cpanfile  view on Meta::CPAN

requires 'perl', 'v5.20.0';

on test => sub {
    requires 'Test::More', '0.88';
};

requires 'Plack';
requires 'Catmandu', '>=1.20';
requires 'Catmandu::Exporter::Template', '0.11';
requires 'SRU', '1.01';
requires 'Type::Tiny';
requires 'namespace::clean';

lib/Plack/App/Catmandu/SRU.pm  view on Meta::CPAN

package Plack::App::Catmandu::SRU;

our $VERSION = '0.02';

use Catmandu::Sane;
use Catmandu;
use Catmandu::Fix;
use Catmandu::Exporter::Template;
use URI;
use SRU::Request;
use SRU::Response;
use Types::Standard qw(Str ArrayRef HashRef ConsumerOf);
use Types::Common::String qw(NonEmptyStr);
use Types::Common::Numeric qw(PositiveInt);
use Moo;
use Plack::Request;
use namespace::clean;
use feature qw(signatures);

lib/Plack/App/Catmandu/SRU.pm  view on Meta::CPAN

                if (index($e, 'cql error') == 0) {
                    $response->addDiagnostic(SRU::Response::Diagnostic->newFromCode(10));
                    return $self->render_sru_response($response);
                }
                Catmandu::Error->throw($e);
            };

            $hits->each(sub {
                my $data     = $_[0];
                my $metadata = "";
                my $exporter = Catmandu::Exporter::Template->new(
                    %$template_options,
                    template => $template,
                    file     => \$metadata
                );
                $exporter->add($fix ? $fix->fix($data) : $data);
                $exporter->commit;
                $response->addRecord(SRU::Response::Record->new(
                    recordSchema => $identifier,
                    recordData   => $metadata,
                ));

lib/Plack/App/Catmandu/SRU.pm  view on Meta::CPAN

* identifier - The SRU identifier for the schema (see L<http://www.loc.gov/standards/sru/recordSchemas/>)

* name - A short descriptive name for the schema

* fix - Optionally an array of fixes to apply to the records before they are transformed into XML

* template - The path to a Template Toolkit file to transform your records into this format

=item template_options

An optional hash of configuration options that will be passed to L<Catmandu::Exporter::Template> or L<Template>

=item content_type

Set a custom content type header, the default is C<text/xml>.

=item title

Title shown in databaseInfo

=item description



( run in 0.280 second using v1.01-cache-2.11-cpan-0f795438458 )