line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::AlephX::Op::Present; |
2
|
1
|
|
|
1
|
|
80786
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
154759
|
|
|
1
|
|
|
|
|
7
|
|
3
|
1
|
|
|
1
|
|
268
|
use Catmandu::Util qw(:is :check); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
384
|
|
4
|
1
|
|
|
1
|
|
7
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
5
|
1
|
|
|
1
|
|
939
|
use Catmandu::AlephX::Metadata::MARC::Aleph; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
27
|
|
6
|
1
|
|
|
1
|
|
390
|
use Catmandu::AlephX::Record::Present; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
374
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = "1.071"; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
with('Catmandu::AlephX::Response'); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has records => ( |
13
|
|
|
|
|
|
|
is => 'ro', |
14
|
|
|
|
|
|
|
lazy => 1, |
15
|
|
|
|
|
|
|
default => sub { [] }, |
16
|
|
|
|
|
|
|
coerce => sub { |
17
|
|
|
|
|
|
|
if(is_code_ref($_[0])){ |
18
|
|
|
|
|
|
|
return $_[0]->(); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
$_[0]; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
); |
23
|
0
|
|
|
0
|
0
|
|
sub op { 'present' } |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub parse { |
26
|
0
|
|
|
0
|
0
|
|
my($class,$str_ref) = @_; |
27
|
0
|
|
|
|
|
|
my $xpath = xpath($str_ref); |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
my $op = op(); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__PACKAGE__->new( |
32
|
|
|
|
|
|
|
records => sub{ |
33
|
0
|
|
|
0
|
|
|
my @records; |
34
|
0
|
|
|
|
|
|
for my $r($xpath->find("/$op/record")->get_nodelist()){ |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
my($l) = $r->find('./record_header')->get_nodelist(); |
37
|
|
|
|
|
|
|
|
38
|
0
|
0
|
|
|
|
|
my $record_header = $l ? get_children($l,1) : {}; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
my $metadata = Catmandu::AlephX::Metadata::MARC::Aleph->parse( |
41
|
|
|
|
|
|
|
$r->find('./metadata/oai_marc')->get_nodelist() |
42
|
|
|
|
|
|
|
); |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
push @records,Catmandu::AlephX::Record::Present->new( |
45
|
|
|
|
|
|
|
metadata => $metadata, |
46
|
|
|
|
|
|
|
record_header => $record_header, |
47
|
|
|
|
|
|
|
doc_number => $r->findvalue('./doc_number') |
48
|
|
|
|
|
|
|
); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
\@records |
53
|
0
|
|
|
|
|
|
}, |
54
|
0
|
|
|
|
|
|
session_id => $xpath->findvalue("/$op/session-id"), |
55
|
|
|
|
|
|
|
errors => $class->parse_errors($xpath), |
56
|
|
|
|
|
|
|
content_ref => $str_ref |
57
|
|
|
|
|
|
|
); |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |