
Catalyst::Plugin::AtomPP - Dispatch AtomPP methods with Catalyst.

use Catalyst qw/AtomPP/;
sub entry : Local {
my ($self, $c) = @_;
$c->atom; # dispatch AtomPP methods.
}
sub create_entry : Remote {
my ($self, $c, $entry) = @_;
# $entry is XML::Atom Object from Request content
...
}
sub retrieve_entry : Remote {
my ($self, $c) = @_;
...
}
sub update_entry : Remote {
...
}
sub delete_entry : Remote {
...
}

This plugin allows you to dispatch AtomPP methods with Catalyst.
Remote method decided by HTTP Request Method. It's CRUD Model.
ex) GET /path/to/entry then retrieve_entry is called. POST /path/to/entry then create_entry is called.
If you want to decide remote method's suffix, you can set it like $c->atom('foobar'). Then (create|retrieve|update|delete)_foobar method is called.
May require other authentication plugin, if needed. (Authentication::CDBI::Basic, WSSE, or so)

If you set true value at $c->config->{atompp}->{auto_response}, AtomPP plugin set automatically $c->res->status or $c->res->body by value that Remote method returned.
If your remote method return /^\d{3}$/ ( 200 or so ), AtomPP plugin execute $c->res->status( 200 );
Or return XML::Atom::Entry or XML::Atom::Feed object, execute $c->res->body( $xmlatom_obj->as_xml );
Or other not false value returned, then execute $c->res->body( $returnd_value );


Catalyst, Catalyst::Plugin::XMLRPC.

Daisuke Murase, <typester@cpan.org>

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