/usr/share/perl5/SRU/Response/Explain.pm is in libsru-perl 1.01-2.
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 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | package SRU::Response::Explain;
{
$SRU::Response::Explain::VERSION = '1.01';
}
#ABSTRACT: A class for representing SRU explain responses
use strict;
use warnings;
use base qw( Class::Accessor SRU::Response );
use SRU::Response::Diagnostic;
use SRU::Utils qw( error );
use SRU::Utils::XML qw( element );
use Carp qw( croak );
sub new {
my ($class,$request) = @_;
return error( 'must pass in a SRU::Request::Explain object' )
if ! ref($request) or ! $request->isa( 'SRU::Request::Explain' );
my $self = $class->SUPER::new( {
version => $request->version(),
record => '',
diagnostics => [],
extraResponseData => '',
echoedExplainRequest => $request->asXML(),
stylesheet => $request->stylesheet(),
} );
return $self;
}
SRU::Response::Explain->mk_accessors( qw(
version
diagnostics
extraResponseData
echoedExplainRequest
stylesheet
) );
sub record {
my ( $self, $record ) = @_;
if ( $record ) {
croak( "must pass in a SRU::Response::Record object" )
if ref($record) ne 'SRU::Response::Record';
$self->{record} = $record;
}
return $self->{record};
}
sub asXML {
my $self = shift;
my $stylesheet = $self->stylesheetXML();
my $echoedExplainRequest = $self->echoedExplainRequest();
my $diagnostics = $self->diagnosticsXML();
my $record = $self->record() ? $self->record()->asXML() : '';
my $xml =
<<"EXPLAIN_XML";
<?xml version="1.0"?>
$stylesheet
<explainResponse xmlns="http://www.loc.gov/zing/srw/">
<version>1.1</version>
$record
$echoedExplainRequest
$diagnostics
</explainResponse>
EXPLAIN_XML
return $xml;
}
1;
__END__
=pod
=head1 NAME
SRU::Response::Explain - A class for representing SRU explain responses
=head1 SYNOPSIS
use SRU::Response;
my $response = SRU::Response::Explain->new( $request );
=head1 DESCRIPTION
=head1 METHODS
=head2 new()
The constructor which requires that you pass in a SRU::Request::Explain
object.
=cut
=head2 version()
=head2 record()
=head2 addDiagnostic()
Add a SRU::Response::Diagnostic object to the response.
=head2 diagnostics()
Returns an array ref of SRU::Response::Diagnostic objects relevant
for the response.
=head2 extraResponseData()
=head2 echoedExplainRequest()
=cut
=head2 asXML()
=cut
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Ed Summers.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
|