NAME
DAIA::Response - DAIA information root element
SYNOPSIS
$r = response( # or DAIA::Response->new(
institution => $institution,
message => [ $msg1, $msg2 ],
document => [ $document ]
);
$r->institution( $institution );
$institution = $r->institution;
my $documents = $r->document;
$r->timestamp;
$r->version;
PROPERTIES
- document
-
a list of DAIA::Document objects.
- institution
-
a DAIA::Institution that grants or knows about the documents, items services and availabilities described in this response.
- message
-
a list of DAIA::Message objects.
- timestamp
-
date and time of the response information. It must match the pattern of
xs:dateTime
and is set to the current date and time on initialization.
The additional read-only attribute version gives the current version of DAIA format.
METHODS
DAIA::Response provides the default methods of DAIA::Object, accessor methods for all of its properties and the following methods:
addMessage ( $message | ... )
Add a specified or a new DAIA::Message.
addDocument ( $document | %properties )
Add a specified or a new DAIA::Document.
serve ( [ [ format => ] $format ] [ %options ] )
Serialize the response and send it to STDOUT with the appropriate HTTP headers. The required format (json
or xml
as default) can specified with the first parameter or the format
option. If no format is given, it is searched for in the CGI query parameters. Other possible options are
- header
-
Print HTTP headers (default). Use
header => 0
to disable headers. - xslt
-
Add a link to the given XSLT stylesheet if XML format is requested.
- callback
-
Add this JavaScript callback function in JSON format. If no callback function is specified, it is searched for in the CGI query parameters. You can disable callback support by setting
callback =
undef>.
AUTHOR
Jakob Voss <jakob.voss@gbv.de>
LICENSE
Copyright (C) 2009 by Verbundzentrale Goettingen (VZG) and Jakob Voss
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.