/usr/share/perl5/HTTP/OAI/ResumptionToken.pm is in libhttp-oai-perl 4.03-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | package HTTP::OAI::ResumptionToken;
@ISA = qw( HTTP::OAI::MemberMixin XML::SAX::Base );
use strict;
use overload "bool" => \¬_empty;
sub resumptionToken { shift->_elem('resumptionToken',@_) }
sub expirationDate { shift->_elem('expirationDate',@_) }
sub completeListSize { shift->_elem('completeListSize',@_) }
sub cursor { shift->_elem('cursor',@_) }
sub not_empty { defined($_[0]->resumptionToken) and length($_[0]->resumptionToken) > 0 }
sub is_empty { !not_empty(@_) }
sub generate {
my( $self, $driver ) = @_;
$driver->data_element( 'resumptionToken', $self->resumptionToken,
expirationDate => scalar($self->expirationDate),
completeListSize => scalar($self->completeListSize),
cursor => scalar($self->cursor),
);
}
sub end_element {
my ($self,$hash) = @_;
$self->SUPER::end_element($hash);
if( lc($hash->{LocalName}) eq 'resumptiontoken' ) {
$self->resumptionToken($hash->{Text});
my $attr = $hash->{Attributes};
$self->expirationDate($attr->{'{}expirationDate'}->{'Value'});
$self->completeListSize($attr->{'{}completeListSize'}->{'Value'});
$self->cursor($attr->{'{}cursor'}->{'Value'});
}
}
1;
__END__
=head1 NAME
HTTP::OAI::ResumptionToken - Encapsulates an OAI resumption token
=head1 METHODS
=over 4
=item $rt = new HTTP::OAI::ResumptionToken
This constructor method returns a new HTTP::OAI::ResumptionToken object.
=item $token = $rt->resumptionToken([$token])
Returns and optionally sets the resumption token string.
=item $ed = $rt->expirationDate([$rt])
Returns and optionally sets the expiration date of the resumption token.
=item $cls = $rt->completeListSize([$cls])
Returns and optionally sets the cardinality of the result set.
=item $cur = $rt->cursor([$cur])
Returns and optionally sets the index of the first record (of the current page) in the result set.
=back
=head1 NOTE - Completing incomplete list
The final page of a record list which has been split using resumption tokens must contain an empty resumption token.
|