File: GetRecord.pm

package info (click to toggle)
libhttp-oai-perl 4.03-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 416 kB
  • ctags: 326
  • sloc: perl: 2,531; xml: 224; makefile: 12
file content (62 lines) | stat: -rw-r--r-- 1,369 bytes parent folder | download
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
package HTTP::OAI::GetRecord;

require HTTP::OAI::ListRecords;
@ISA = qw( HTTP::OAI::ListRecords );

use strict;

sub record
{
	my $self = shift;
	$self->{item} = [@_] if @_;
	return $self->{item}->[0];
}

sub generate_body {
	my ($self, $driver) = @_;

	for( $self->record ) {
		$_->generate( $driver );
	}
}

1;

__END__

=head1 NAME

HTTP::OAI::GetRecord - An OAI GetRecord response

=head1 DESCRIPTION

HTTP::OAI::GetRecord is derived from L<HTTP::OAI::Response|HTTP::OAI::Response> and provides access to the data contained in an OAI GetRecord response in addition to the header information provided by OAI::Response.

=head1 SYNOPSIS

	use HTTP::OAI::GetRecord();

	$res = new HTTP::OAI::GetRecord();
	$res->record($rec);

=head1 METHODS

=over 4

=item $gr = new HTTP::OAI::GetRecord

This constructor method returns a new HTTP::OAI::GetRecord object.

=item $rec = $gr->next

Returns the next record stored in the response, or undef if no more record are available. The record is returned as an L<OAI::Record|OAI::Record>.

=item @recs = $gr->record([$rec])

Returns the record list, and optionally adds a record to the end of the queue. GetRecord will only store one record at a time, so this method will replace any existing record if called with argument(s).

=item $dom = $gr->toDOM()

Returns an XML::DOM object representing the GetRecord response.

=back