NAME
Catalyst::Controller::Atompub::Base - A Catalyst controller for the Publishing Protocol
DESCRIPTION
Catalyst::Controller::Atompub::Base is a base class of Catalyst::Controller::Atompub::Service and Catalyst::Controller::Atompub::Collection.
METHODS
$controller->new
$controller->info
An accessor for Collection information object.
$controller->error($c, [$status, $message])
Sets an Entry Document containing error message in $c->response->body, and returns undef
.
See "ERROR HANDLING".
ERROR HANDLING
When something wrong happens, return with calling $controller->error method like:
sub foo {
my ($controller ,$c) = @_;
return $controller->error($c, 404, "Entry does not exist")
if is_something_wrong;
}
Then, Atompub server responds with an Entry Document including error message:
HTTP/1.1 404 Not Found
Content-Type: application/atom+xml;type=entry
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
<updated>2007-01-01T00:00:00Z</updated>
<link rel="related"
href="http://localhost:3000/mycollection/entry_1.atom"/>
<title>404 Entry does not exist</title>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
404 Entry does not exist
</div>
</content>
</entry>
This default behavior can be changed by overriding the error
method.
SEE ALSO
XML::Atom XML::Atom::Service Atompub Catalyst::Controller::Atompub
AUTHOR
Takeru INOUE <takeru.inoue _ gmail.com>
LICENCE AND COPYRIGHT
Copyright (c) 2007, Takeru INOUE <takeru.inoue _ gmail.com>
. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
DISCLAIMER OF WARRANTY
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.