The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

DAIA::Response - DAIA information root element

VERSION

version 0.43

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. You can get/set document(s) with the document accessor. A response can only have either documents or items!

item

a list of DAIA::Item objects. You can get/set item(s) with the document accessor. A response can only have either items or documents!

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. You can set message(s) with the message accessor.

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 and accessor methods for all of its properties. To serialize and send a HTTP response, you can use the method serve, which is accessible for all DAIA objects.

serve ( [ [ format => ] $format ] [ %options ] )

Serialize the response and send it to STDOUT with the appropriate HTTP headers. This method is mostly used to serve DAIA::Response objects, but it is also available for other DAIA objects. See "serve" in DAIA::Object for a description.

In most cases, a simple call of $response->serve will be the last statement of a DAIA server implementation.

check_valid_id ( $id )

Check whether a valid identifier has been provided. If not, this methods appends an error message ("please provide a document id" or "document id ... is no valid URI") and returns undef.

AUTHOR

Jakob Voß

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Jakob Voß.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.