[Catalyst-commits] r8015 - Catalyst-Controller-DBIC-API/1.000/trunk/lib/Catalyst/Controller/DBIC

lukes at dev.catalyst.perl.org lukes at dev.catalyst.perl.org
Fri Jun 27 16:22:00 BST 2008


Author: lukes
Date: 2008-06-27 16:22:00 +0100 (Fri, 27 Jun 2008)
New Revision: 8015

Modified:
   Catalyst-Controller-DBIC-API/1.000/trunk/lib/Catalyst/Controller/DBIC/API.pm
Log:
added perldoc for API.pm class

Modified: Catalyst-Controller-DBIC-API/1.000/trunk/lib/Catalyst/Controller/DBIC/API.pm
===================================================================
--- Catalyst-Controller-DBIC-API/1.000/trunk/lib/Catalyst/Controller/DBIC/API.pm	2008-06-27 14:54:47 UTC (rev 8014)
+++ Catalyst-Controller-DBIC-API/1.000/trunk/lib/Catalyst/Controller/DBIC/API.pm	2008-06-27 15:22:00 UTC (rev 8015)
@@ -3,11 +3,48 @@
 use strict;
 use warnings;
 
+=head1 VERSION
+
+Version 1.00000
+
+=cut
+
 our $VERSION = '1.000000';
 
+=head1 NAME
+
+Catalyst::Controller::DBIC::API
+
+=head1 SYNOPSIS
+
+  package MyApp::Controller::API::RPC::Artist;
+  use base qw/Catalyst::Controller::DBIC::API::RPC/;
+
+  __PACKAGE__->config
+    ( action => { setup => { PathPart => 'artist', Chained => '/api/rpc/rpc_base' } }, # define parent chain action and partpath
+      class => 'MyAppDB::Artist', # DBIC schema class
+      create_requires => ['name', 'age'], # columns required to create
+      create_allows => ['nickname'], # additional non-required columns that create allows
+      update_allows => ['name', 'age', 'nickname'] # columns that update allows
+      );
+
+  # Provides the following functional endpoints:
+  # /api/rpc/artist/create
+  # /api/rpc/artist/list
+  # /api/rpc/artist/id/[id]/delete
+  # /api/rpc/artist/id/[id]/update
+
+=head1 DESCRIPTION
+
+Easily provide common API endpoints based on your L<DBIx::Class> schema classes. Module provides both RPC and REST interfaces to base functionality. Uses L<Catalyst::Action::Serialise> and L<Catalyst::Action::Deserialise> to serialise response and/or deserialise request.
+
+=head1 GETTING STARTED
+
+See L<Catalyst::Controller::API::Base> for descriptions of base functionlity such as list, create, delete, update and config attributes. Then see L<Catalyst::Controller::API::RPC> or L<Catalyst::Controller::API::REST> for details of provided endpoints on to those base methods.
+
 =head1 AUTHOR
 
-luke saunders
+  Luke Saunders <luke.saunders at gmail.com>
 
 =cut
 




More information about the Catalyst-commits mailing list