line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::OAI::Record; |
2
|
|
|
|
|
|
|
|
3
|
17
|
|
|
17
|
|
87
|
use strict; |
|
17
|
|
|
|
|
31
|
|
|
17
|
|
|
|
|
475
|
|
4
|
17
|
|
|
17
|
|
89
|
use warnings; |
|
17
|
|
|
|
|
29
|
|
|
17
|
|
|
|
|
3372
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
Net::OAI::Record - An OAI-PMH record. |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 SYNOPSIS |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 DESCRIPTION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
Net::OAI::Record objects represent the OAI records harvested by C or C |
15
|
|
|
|
|
|
|
calls (an OAI record consists of the mandatory I, an optional I container |
16
|
|
|
|
|
|
|
element and zero or more I containers) and also the reduced (I |
17
|
|
|
|
|
|
|
delivered by C. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
The objects are created within the processing performed by the corresponding |
20
|
|
|
|
|
|
|
L, L, and L |
21
|
|
|
|
|
|
|
filter classes. They all sit on top of (slightly misnomed) SAX filters of class |
22
|
|
|
|
|
|
|
L. |
23
|
|
|
|
|
|
|
Please consult the documentation of that class if you are interested in writing |
24
|
|
|
|
|
|
|
custom handlers. |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 METHODS |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head2 new() |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
probably don't want to instantiate this yourself |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=cut |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub new { |
35
|
1409
|
|
|
1409
|
1
|
5149
|
my ( $class, %opts ) = @_; |
36
|
|
|
|
|
|
|
return bless { |
37
|
|
|
|
|
|
|
header => $opts{ header }, |
38
|
1409
|
100
|
|
|
|
5574
|
@{[$opts{ metadata } ? (metadata => $opts{ metadata }) : ()]}, |
39
|
1409
|
100
|
33
|
|
|
2847
|
@{[$opts{ recorddata } ? (recorddata => $opts{ recorddata }) : ()]}, |
|
1409
|
|
|
|
|
13395
|
|
40
|
|
|
|
|
|
|
}, ref( $class ) || $class; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 header() |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Returns the C object for the OAI header element that |
46
|
|
|
|
|
|
|
accompanied the record. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=cut |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub header { |
51
|
1211
|
|
|
1211
|
1
|
504276
|
my $self = shift; |
52
|
1211
|
|
|
|
|
3173
|
return( $self->{ header } ); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head2 metadata() |
56
|
|
|
|
|
|
|
=head2 recorddata() |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Returns the object (SAX Handler!) used or created by the C |
59
|
|
|
|
|
|
|
rsp. C filter class at the moment the OAI::Record was created, |
60
|
|
|
|
|
|
|
namely right after parsing encounters the closing OAI record tag. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
In the case of C requests, a clone of the OAI::record is immediately |
63
|
|
|
|
|
|
|
created (by means of L) thus on processing by the next() method these |
64
|
|
|
|
|
|
|
C rsp. C methods will return clones of the original |
65
|
|
|
|
|
|
|
handler object taken at the moment described above. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Will be C when no corresponding option was provided. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Access to the actual data if desired has to be provided by the Handler class. |
70
|
|
|
|
|
|
|
Note that in the case of deleted records the I element of the OAI-PMH response |
71
|
|
|
|
|
|
|
must not contain a metadata container and therefore the metadataHandler |
72
|
|
|
|
|
|
|
for that record will never have been active at all. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=cut |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub metadata { |
77
|
1206
|
|
|
1206
|
1
|
233486
|
my $self = shift; |
78
|
|
|
|
|
|
|
# return undef unless exists $self->{ metadata }; |
79
|
1206
|
|
100
|
|
|
6771
|
return $self->{ metadata } || undef; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub recorddata { |
84
|
603
|
|
|
603
|
1
|
174699
|
my $self = shift; |
85
|
|
|
|
|
|
|
# return undef unless exists $self->{ recorddata }; |
86
|
603
|
|
100
|
|
|
2951
|
return $self->{ recorddata } || undef; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 AUTHOR |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Ed Summers |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=cut |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
1; |