line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::OAI::ResumptionToken; |
2
|
|
|
|
|
|
|
|
3
|
15
|
|
|
15
|
|
1051
|
use strict; |
|
15
|
|
|
|
|
34
|
|
|
15
|
|
|
|
|
674
|
|
4
|
15
|
|
|
15
|
|
84
|
use base qw ( XML::SAX::Base ); |
|
15
|
|
|
|
|
35
|
|
|
15
|
|
|
|
|
9983
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
Net::OAI::ResumptionToken - An OAI-PMH resumption token. |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 SYNOPSIS |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 DESCRIPTION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 METHODS |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head2 new() |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=cut |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head2 new() |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=cut |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub new { |
25
|
18
|
|
|
18
|
1
|
576
|
my ( $class, %opts ) = @_; |
26
|
18
|
|
33
|
|
|
173
|
my $self = bless \%opts, ref( $class ) || $class; |
27
|
18
|
|
|
|
|
130
|
$self->{ tagStack } = []; |
28
|
18
|
|
|
|
|
58
|
$self->{ insideResumptionToken } = 0; |
29
|
18
|
|
|
|
|
61
|
$self->{ token } = ''; |
30
|
18
|
|
|
|
|
51
|
$self->{ expirationDate } = ''; |
31
|
18
|
|
|
|
|
55
|
$self->{ completeListSize } = ''; |
32
|
18
|
|
|
|
|
131
|
$self->{ cursor } = ''; |
33
|
18
|
|
|
|
|
86
|
return( $self ); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head2 token() |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=cut |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub token { |
41
|
24
|
|
|
24
|
1
|
718
|
my ( $self, $token ) = @_; |
42
|
24
|
50
|
|
|
|
89
|
if ( $token ) { $self->{ token } = $token; } |
|
0
|
|
|
|
|
0
|
|
43
|
24
|
|
|
|
|
185
|
return( $self->{ resumptionTokenText } ); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head2 expirationDate() |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=cut |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub expirationDate { |
51
|
4
|
|
|
4
|
1
|
313
|
my ( $self, $date ) = @_; |
52
|
4
|
100
|
|
|
|
19
|
if ( $date ) { $self->{ expirationDate } = $date; } |
|
1
|
|
|
|
|
2
|
|
53
|
4
|
|
|
|
|
17
|
return( $self->{ expirationDate } ); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head2 completeListSize() |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=cut |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub completeListSize { |
61
|
4
|
|
|
4
|
1
|
560
|
my ( $self, $size ) = @_; |
62
|
4
|
100
|
|
|
|
18
|
if ( $size ) { $self->{ completeListSize } = $size; } |
|
1
|
|
|
|
|
3
|
|
63
|
4
|
|
|
|
|
15
|
return( $self->{ completeListSize } ); |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head2 cursor() |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=cut |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub cursor { |
71
|
4
|
|
|
4
|
1
|
534
|
my ( $self, $cursor ) = @_; |
72
|
4
|
100
|
|
|
|
17
|
if ( $cursor ) { $self->{ cursor } = $cursor; } |
|
1
|
|
|
|
|
2
|
|
73
|
4
|
|
|
|
|
17
|
return( $self->{ cursor } ); |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 TODO |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 SEE ALSO |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=over 4 |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=back |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 AUTHORS |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=over 4 |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=item * Ed Summers |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=back |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=cut |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
## internal stuff |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
## all children of Net::OAI::Base should call this to make sure |
97
|
|
|
|
|
|
|
## certain object properties are set |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
sub start_element { |
100
|
51965
|
|
|
51965
|
1
|
344766
|
my ( $self, $element ) = @_; |
101
|
51965
|
100
|
|
|
|
105949
|
if ( $element->{ Name } eq 'resumptionToken' ) { |
102
|
10
|
|
|
|
|
106
|
my $attr = $element->{ Attributes }; |
103
|
10
|
|
|
|
|
44
|
$self->{ expirationDate } = $attr->{ '{}expirationDate' }{ Value }; |
104
|
10
|
|
|
|
|
41
|
$self->{ completeListSize } = $attr->{ '{}completeListSize' }{ Value }; |
105
|
10
|
|
|
|
|
33
|
$self->{ cursor } = $attr->{ '{}cursor' }{ Value }; |
106
|
10
|
|
|
|
|
50
|
$self->{ insideResumptionToken } = 1; |
107
|
|
|
|
|
|
|
} else { |
108
|
51955
|
|
|
|
|
148660
|
$self->SUPER::start_element( $element ); |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
} |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
sub end_element { |
113
|
51965
|
|
|
51965
|
1
|
311417
|
my ( $self, $element ) = @_; |
114
|
51965
|
100
|
|
|
|
103105
|
if ( $element->{ Name } eq 'resumptionToken' ) { |
115
|
10
|
|
|
|
|
48
|
Net::OAI::Harvester::debug( "caught resumption token" ); |
116
|
10
|
|
|
|
|
43
|
$self->{ insideResumptionToken } = 0; |
117
|
|
|
|
|
|
|
} else { |
118
|
51955
|
|
|
|
|
144591
|
$self->SUPER::end_element( $element ); |
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
sub characters { |
123
|
108005
|
|
|
108005
|
1
|
641839
|
my ( $self, $characters ) = @_; |
124
|
108005
|
100
|
|
|
|
207966
|
if ( $self->{ insideResumptionToken } ) { |
125
|
9
|
|
|
|
|
48
|
$self->{ resumptionTokenText } .= $characters->{ Data }; |
126
|
|
|
|
|
|
|
} else { |
127
|
107996
|
|
|
|
|
282996
|
$self->SUPER::characters( $characters ); |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
1; |
132
|
|
|
|
|
|
|
|