line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::OAI::Identify; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
@ISA = qw( HTTP::OAI::Verb ); |
4
|
|
|
|
|
|
|
|
5
|
11
|
|
|
11
|
|
71
|
use strict; |
|
11
|
|
|
|
|
19
|
|
|
11
|
|
|
|
|
539
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '4.13'; |
8
|
|
|
|
|
|
|
|
9
|
11
|
|
|
11
|
|
4429
|
use HTTP::OAI::SAXHandler qw( :SAX ); |
|
11
|
|
|
|
|
29
|
|
|
11
|
|
|
|
|
8846
|
|
10
|
|
|
|
|
|
|
|
11
|
7
|
|
|
7
|
1
|
119
|
sub adminEmail { shift->_elem('adminEmail',@_) } |
12
|
28
|
|
|
28
|
1
|
20628
|
sub baseURL { shift->_elem('baseURL',@_) } |
13
|
1
|
|
|
1
|
1
|
5
|
sub compression { shift->_multi('compression',@_) } |
14
|
2
|
|
|
2
|
0
|
58
|
sub deletedRecord { shift->_elem('deletedRecord',@_) } |
15
|
9
|
|
|
9
|
1
|
31
|
sub description { shift->_multi('description',@_) } |
16
|
1
|
|
|
1
|
1
|
10
|
sub earliestDatestamp { shift->_elem('earliestDatestamp',@_) } |
17
|
2
|
|
|
2
|
1
|
60
|
sub granularity { shift->_elem('granularity',@_) } |
18
|
12
|
|
|
12
|
1
|
85
|
sub protocolVersion { shift->_elem('protocolVersion',@_) } |
19
|
5
|
|
|
5
|
1
|
110
|
sub repositoryName { shift->_elem('repositoryName',@_) } |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub next { |
22
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
23
|
0
|
|
|
|
|
0
|
return shift @{$self->{description}}; |
|
0
|
|
|
|
|
0
|
|
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub generate_body |
27
|
|
|
|
|
|
|
{ |
28
|
1
|
|
|
1
|
0
|
4
|
my( $self, $driver ) = @_; |
29
|
|
|
|
|
|
|
|
30
|
1
|
|
|
|
|
4
|
for(qw( repositoryName baseURL protocolVersion adminEmail earliestDatestamp deletedRecord granularity compression )) |
31
|
|
|
|
|
|
|
{ |
32
|
8
|
|
|
|
|
81
|
foreach my $value ($self->$_) |
33
|
|
|
|
|
|
|
{ |
34
|
7
|
|
|
|
|
70
|
$driver->data_element( $_, $value ); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
|
|
8
|
for($self->description) { |
39
|
2
|
|
|
|
|
27
|
$_->generate( $driver ); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub start_element { |
44
|
64
|
|
|
64
|
1
|
548
|
my ($self,$hash,$r) = @_; |
45
|
64
|
|
|
|
|
152
|
my $elem = lc($hash->{LocalName}); |
46
|
64
|
100
|
66
|
|
|
163
|
if( $elem eq 'description' && !$self->{"in_$elem"} ) { |
47
|
4
|
|
|
|
|
63
|
$self->set_handler(my $desc = HTTP::OAI::Metadata->new); |
48
|
4
|
|
|
|
|
69
|
$self->description([$self->description, $desc]); |
49
|
4
|
|
|
|
|
17
|
$self->{"in_$elem"} = $hash->{Depth}; |
50
|
|
|
|
|
|
|
} |
51
|
64
|
|
|
|
|
167
|
$self->SUPER::start_element($hash,$r); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub end_element { |
55
|
64
|
|
|
64
|
1
|
484
|
my ($self,$hash,$r) = @_; |
56
|
64
|
|
|
|
|
99
|
my $elem = $hash->{LocalName}; |
57
|
64
|
|
|
|
|
85
|
my $text = $hash->{Text}; |
58
|
64
|
50
|
|
|
|
130
|
if( defined $text ) |
59
|
|
|
|
|
|
|
{ |
60
|
64
|
|
|
|
|
125
|
$text =~ s/^\s+//; |
61
|
64
|
|
|
|
|
137
|
$text =~ s/\s+$//; |
62
|
|
|
|
|
|
|
} |
63
|
64
|
|
|
|
|
172
|
$self->SUPER::end_element($hash,$r); |
64
|
64
|
100
|
66
|
|
|
677
|
if( defined($self->get_handler) ) { |
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
65
|
32
|
100
|
66
|
|
|
326
|
if( $elem eq 'description' && $self->{"in_$elem"} == $hash->{Depth} ) { |
66
|
4
|
|
|
|
|
14
|
$self->set_handler( undef ); |
67
|
4
|
|
|
|
|
78
|
$self->{"in_$elem"} = 0; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
} elsif( $elem eq 'adminEmail' ) { |
70
|
4
|
|
|
|
|
66
|
$self->adminEmail($text); |
71
|
|
|
|
|
|
|
} elsif( $elem eq 'compression' ) { |
72
|
0
|
|
|
|
|
0
|
$self->compression($text); |
73
|
|
|
|
|
|
|
} elsif( $elem eq 'baseURL' ) { |
74
|
4
|
|
|
|
|
52
|
$self->baseURL($text); |
75
|
|
|
|
|
|
|
} elsif( $elem eq 'protocolVersion' ) { |
76
|
4
|
50
|
33
|
|
|
80
|
$text = '2.0' if $text =~ /\D/ or $text < 2.0; |
77
|
4
|
|
|
|
|
20
|
$self->protocolVersion($text); |
78
|
|
|
|
|
|
|
} elsif( defined($text) && length($text) ) { |
79
|
16
|
|
|
|
|
324
|
$self->_elem($elem,$text); |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
1; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
__END__ |