| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package HTTP::OAI::Header; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
@ISA = qw( HTTP::OAI::MemberMixin HTTP::OAI::SAX::Base ); |
|
4
|
|
|
|
|
|
|
|
|
5
|
11
|
|
|
11
|
|
1330
|
use strict; |
|
|
11
|
|
|
|
|
18
|
|
|
|
11
|
|
|
|
|
2842
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '4.13'; |
|
8
|
|
|
|
|
|
|
|
|
9
|
11
|
|
|
11
|
|
1434
|
use POSIX qw/strftime/; |
|
|
11
|
|
|
|
|
19
|
|
|
|
11
|
|
|
|
|
103
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
33
|
|
|
33
|
1
|
237
|
sub identifier { shift->_elem('identifier',@_) } |
|
12
|
|
|
|
|
|
|
sub datestamp { |
|
13
|
15
|
|
|
15
|
1
|
40
|
my $self = shift; |
|
14
|
15
|
100
|
|
|
|
65
|
return $self->_elem('datestamp') unless @_; |
|
15
|
13
|
50
|
|
|
|
45
|
my $ds = shift or return $self->_elem('datestamp',undef); |
|
16
|
13
|
50
|
|
|
|
93
|
if( $ds =~ /^(\d{4})(\d{2})(\d{2})$/ ) { |
|
|
|
50
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
0
|
$ds = "$1-$2-$3"; |
|
18
|
|
|
|
|
|
|
} elsif( $ds =~ /^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/ ) { |
|
19
|
0
|
|
|
|
|
0
|
$ds = "$1-$2-$3T$4:$5:$6Z"; |
|
20
|
|
|
|
|
|
|
} |
|
21
|
13
|
|
|
|
|
49
|
return $self->_elem('datestamp',$ds); |
|
22
|
|
|
|
|
|
|
} |
|
23
|
16
|
|
|
16
|
1
|
63
|
sub status { shift->_elem('status',@_) } |
|
24
|
14
|
|
|
14
|
1
|
61
|
sub setSpec { shift->_multi('setSpec',@_) } |
|
25
|
|
|
|
|
|
|
|
|
26
|
0
|
|
|
0
|
0
|
0
|
sub now { return strftime("%Y-%m-%dT%H:%M:%SZ",gmtime()) } |
|
27
|
|
|
|
|
|
|
|
|
28
|
0
|
|
0
|
0
|
1
|
0
|
sub is_deleted { my $s = shift->status(); return defined($s) && $s eq 'deleted'; } |
|
|
0
|
|
|
|
|
0
|
|
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub generate |
|
31
|
|
|
|
|
|
|
{ |
|
32
|
1
|
|
|
1
|
1
|
25
|
my ($self, $driver) = @_; |
|
33
|
|
|
|
|
|
|
|
|
34
|
1
|
50
|
|
|
|
4
|
if( defined($self->status) ) { |
|
35
|
1
|
|
|
|
|
14
|
$driver->start_element( 'header', status => $self->status ); |
|
36
|
|
|
|
|
|
|
} else { |
|
37
|
0
|
|
|
|
|
0
|
$driver->start_element( 'header' ); |
|
38
|
|
|
|
|
|
|
} |
|
39
|
1
|
|
|
|
|
88
|
$driver->data_element( 'identifier', $self->identifier ); |
|
40
|
1
|
|
33
|
|
|
32
|
$driver->data_element( 'datestamp', ($self->datestamp || $self->now) ); |
|
41
|
1
|
|
|
|
|
21
|
for($self->setSpec) |
|
42
|
|
|
|
|
|
|
{ |
|
43
|
2
|
|
|
|
|
13
|
$driver->data_element( 'setSpec', $_ ); |
|
44
|
|
|
|
|
|
|
} |
|
45
|
1
|
|
|
|
|
24
|
$driver->end_element( 'header' ); |
|
46
|
|
|
|
|
|
|
} |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub end_element { |
|
49
|
51
|
|
|
51
|
1
|
566
|
my ($self,$hash) = @_; |
|
50
|
51
|
|
|
|
|
139
|
my $elem = lc($hash->{LocalName}); |
|
51
|
51
|
|
|
|
|
94
|
my $text = $hash->{Text}; |
|
52
|
51
|
50
|
|
|
|
108
|
if( defined $text ) |
|
53
|
|
|
|
|
|
|
{ |
|
54
|
51
|
|
|
|
|
121
|
$text =~ s/^\s+//; |
|
55
|
51
|
|
|
|
|
114
|
$text =~ s/\s+$//; |
|
56
|
|
|
|
|
|
|
} |
|
57
|
51
|
100
|
|
|
|
235
|
if( $elem eq 'identifier' ) { |
|
|
|
100
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
58
|
13
|
|
|
|
|
57
|
$self->identifier($text); |
|
59
|
|
|
|
|
|
|
} elsif( $elem eq 'datestamp' ) { |
|
60
|
13
|
|
|
|
|
54
|
$self->datestamp($text); |
|
61
|
|
|
|
|
|
|
} elsif( $elem eq 'setspec' ) { |
|
62
|
12
|
|
|
|
|
34
|
$self->setSpec($text); |
|
63
|
|
|
|
|
|
|
} elsif( $elem eq 'header' ) { |
|
64
|
13
|
|
|
|
|
71
|
$self->status($hash->{Attributes}->{'{}status'}->{Value}); |
|
65
|
|
|
|
|
|
|
} |
|
66
|
|
|
|
|
|
|
} |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
1; |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
__END__ |