line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::OAI::Record; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
@ISA = qw( HTTP::OAI::MemberMixin HTTP::OAI::SAX::Base ); |
4
|
|
|
|
|
|
|
|
5
|
11
|
|
|
11
|
|
1409
|
use strict; |
|
11
|
|
|
|
|
214
|
|
|
11
|
|
|
|
|
6171
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '4.11'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
11
|
|
|
11
|
1
|
85
|
my ($class,%args) = @_; |
11
|
|
|
|
|
|
|
|
12
|
11
|
|
33
|
|
|
120
|
$args{header} ||= HTTP::OAI::Header->new(%args); |
13
|
|
|
|
|
|
|
|
14
|
11
|
|
|
|
|
54
|
return $class->SUPER::new(%args); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
35
|
|
|
35
|
0
|
441
|
sub header { shift->_elem('header',@_) } |
18
|
18
|
|
|
18
|
0
|
766
|
sub metadata { shift->_elem('metadata',@_) } |
19
|
3
|
|
|
3
|
0
|
46
|
sub about { shift->_multi('about',@_) } |
20
|
|
|
|
|
|
|
|
21
|
18
|
|
|
18
|
1
|
937
|
sub identifier { shift->header->identifier(@_) } |
22
|
1
|
|
|
1
|
1
|
491
|
sub datestamp { shift->header->datestamp(@_) } |
23
|
1
|
|
|
1
|
1
|
248
|
sub status { shift->header->status(@_) } |
24
|
0
|
|
|
0
|
1
|
0
|
sub is_deleted { shift->header->is_deleted(@_) } |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub generate |
27
|
|
|
|
|
|
|
{ |
28
|
1
|
|
|
1
|
0
|
4
|
my( $self, $driver ) = @_; |
29
|
|
|
|
|
|
|
|
30
|
1
|
|
|
|
|
4
|
$driver->start_element('record'); |
31
|
1
|
|
|
|
|
60
|
$self->header->generate( $driver ); |
32
|
1
|
50
|
|
|
|
12
|
$self->metadata->generate( $driver ) if defined $self->metadata; |
33
|
1
|
|
|
|
|
12
|
$self->about->generate( $driver ) for $self->about; |
34
|
1
|
|
|
|
|
3
|
$driver->end_element('record'); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub start_element { |
38
|
197
|
|
|
197
|
1
|
1552
|
my ($self,$hash, $r) = @_; |
39
|
|
|
|
|
|
|
|
40
|
197
|
100
|
|
|
|
427
|
if( !$self->{in_record} ) |
41
|
|
|
|
|
|
|
{ |
42
|
32
|
|
|
|
|
88
|
my $elem = lc($hash->{LocalName}); |
43
|
32
|
50
|
66
|
|
|
264
|
if( $elem eq 'record' && $hash->{Attributes}->{'{}status'}->{Value} ) |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
44
|
|
|
|
|
|
|
{ |
45
|
0
|
|
|
|
|
0
|
$self->status($hash->{Attributes}->{'{}status'}->{Value}); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
elsif( $elem eq "header" ) |
48
|
|
|
|
|
|
|
{ |
49
|
10
|
|
|
|
|
37
|
$self->set_handler(my $handler = HTTP::OAI::Header->new); |
50
|
10
|
|
|
|
|
188
|
$self->header( $handler ); |
51
|
10
|
|
|
|
|
141
|
$self->{in_record} = $hash->{Depth}; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
elsif( $elem =~ /^metadata|about$/ ) |
54
|
|
|
|
|
|
|
{ |
55
|
12
|
|
100
|
|
|
69
|
my $class = $r->handlers->{$elem} || "HTTP::OAI::Metadata"; |
56
|
12
|
|
|
|
|
264
|
$self->set_handler(my $handler = $class->new); |
57
|
12
|
|
|
|
|
269
|
$self->$elem($handler); |
58
|
12
|
|
|
|
|
100
|
$self->{in_record} = $hash->{Depth}; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
197
|
|
|
|
|
428
|
$self->SUPER::start_element($hash, $r); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub end_element { |
66
|
197
|
|
|
197
|
1
|
1429
|
my ($self,$hash, $r) = @_; |
67
|
|
|
|
|
|
|
|
68
|
197
|
|
|
|
|
492
|
$self->SUPER::end_element($hash, $r); |
69
|
|
|
|
|
|
|
|
70
|
197
|
100
|
|
|
|
2461
|
if( $self->{in_record} == $hash->{Depth} ) |
71
|
|
|
|
|
|
|
{ |
72
|
22
|
|
|
|
|
106
|
$self->set_handler( undef ); |
73
|
22
|
|
|
|
|
471
|
$self->{in_record} = 0; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
__END__ |