line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Importer::OAI::Parser::lido; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
225807
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
177868
|
|
|
1
|
|
|
|
|
10
|
|
4
|
1
|
|
|
1
|
|
326
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
5
|
1
|
|
|
1
|
|
1141
|
use Catmandu; |
|
1
|
|
|
|
|
127586
|
|
|
1
|
|
|
|
|
6
|
|
6
|
1
|
|
|
1
|
|
239
|
use Catmandu::Util; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
47
|
|
7
|
1
|
|
|
1
|
|
527
|
use Lido::XML; |
|
1
|
|
|
|
|
228849
|
|
|
1
|
|
|
|
|
42
|
|
8
|
1
|
|
|
1
|
|
816
|
use JSON; |
|
1
|
|
|
|
|
6644
|
|
|
1
|
|
|
|
|
8
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
with 'Catmandu::Logger'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has 'lido' => (is => 'lazy'); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub _build_lido { |
15
|
1
|
|
|
1
|
|
31
|
return Lido::XML->new; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub parse { |
19
|
1
|
|
|
1
|
0
|
3931
|
my ($self,$dom) = @_; |
20
|
|
|
|
|
|
|
|
21
|
1
|
50
|
|
|
|
5
|
return undef unless defined $dom; |
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
|
|
6
|
my $xml = $dom->toString; |
24
|
1
|
|
|
|
|
218
|
my $perl = { error => 1 }; |
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
|
|
2
|
eval { |
27
|
1
|
|
|
|
|
30
|
$perl = $self->lido->parse($xml); |
28
|
|
|
|
|
|
|
}; |
29
|
1
|
50
|
|
|
|
3643955
|
if ($@) { |
30
|
0
|
|
|
|
|
0
|
$perl = { error => $@ }; |
31
|
0
|
|
|
|
|
0
|
$self->log->error($@); |
32
|
0
|
|
|
|
|
0
|
$self->log->error("Failed to parse: $xml"); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
1
|
|
|
|
|
9
|
{ _metadata => $perl }; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=encoding utf8 |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 NAME |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Catmandu::Importer::OAI::Parser::lido - A Lido XML OAI-PMH handler |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 SYNOPSIS |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Command line client C<catmandu>: |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
catmandu convert OAI \ |
53
|
|
|
|
|
|
|
--url http://collections.britishart.yale.edu/oaicatmuseum/OAIHandler \ |
54
|
|
|
|
|
|
|
--metadataPrefix lido \ |
55
|
|
|
|
|
|
|
--handler lido to YAML \ |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 SEE ALSO |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
L<Catmandu::OAI> |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=cut |