| 1 | package Catmandu::Store::OAI; | ||
| 2 | |||
| 3 | use Catmandu::Sane; | ||
| 4 | |||
| 5 | our $VERSION = '0.21'; | ||
| 6 | |||
| 7 | use Moo; | ||
| 8 | use Catmandu::Util qw(:is); | ||
| 9 | use Catmandu::Importer::OAI; | ||
| 10 | use Catmandu::Store::OAI::Bag; | ||
| 11 | use namespace::clean; | ||
| 12 | |||
| 13 | with 'Catmandu::Store'; | ||
| 14 | |||
| 15 | has url => (is => 'ro', required => 1); | ||
| 16 | has metadataPrefix => (is => 'ro', default => sub { "oai_dc" }); | ||
| 17 | has handler => (is => 'ro', default => sub { "oai_dc" }); | ||
| 18 | has oai => (is => 'lazy'); | ||
| 19 | |||
| 20 | sub _build_oai { | ||
| 21 | my ($self) = @_; | ||
| 22 | Catmandu::Importer::OAI->new( | ||
| 23 | url => $self->url , | ||
| 24 | metadataPrefix => $self->metadataPrefix , | ||
| 25 | handler => $self->handler , | ||
| 26 | ); | ||
| 27 | } | ||
| 28 | |||
| 29 | 1; | ||
| 30 | |||
| 31 | __END__ |