Loads of cleanup / updating work
Tomas Doran [Tue, 1 Sep 2009 01:12:16 +0000 (01:12 +0000)]
TODO [new file with mode: 0644]
lib/Catalyst/Manual.pm
lib/Catalyst/Manual/About.pod
lib/Catalyst/Manual/Actions.pod
lib/Catalyst/Manual/CatalystAndMoose.pod
lib/Catalyst/Manual/Components.pod [moved from lib/Catalyst/Manual/Plugins.pod with 72% similarity]
lib/Catalyst/Manual/Cookbook.pod
lib/Catalyst/Manual/DevelopmentProcess.pod
lib/Catalyst/Manual/ExtendingCatalyst.pod
lib/Catalyst/Manual/Internals.pod
lib/Catalyst/Manual/Intro.pod

diff --git a/TODO b/TODO
new file mode 100644 (file)
index 0000000..fc963c4
--- /dev/null
+++ b/TODO
@@ -0,0 +1,23 @@
+::Internals
+  - Needs work
+
+::ExtendingCatalyst
+  - Should fix / merge action docs
+
+::Plugins
+  - Needs all those plugins evaluating and stuff replacing
+  - Update obsolete list
+
+::DevelopmentProcess
+  - Needs more repos stuff adding
+
+::Intro
+  - Has way too much stuff in
+
+::Cookbook
+  - Re-add section on checking roles
+
+EVERYTHING
+  - Paul Makepeace - stuff he threatened to document from mailing list
+  - Kill all use base
+  - Kill all use parent
\ No newline at end of file
index 198f584..74cc170 100644 (file)
@@ -98,6 +98,17 @@ http://www.packtpub.com/catalyst-perl-web-application/book
 
 =back
 
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
+
+=head1 COPYRIGHT
+
+This library is free software. You can redistribute it and/or modify it under
+the same terms as Perl itself.
+
+=cut
+
 =cut
 
 1;
index 805bf8d..d3dc0d6 100644 (file)
@@ -303,15 +303,17 @@ others it's just a matter of personal preference (perhaps your template,
 rather than your Controller, is the better place to decide what to
 display if you get an empty result). Catalyst just gives you the tools.
 
-=head1 AUTHOR
-
-Jesse Sheidlower, C<jester@panix.com>
-
 =head1 SEE ALSO
 
 L<Catalyst>, L<Catalyst::Manual::Intro>
 
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
+
 =head1 COPYRIGHT
 
-This program is free software, you can redistribute it and/or modify it
-under the same terms as Perl itself.
+This library is free software. You can redistribute it and/or modify it under
+the same terms as Perl itself.
+
+=cut
index 461945e..1952b2b 100644 (file)
@@ -33,23 +33,62 @@ Implementing the action itself is almost as easy. Just use
 L<Catalyst::Action> as a base class and decorate the C<execute> call in
 the Action class:
 
-  package Catalyst::Action::SayBefore;
+  package Catalyst::Action::MyAction;
+  use Moose;
+  use namespace::autoclean;
+  
+  extends 'Catalyst::Action';
+
+  before 'execute' => sub {
+    my ( $self, $controller, $c, $test ) = @_;
+    $c->stash->{what} = 'world';
+  };
+
+  after 'extecute' => sub {
+      my ( $self, $controller, $c, $test ) = @_;
+      $c->stash->{foo} = 'bar';
+  };
+
+  __PACKAGE__->meta->make_immutable;
+
+Pretty simple, huh?
 
-  use base 'Catalyst::Action';
+=head1 ACTION ROLES
 
-  sub execute {
-    my $self = shift;
-    my ( $controller, $c, $test ) = @_;
+You can only have one action class per action, which can be somewhat inflexible.
+
+The solution to this is to use L<Catalyst::Controller::ActionRole>, which
+would make the example above look like this:
+
+  package Catalyst::ActionRole::MyActionRole;
+  use Moose::Role;
+
+  before 'execute' => sub {
+    my ( $self, $controller, $c, $test ) = @_;
     $c->stash->{what} = 'world';
-    $self->next::method( @_ );
   };
 
+  after 'extecute' => sub {
+      my ( $self, $controller, $c, $test ) = @_;
+      $c->stash->{foo} = 'bar';
+  };
+  
   1;
 
-If you want to do something after the action, just put it after the
-C<execute> call. Pretty simple, huh?
+and this would be used in a controller like this:
 
-=head1 ACTIONS
+  package MyApp::Controller::Foo;
+  use Moose;
+  use namespace::autoclean;
+  BEGIN { extends 'Catalyst::Controller::ActionRole'; }
+
+  sub foo : Does('MyActionRole') {
+      my ($self, $c) = @_;
+  }
+
+  1;
+
+=head1 EXAMPLE ACTIONS
 
 =head2 Catalyst::Action::RenderView
 
@@ -57,11 +96,24 @@ This is meant to decorate end actions. It's similar in operation to
 L<Catalyst::Plugin::DefaultEnd>, but allows you to decide on an action
 level rather than on an application level where it should be run.
 
-=head1 AUTHOR
+=head2 Catalyst::Action::REST
+
+Provides additional syntax for dispatching based upon the HTTP method
+of the request.
 
-The Catalyst Core Team - see http://catalyst.perl.org/
+=head1 EXAMPLE ACTIONROLES
+
+=head2 Catalyst::ActionRole::ACL
+
+Provides ACLs for role membership by decorating your actions.
+
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
 
 =head1 COPYRIGHT
 
-This program is free software. You can redistribute it and/or modify it
-under the same terms as Perl itself.
+This library is free software. You can redistribute it and/or modify it under
+the same terms as Perl itself.
+
+=cut
index adcfaf3..e2a0cfd 100644 (file)
@@ -155,11 +155,14 @@ the trait introduced in L<MooseX::MethodAttributes> version 0.12, example:
 
        with 'MyApp::ControllerRole';
        
-=head1 AUTHOR
+=head1 AUTHORS
 
-The Catalyst Core Team - see http://catalyst.perl.org/
+Catalyst Contributors, see Catalyst.pm
 
 =head1 COPYRIGHT
 
-This program is free software. You can redistribute it and/or modify it
-under the same terms as Perl itself.
+This library is free software. You can redistribute it and/or modify it under
+the same terms as Perl itself.
+
+=cut
+
similarity index 72%
rename from lib/Catalyst/Manual/Plugins.pod
rename to lib/Catalyst/Manual/Components.pod
index 0b21a17..295733b 100644 (file)
@@ -1,17 +1,17 @@
 =head1 NAME
 
-Catalyst::Manual::Plugins - Catalyst Plugins (and Components)
+Catalyst::Manual::Component - Reuseable components for Catalyst applications.
 
 =head1 DESCRIPTION
 
-This section lists the some of the plugins and components that are
-available to extend the runtime functionality of Catalyst. Most plugins
+This section lists the some of the components (and plugins) that are
+available to extend the runtime functionality of Catalyst. Most components
 are not distributed with Catalyst but should be available from CPAN.
 They typically require additional modules from CPAN.
 
 This list may well be outdated by the time you read this and some
 plugins may be deprecated or now part of core L<Catalyst>. Be sure to
-check the Catalyst::Plugin namespace for additional plugins and consult
+check the Catalyst:: and CatalystX:: namespaces for additional components and consult
 the mailing list ( L<http://dev.catalyst.perl.org/wiki/Support> ) for
 advice on the current status or preferred use of your chosen
 plugin/framework.
@@ -44,73 +44,146 @@ Atom API server for any Catalyst-based application.
 An infrastructure plugin for the Catalyst authentication framework. Now the
 recommended way to do any form of Authentication.
 
-=head2 L<Catalyst::Plugin::Authentication::Credential::Atom>
+Note that newer versions of the authentication plugin allow multiple
+C<realms>, so that you can authenticate users in different ways in different
+parts of your application.
 
-L<Catalyst::Plugin::Authentication::Credential::Atom> is a plugin which
-implements WSSE and Basic authentication for Catalyst applications using
-L<Catalyst::Plugin::AtomServer>
+This, however, has involved deprecated all classes in the
+C<Catalyst::Plugin::Authentication::Credential::XXX> and
+C<Catalyst::Plugin::Authentication::Store::XXX> namespaces.
 
-=head2 L<Catalyst::Plugin::Authentication::Credential::CHAP>
+These plugins are still useable, however they have mostly been
+replaced with new modules in the new namespace which will work together.
 
-=head2 L<Catalyst::Plugin::Authentication::Credential::Flickr>
+=head3 Available Credential modules:
+
+=head4 L<Catalyst::Authentication::Credential::AuthTkt>
+
+Allows you to use the L<Apache::AuthTkt> module with Catalyst.
+
+=head4 L<Catalyst::Authentication::Credential::FBConnect>
+
+Allows you to authenticate facebook users using the FBConnect API.
+
+=head4 L<Catalyst::Authentication::Credential::Flickr>
 
 Provides authentication via Flickr, using its API.
 
-=head2 L<Catalyst::Plugin::Authentication::Credential::Hatena>
+=head4 L<Catalyst::Authentication::Credential::HTTP>
+
+Allows you to authenticate users using HTTP Basic or Digest authentication.
+
+=head4 L<Catalyst::Authentication::Credential::HTTP::Proxy>
+
+Allows you to authenticate users against a remote web server
+offering HTTP authentication.
 
-=head2 L<Catalyst::Plugin::Authentication::Credential::HTTP>
+=head4 L<Catalyst::Authentication::Credential::Kerberos>
 
-Implements HTTP Basic authentication for Catalyst.
+Allows you to authenticate your users against a Kerberos server.
 
-=head2 L<Catalyst::Plugin::Authentication::Credential::JugemKey>
+=head4 L<Catalyst::Authentication::Credential::OAuth>
 
-=head2 L<Catalyst::Plugin::Authentication::Credential::PAM>
+Allows you to authenticate users using their login on other websites supporting
+the OAuth protocol.
 
-=head2 L<Catalyst::Plugin::Authentication::Credential::Password>
+=head4 L<Catalyst::Authentication::Credential::OpenID>
+
+Allows you to authenticate users using their login on other websites supporting
+the OpenID protocol.
+
+=head4 L<Catalyst::Authentication::Credential::Password>
 
 Takes a username (or userid) and a password, and tries various methods of
 comparing a password based on what the chosen store's user objects support.
 Part of the Authentication Framework L<Catalyst::Plugin::Authentication>.
 
-=head2 L<Catalyst::Plugin::Authentication::Credential::TypeKey>
+=head4 L<Catalyst::Authentication::Credential::RPX>
+
+Allows you to autheticate users using the RPX protocol.
+
+=head4 L<Catalyst::Authentication::Credential::Remote>
 
-Integrates L<Authen::TypeKey> with L<Catalyst::Plugin::Authentication>.
+Allows you to authenticate users in Catalyst which have already been
+authenticated by your web server - this is useful for authenticating
+users with SSL Client certificates, and using NTLM or any other
+authentication protocol natively supported by your web server.
 
-=head2 L<Catalyst::Plugin::Authentication::OpenID>
+=head4 L<Catalyst::Authentication::Credential::Testing>
 
-L<Catalyst::Plugin::Authentication::OpenID> is a plugin that implements
-support for OpenID authentication. For more information on OpenID, take
-a look at L<http://www.openid.net/>.
+Allows you to set the same password for all users, which is useful
+when you want to test logging in as multiple users / types of user,
+without having to mock things, or set all users passwords in your
+test suite.
 
-=head2 L<Catalyst::Plugin::Authentication::Store>
+=head4 L<Catalyst::Authentication::Credential::Authen::Simple>
 
-The core authentication store documentation.
+Allows any of the L<Authen::Simple> family of modules to be used
+to authenticate users in Catalyst.
 
-=head2 L<Catalyst::Plugin::Authentication::Store::DBIC>
+=head3 LAvailable Store modules:
 
-Does authentication and authorization against a L<DBIx::Class> or
-L<Class::DBI> model.
+=head4 L<Catalyst::Authentication::Store::DBIx::Class>
 
-=head2 L<Catalyst::Plugin::Authentication::Store::Htpasswd>
+Does authentication and authorization against a L<DBIx::Class> model.
+
+=head4 L<Catalyst::Authentication::Store::Htpasswd>
 
 Uses L<Authen::Htpasswd> to let your application use C<.htpasswd> files for its
 authentication storage.
 
-=head2 L<Catalyst::Plugin::Authentication::Store::HTTP>
+=head4 L<Catalyst::Authentication::Store::AuthTkt>
+
+This module implements the Catalyst::Authentication API for L<Apache::AuthTkt>.
+
+=head4 L<Catalyst::Authentication::Store::DBI>
 
-=head2 L<Catalyst::Plugin::Authentication::Store::LDAP>
+Allows you to use a plain L<DBI> database connection to identify users. 
+
+=head4 L<Catalyst::Authentication::Store::Htpasswd>
+
+Allows you to use an apache htpassed type file to authenticate users from.
+
+=head4 L<Catalyst::Authentication::Store::KiokuDB>
+
+Authenticate users stored as objects in the L<KiokuDB> object graph storage
+engine system.
+
+=head4 L<Catalyst::Authentication::Store::LDAP>
 
 Authenticates users using an LDAP server.
 
-=head2 L<Catalyst::Plugin::Authentication::Store::Minimal>
+=head4 L<Catalyst::Authentication::Store::Minimal>
 
 Lets you create a very quick and dirty user database in your application's
 config hash. Great for getting up and running quickly.
 
-=head2 L<Catalyst::Plugin::Authentication::User::Hash>
+=head4 L<Catalyst::Authentication::Store::Null>
+
+The Null store is a transparent store where any supplied user data is accepted.
+This is mainly useful for remotely authenticating credentials (e.g. OpenID) which
+may not be tied to any local storage.
+
+=head4 L<Catalyst::Authentication::Store::RDBO>
+
+Allows access to authentication information stored in a database via a L<Rose::DB::Object> class.
+
+=head4 L<Catalyst::Authentication::Store::Tangram>
+
+Allows access to authentication information stored in a database via a L<Tangram> class.
+
+=head4 L<Catalyst::Authentication::Store::DBIx::Class>
+
+Allows access to authentication information stored in a database via a L<DBIx::Class> class.
+
+=head4 L<Catalyst::Authentication::Store::Jifty::DBI>
+
+Allows access to authentication information stored in a database via a L<Jifty::DBI> class.
+
+=head4 L<Catalyst::Authentication::User::Hash>
 
 An easy authentication user object based on hashes.
-See L<Catalyst::Plugin::Authentication::Store::Minimal> for more info.
+See L<Catalyst::Authentication::Store::Minimal> for more info.
 
 =head2 L<Catalyst::Plugin::Authorization::ACL>
 
@@ -131,15 +204,24 @@ Extends L<Catalyst::Request> by adding the capability of browser
 detection.  It returns an instance of L<HTTP::BrowserDetect>, which lets
 you get information from the client's user agent.
 
-=head2 Catalyst::Plugin::Cache::FastMmap, FileCache, BerkeleyDB, and Memcached
+=head2 L<Catalyst::Plugin::Cache>
 
-L<Catalyst::Plugin::Cache::FastMmap>,
-L<Catalyst::Plugin::Cache::FileCache>,
-L<Catalyst::Plugin::Cache::BerkeleyDB>, and
-L<Catalyst::Plugin::Cache::Memcached> all provide a cache method
-enabling easy access to a shared cache.
+Provides a cache method enabling easy access to a shared cache implementing
+the C<< Cache:: >> APO, such as:
 
-=head2 L<Catalyst::Plugin::Captcha>
+=over
+
+=item FastMmap
+
+=item FileCache
+
+=item BerkeleyDB
+
+=item Memcached
+
+=item CHI
+
+=back
 
 =head2 L<Catalyst::Plugin::CGI::Untaint>
 
@@ -166,14 +248,6 @@ L<Catalyst::Plugin::ConfigLoader::YAML>
 
 =head2 L<Catalyst::Plugin::ConfigurablePathTo>
 
-=head2 L<Catalyst::Plugin::Continuation>
-
-=head2 L<Catalyst::Plugin::DateTime>
-
-=head2 L<Catalyst::Action::RenderView>
-
-Creates a sane, standard end method for your application.
-
 =head2 L<Catalyst::Plugin::Devel::InPageLogs>
 
 =head2 L<Catalyst::Plugin::Devel::InPageLogs::Log>
@@ -202,14 +276,6 @@ the values into the form tags.
 
 =head2 L<Catalyst::Plugin::Flavour>
 
-=head2 L<Catalyst::Plugin::FormValidator>
-
-A form validator plugin that uses L<Data::FormValidator> to validate and
-set up form data from your request parameters. It's a quite thin wrapper
-around that module, so most of the relevant information can be found there.
-
-=head2 L<Catalyst::Plugin::FormValidator::Simple>
-
 =head2 L<Catalyst::Plugin::Geography>
 
 Allows you to retrieve various kinds of geographical information. You can
@@ -222,8 +288,6 @@ address, or from a given hostname.
 
 =head2 L<Catalyst::Plugin::HTML::Scrubber>
 
-=head2 L<Catalyst::Plugin::HTML::Widget>
-
 =head2 L<Catalyst::Plugin::I18N>
 
 An internationalization plugin for Catalyst. Supports C<mo>/C<po> files
@@ -231,8 +295,6 @@ and Maketext classes under your application's I18N namespace.
 
 =head2 L<Catalyst::Plugin::JSONRPC>
 
-=head2 L<Catalyst::Plugin::Markdown>
-
 =head2 L<Catalyst::Plugin::Message>
 
 =head2 L<Catalyst::Plugin::MobileAgent>
@@ -327,13 +389,13 @@ and C<searchRetrieve>) from its own class.
 =head2 L<Catalyst::Plugin::Static>
 
 L<Catalyst::Plugin::Static> is a plugin to serve static files from
-C<< $c->config->{root} >>. Intended chiefly for development
+C<< $c->config(root => 'foo') >>. Intended chiefly for development
 purposes.
 
 =head2 L<Catalyst::Plugin::Static::Simple>
 
 Serves static files in your application without requiring a single line of
-code. This plugin is now included in the core Catalyst distribution.
+code.
 
 =head2 L<Catalyst::Plugin::SubRequest>
 
@@ -345,12 +407,6 @@ for portal software and such.
 An interface to the L<HTML::SuperForm> module, enabling easy HTML form
 creation.
 
-=head2 L<Catalyst::Plugin::Textile>
-
-A persistent Textile processor for Catalyst that uses C<Text::Textile>, a
-Perl-based implementation of Dean Allen's Textile syntax. Textile is
-shorthand for doing common formatting tasks (see L<http://textism.com>).
-
 =head2 L<Catalyst::Plugin::Unicode>
 
 Provides a Unicode-aware Catalyst. On request, it decodes all params from
@@ -471,6 +527,12 @@ L<Template::Manual>.
 
 =head2 L<Catalyst::View::vCard>
 
+=head1 Actions
+
+=head2 L<Catalyst::Action::RenderView>
+
+Creates a sane, standard end method for your application.
+
 =head1 OBSOLETE MODULES
 
 =head2 L<Catalyst::Controller::BindLex>
@@ -530,17 +592,12 @@ modules have been replaced by the <Catalyst::Plugin::Session> framework.
 
 =head1 AUTHORS
 
-Andrew Ford E<lt>A.Ford@ford-mason.co.ukE<gt>
-
-Gavin Henry E<lt>ghenry@suretecsystems.comE<gt>
-
-Jesse Sheidlower E<lt>jester@panix.comE<gt>
-
-Marcus Ramberg E<lt>mramberg@cpan.orgE<gt>
-
-David Kamholz E<lt>dkamholz@cpan.orgE<gt>
+Catalyst Contributors, see Catalyst.pm
 
 =head1 COPYRIGHT
 
-This program is free software, you can redistribute it and/or modify it under
+This library is free software. You can redistribute it and/or modify it under
 the same terms as Perl itself.
+
+=cut
+
index d6da3c8..cde45f6 100644 (file)
@@ -262,27 +262,6 @@ like so:
       }
     }
 
-=head2 FIXME
-
-To restrict access to any action, you can use the C<check_user_roles> method:
-
-  sub restricted : Local {
-     my ( $self, $c ) = @_;
-
-     $c->detach("unauthorized")
-       unless $c->check_user_roles( "admin" );
-
-     # do something restricted here
-  }
-
-You can also use the C<assert_user_roles> method. This just gives an
-error if the current user does not have one of the required roles:
-
-  sub also_restricted : Global {
-    my ( $self, $c ) = @_;
-    $c->assert_user_roles( qw/ user admin / );
-  }
-
 =head2 Authentication/Authorization
 
 This is done in several steps:
@@ -369,28 +348,43 @@ the user is a member.
 
 =head3 EXAMPLE
 
- package MyApp;
- use Moose;
- use namespace::autoclean;
- extends qw/Catalyst/;
- use Catalyst qw/Authentication
-                 Authorization::Roles/;
-
- __PACKAGE__->config(
-    'Plugin::Authentication' => {
-        default => {
-            credential => {
-                class => 'Htpasswd',
-                # FIXME
-            },
-            store => {
-                class => 'Null',
-            },
-        },
-    },
- );
-
- sub login : Local {
+  package MyApp;
+  use Moose;
+  use namespace::autoclean;
+  extends qw/Catalyst/;
+  use Catalyst qw/
+    Authentication
+    Authorization::Roles
+  /;
+
+  __PACKAGE__->config(
+     authentication => {
+         default_realm => 'test',
+         realms => {
+             test => {
+                 credential => {
+                     class          => 'Password',
+                     password_field => 'password',
+                     password_type  => 'self_check',
+                 },
+                 store => {
+                     class => 'Htpasswd',
+                     file => 'htpasswd',
+                 },
+             },
+         },
+     },   
+  );
+
+  package MyApp::Controller::Root;
+  use Moose;
+  use namespace::autoclean;
+  
+  BEGIN { extends 'Catalyst::Controller' }
+  
+  __PACKAGE__->config(namespace => '');
+  
+  sub login : Local {
      my ($self, $c) = @_;
 
      if (    my $user = $c->req->param("user")
@@ -430,24 +424,13 @@ testing environment. Additionally, this has the advantage of not
 modifying one's database, which can be problematic if one forgets to
 use the testing instead of production database.
 
-e.g.,
-
-  # FIXME - Out of date
-  use Catalyst::Plugin::Authentication::Store::Minimal::Backend;
-
-  # Sets up the user `test_user' with password `test_pass'
-  MyApp->default_auth_store(
-    Catalyst::Plugin::Authentication::Store::Minimal::Backend->new({
-      test_user => { password => 'test_pass' },
-    })
-  );
-
-Now, your test code can call C<$c->login('test_user', 'test_pass')> and
-successfully login, without messing with the database at all.
+Alternatively, if you want to authenticate real users, but not have to worry about
+their passwords, you can use L<Catalyst::Authentication::Credential::Testing>
+to force all users to authenticate with a global password.
 
 =head3 More information
 
-L<http://search.cpan.org/perldoc?Catalyst::Plugin::Authentication> has a longer explanation.
+L<Catalyst::Plugin::Authentication> has a longer explanation.
 
 =head2 Authorization
 
@@ -2504,28 +2487,11 @@ L<http://search.cpan.org/perldoc?Catalyst::Plugin::Authorization::ACL>
 
 =head1 AUTHORS
 
-Sebastian Riedel C<sri@oook.de>
-
-Danijel Milicevic C<me@danijel.de>
-
-Viljo Marrandi C<vilts@yahoo.com>
-
-Marcus Ramberg C<mramberg@cpan.org>
-
-Jesse Sheidlower C<jester@panix.com>
-
-Andy Grundman C<andy@hybridized.org>
-
-Chisel Wright C<pause@herlpacker.co.uk>
-
-Will Hawes C<info@whawes.co.uk>
-
-Gavin Henry C<ghenry@perl.me.uk>
-
-Kieren Diment C<kd@totaldatasolution.com>
+Catalyst Contributors, see Catalyst.pm
 
 =head1 COPYRIGHT
 
-This document is free, you can redistribute it and/or modify it
-under the same terms as Perl itself.
+This library is free software. You can redistribute it and/or modify it under
+the same terms as Perl itself.
 
+=cut
index f8883f9..797f950 100644 (file)
@@ -124,11 +124,41 @@ The Catalyst subversion repository can be found at:
 
     http://dev.catalyst.perl.org/repos/Catalyst
 
-and the git repository can be found at FIXME
+and the git repository can be found at:
+
+    http://git.shadowcat.co.uk/cgi-bin/gitweb.cgi
+    
+FIXME
+
+The Catalyst project is happy to provide subversion/git hosting or mailing lists
+etc for your component project on request.
 
 =head2 New Catalyst extensions
 
 As Catalyst is deliberately designed for extension, there is an ecosystem of
 several hundred Catalyst extensions which can be found on CPAN.
 
-FIXME
+See L<Catalyst::Manual::ExtendingCatalyst> for more information on how to extend
+Catalyst in various ways and how to write CPANable components for Catalyst which
+can be reused in many applications.
+
+It is recommended to post a request for comments to the Catalyst mailing list,
+or ask around in the #catalyst irc channel before starting to implement something,
+as another member of the community is likely to have example or prototype code that
+you can reuse, and members of the community and core team are happy to advise on
+the best way to implement a generic solution to a particular problem.
+
+This could save you duplicate work, and will help you produce a betetr thought out
+and designed extension.
+
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
+
+=head1 COPYRIGHT
+
+This library is free software. You can redistribute it and/or modify it under
+the same terms as Perl itself.
+
+=cut
+
index 824dafc..56e237a 100644 (file)
@@ -229,8 +229,7 @@ action:
 
   sub foo : Local Bar('Baz') {
       my ($self, $c) = @_;
-      my $attributes =
-      $self->action_for('foo')->attributes;
+      my $attributes = $self->action_for('foo')->attributes;
       $c->res->body($attributes->{Bar}[0] );
   }
 
@@ -263,12 +262,17 @@ component configuration.
 
 You are advised to create accessors on your component class for your
 configuration values. This is good practice and makes it easier to
-capture configuration key typos. You can do this with the
-C<mk_ro_accessors> method provided to L<Catalyst::Component> via
-L<Class::Accessor::Fast>:
+capture configuration key typos, or missing keys.
+
+You can do this with L<Moose>:
+
+  package MyApp::Controller::Foo;
+  use Moose;
+  use namespace::autoclean;
+  BEGIN { extends 'Catalyst::Controller' };
+
+  has model_name ( is => 'ro', required => 1 );
 
-  use base 'Catalyst::Controller';
-  __PACKAGE__->mk_ro_accessors('model_name');
   ...
   my $model_name = $controller->model_name;
 
@@ -294,10 +298,10 @@ methods code. You can surround this by overriding the method in a
 subclass:
 
   package Catalyst::Action::MyFoo; 
-  use strict;
-
+  use Moose;
+  use namespace::autoclean;
   use MRO::Compat; 
-  use base 'Catalyst::Action';
+  extends 'Catalyst::Action';
 
   sub execute {
       my $self = shift;
@@ -325,10 +329,10 @@ For example, the action class below will make the action only match on
 Mondays:
 
   package Catalyst::Action::OnlyMondays; 
-  use strict;
-
+  use Moose;
+  use namespace::autoclean;
   use MRO::Compat;
-  use base 'Catalyst::Action';
+  extends 'Catalyst::Action';
 
   sub match {
       my $self = shift;
@@ -348,7 +352,11 @@ If you are using action classes often or have some specific base
 classes that you want to specify more conveniently, you can implement
 a component base class providing an attribute handler.
 
-For further information on action classes, please refer to
+It is not possible to use multiple action classes at once, however
+L<Catalyst::Controller::ActionRole> allows you to apply L<Moose Roles|Moose::Role>
+to actions.
+
+For further information on action classes and roles, please refer to
 L<Catalyst::Action> and L<Catalyst::Manual::Actions>.
 
 =head2 Component base classes
@@ -372,8 +380,10 @@ already provided via the C<+> prefix for action classes. A simple
 
 will use C<MyApp::Action::Bar> as action class.
 
-  package MyApp::Base::Controller::FullClass; use strict; use base
-  'Catalyst::Controller';
+  package MyApp::Base::Controller::FullClass;
+  use Moose;
+  use namespace::autoclean;
+  BEGIN { extends 'Catalyst::Controller'; }
 
   sub _parse_FullClass_attr {
       my ($self, $app_class, $action_name, $value, $attrs) = @_;
@@ -386,8 +396,9 @@ sake. We could use this attribute in a subclass like any other
 Catalyst attribute:
 
   package MyApp::Controller::Foo;
-  use strict;
-  use base 'MyApp::Base::Controller::FullClass';
+  use Moose;
+  use namespace::autoclean;
+  BEGIN { extends 'MyApp::Base::Controller::FullClass'; }
 
   sub foo : Local FullClass('MyApp::Action::Bar') { ... }
 
@@ -404,8 +415,10 @@ controller object, or you can even define Catalyst actions which will
 be inherited by the subclasses. Consider this controller base class:
 
   package MyApp::Base::Controller::ModelBase;
-  use strict;
-  use base 'Catalyst::Controller';
+  use Moose;
+  use namespace::autoclean;
+
+  BEGIN { extends 'Catalyst::Controller'; }
 
   sub list : Chained('base') PathPart('') Args(0) {
       my ($self, $c) = @_;
@@ -413,13 +426,13 @@ be inherited by the subclasses. Consider this controller base class:
       my $condition = $self->{model_search_condition} || {};
       my $attrs = $self->{model_search_attrs} || {};
       $c->stash(rs => $model->search($condition, $attrs);
-      }
+  }
 
   sub load : Chained('base') PathPart('') CaptureArgs(1) {
       my ($self, $c, $id) = @_;
       my $model = $c->model( $self->{model_name} );
       $c->stash(row => $model->find($id));
-      }
+  }
   1;
 
 This example implements two simple actions. The C<list> action chains
@@ -436,8 +449,10 @@ The class above is not very useful on its own, but we can combine it
 with some custom actions by sub-classing it:
 
   package MyApp::Controller::Foo;
-  use strict;
-  use base 'MyApp::Base::Controller::ModelBase';
+  use Moose;
+  use namespace::autoclean;
+  
+  BEGIN { extends 'MyApp::Base::Controller::ModelBase'; }
 
   __PACKAGE__->config( model_name => 'DB::Foo',
                        model_search_condition=> { is_active => 1 },
@@ -504,9 +519,11 @@ generation.
 
 Here is some example code for a fictional view:
 
-  package CatalystX::View::MyView;
-  use strict;
-  use base 'Catalyst::View';
+  package Catalyst::View::MyView;
+  use Moose;
+  use namespace::autoclean;
+  
+  extends 'Catalyst::View';
 
   sub process {
       my ($self, $c) = @_;
@@ -557,7 +574,7 @@ authentication.
 
 B<Please do not> release Catalyst extensions as plugins only to
 provide some functionality application wide. Design it as a controller
-base class or another suiting technique with a smaller scope, so that
+base class or another better suited technique with a smaller scope, so that
 your code only influences those parts of the application where it is
 needed, and namespace clashes and conflicts are ruled out.
 
@@ -605,6 +622,9 @@ A simple example like this is actually better as a L<Moose> role, for example:
       if (!blessed($_[0]) || !$_[0]->isa('Catalyst::Action'));
     return $uri;
   };
+  
+Note that Catalyst will load any Moose Roles in the plugin list,
+and apply them to your application class.
 
 =head2 Factory components with COMPONENT()
 
@@ -623,10 +643,10 @@ your component.
 Here is a stub C<COMPONENT> method:
 
   package CatalystX::Component::Foo;
-  use strict;
-  use base 'Catalyst::Component';
-
-  use MRO::Compat;
+  use Moose;
+  use namespace::autoclean;
+  
+  extends 'Catalyst::Component';
 
   sub COMPONENT {
       my $class = shift;
@@ -652,20 +672,45 @@ expectations on a component.
 For more information, please see
 L<Catalyst::Component/"COMPONENT($c,$arguments)">.
 
+=head2 Applying roles to parts of the framework
+
+L<CatalystX::RoleApplicator> will allow you to apply Roles to
+the following classes:
+
+=over
+
+=item Request
+
+=item Response
+
+=item Engine
+
+=item Dispatcher
+
+=item Stats
+
+=back
+
+These roles can add new methods to these classes, or wrap preexisting methods.
+
+The namespace for roles like this is C<Catalyst::TraitFor::XXX::YYYY>.
+
+For an example of a CPAN component implemented in this manor, see
+L<Catalyst::TraitFor::Request::BrowserDetect>.
+
 =head1 SEE ALSO
 
 L<Catalyst>, L<Catalyst::Manual::Actions>, L<Catalyst::Component>
 
-=head1 AUTHOR
+=head1 AUTHORS
 
-Robert Sedlacek C<< <rs@474.at> >>
+Catalyst Contributors, see Catalyst.pm
 
-Jonathan Rockway C<< <jrockway@cpan.org> >>
+=head1 COPYRIGHT
 
-=head1 LICENSE AND COPYRIGHT
-
-This document is free, you can redistribute it and/or modify it under
+This library is free software. You can redistribute it and/or modify it under
 the same terms as Perl itself.
 
 =cut
 
+
index 0ad159b..192d5f4 100644 (file)
@@ -95,12 +95,13 @@ information from the underlying layer (C<Apache::Request> or C<CGI::Simple>)
 during the prepare phase, then push the generated response information down to
 the underlying layer during the finalize phase.
 
-=head1 AUTHOR
+=head1 AUTHORS
 
-Sebastian Riedel, C<sri@oook.de>
+Catalyst Contributors, see Catalyst.pm
 
 =head1 COPYRIGHT
 
-This program is free software, you can redistribute it and/or modify it under
+This library is free software. You can redistribute it and/or modify it under
 the same terms as Perl itself.
 
+=cut
index 013e365..4414595 100644 (file)
@@ -1366,20 +1366,13 @@ FAQ:
 
     http://dev.catalystframework.org/wiki/faq
 
-=head1 AUTHOR
+=head1 AUTHORS
 
-Sebastian Riedel, C<sri@oook.de>
-David Naughton, C<naughton@umn.edu>
-Marcus Ramberg, C<mramberg@cpan.org>
-Jesse Sheidlower, C<jester@panix.com>
-Danijel Milicevic, C<me@danijel.de>
-Kieren Diment, C<kd@totaldatasolution.com>
-Yuval Kogman, C<nothingmuch@woobling.org>
+Catalyst Contributors, see Catalyst.pm
 
 =head1 COPYRIGHT
 
-This program is free software. You can redistribute it and/or modify it
-under the same terms as Perl itself.
+This library is free software. You can redistribute it and/or modify it under
+the same terms as Perl itself.
 
 =cut
-