line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::AlephX::Op::FindDoc; |
2
|
1
|
|
|
1
|
|
101226
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
190410
|
|
|
1
|
|
|
|
|
7
|
|
3
|
1
|
|
|
1
|
|
315
|
use Moo; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
4
|
1
|
|
|
1
|
|
894
|
use Catmandu::AlephX; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
31
|
|
5
|
1
|
|
|
1
|
|
434
|
use Catmandu::AlephX::Metadata::MARC::Aleph; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
33
|
|
6
|
1
|
|
|
1
|
|
440
|
use Catmandu::AlephX::Record; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
352
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = "1.072"; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
with('Catmandu::AlephX::Response'); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has record => ( |
13
|
|
|
|
|
|
|
is => 'ro' |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
0
|
|
|
0
|
0
|
|
sub op { 'find-doc' } |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub parse { |
19
|
0
|
|
|
0
|
0
|
|
my($class,$str_ref,$args) = @_; |
20
|
0
|
|
0
|
|
|
|
my $doc_num = $args->{doc_num} || $args->{doc_number}; |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
$doc_num = Catmandu::AlephX->format_doc_num($doc_num); |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
my $xpath = xpath($str_ref); |
25
|
0
|
|
|
|
|
|
my $op = op(); |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
my @metadata = (); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
__PACKAGE__->new( |
30
|
|
|
|
|
|
|
record => Catmandu::AlephX::Record->new(metadata => sub { |
31
|
0
|
|
|
0
|
|
|
my($oai_marc) = $xpath->find("/$op/record[1]/metadata/oai_marc")->get_nodelist(); |
32
|
0
|
0
|
|
|
|
|
if($oai_marc){ |
33
|
0
|
|
|
|
|
|
my $m = Catmandu::AlephX::Metadata::MARC::Aleph->parse($oai_marc); |
34
|
0
|
|
|
|
|
|
$m->data->{_id} = $doc_num; |
35
|
0
|
|
|
|
|
|
return $m; |
36
|
|
|
|
|
|
|
} |
37
|
0
|
|
|
|
|
|
}), |
38
|
|
|
|
|
|
|
session_id => $xpath->findvalue("/$op/session-id"), |
39
|
|
|
|
|
|
|
errors => $class->parse_errors($xpath), |
40
|
|
|
|
|
|
|
content_ref => $str_ref |
41
|
|
|
|
|
|
|
); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |