3 Catalyst::Manual::Tutorial - Catalyst Tutorial: Overview
9 The Catalyst framework is a flexible and comprehensive environment for quickly building high-functionality web applications. This tutorial is design to provide a rapid introduction to its basics and most commonly used features while focusing on real-world best practices.
11 The tutorial is broken down into the following sections:
17 L<Introduction|Catalyst::Manual::Tutorial01_Intro>
21 L<Catalyst Basics|Catalyst::Manual::Tutorial02_CatalystBasics>
25 L<CRUD|Catalyst::Manual::Tutorial03_BasicCRUD>
29 L<Authentication|Catalyst::Manual::Tutorial04_Authentication>
33 L<Authorization|Catalyst::Manual::Tutorial05_Authorization>
37 L<Debugging|Catalyst::Manual::Tutorial06_Debugging>
41 L<Testing|Catalyst::Manual::Tutorial07_Testing>
45 L<CRUD|Catalyst::Manual::Tutorial08_AdvancedCRUD>
49 L<Appendicies|Catalyst::Manual::Tutorial09_Appendicies>
54 Full source code is available for each section via the main Catalyst Subversion repository at L<http://dev.catalyst.perl.org/repos/Catalyst/trunk/examples/>. See the end of each section for the specifics on retrieving code for that section.
56 A tarball of the final application is available at C<to_be_compled_in_final_version>.
60 =head1 Detailed Table Of Contents
62 =head2 Part 1: Introduction
68 VERSIONS AND CONVENTIONS USED IN THIS TUTORIAL
80 WHERE TO GET WORKING CODE
86 =head2 Part 2: Catalyst Application Development Basics
92 CREATE A CATALYST PROJECT
96 CREATE A SQLITE DATABASE
100 EDIT THE LIST OF CATALYST PLUGINS
104 DATABASE ACCESS WITH DBIx::Class
110 Create a DBIC Schema File
114 Create the DBIC ``Result Source'' Files
118 Use Catalyst::Model::DBIC::Schema To Load The Model Class
124 CREATE A CATALYST CONTROLLER
134 Create a Catalyst View Using TTSITE
138 Globally Customize Every View
142 Create a TT Template Page
154 =head2 Part 3: Basic CRUD
166 Include a Create Action in the Books Controller
170 Include a Template for the url_create Action:
174 Try the url_create Feature
180 MANUALLY BUILDING A CREATE FORM
186 Add Method to Display The Form
190 Add a Template for the Form
194 Add Method to Process Form Values and Update Database
204 A SIMPLE DELETE FEATURE
210 Include a Delete Link in the List
214 Add a Delete Action to the Controller
218 Try the Delete Feature
226 =head2 Part 4: Authentication
238 Add Users and Roles to the Database
242 Add User and Role Information to Dbic Schema
246 Create New ``Result Source Objects''
250 Sanity-Check Reload of Development Server
254 Include Authentication and Session Plugins
258 Configure Authentication
262 Add Login and Logout Controllers
266 Add a Login Form TT Template Page
274 Displaying Content Only to Authenticated Users
278 Try Out Authentication
284 USING PASSWORD HASHES
290 Get a SHA-1 Hash for the Password
294 Switch to SHA-1 Password Hashes in the Database
298 Enable SHA-1 Hash Passwords in Catalyst::Plugin::Authentication::Store::DBIC
302 Try Out the Hashed Passwords
310 =head2 Part 5: Authorization
322 Update Plugins to Include Support Authorization
326 Add Config Information for Authorization
330 Add Role-Specific Logic to the ``Book List'' Template
334 Limit Books::add to admin Users
338 Try Out Authentication And Authorization
344 ENABLE ACL-BASED AUTHORIZATION
350 Add the Catalyst::Plugin::Authorization::ACL Plugin
354 Add ACL Rules to the Application Class
358 Add a Method to Handle Access Violations
365 =head2 Part 6: Debugging
375 RUNNING CATALYST UNDER THE PERL DEBUGGER
381 =head2 Part 7: Testing
387 RUNNING THE "CANNED" CATALYST TESTS
391 RUNNING A SINGLE TEST
395 ADDING YOUR OWN TEST SCRIPT
399 SUPPORTING BOTH PRODUCTION AND TEST DATABASES
405 =head2 Part 8: Advanced CRUD
411 HTML::WIDGET FORM CREATION
417 Add the HTML::Widget Plugin
421 Add a Form Creation Helper Method
425 Add Actions to Display and Save the Form
433 Create a Template Page To Display The Form
437 Add Links for Create and Update via HTML::Widget
441 Test The <HTML::Widget> Create Form
447 HTML::WIDGET VALIDATION AND FILTERING
453 Add Constraints and Filters to the Widget Creation Method
457 Rebuild the Form Submission Method to Include Validation
467 Enable DBIx::Class::HTMLWidget Support
473 Add DBIx::Class::HTMLWidget to DBIC Model
477 Use populate_from_widget in hw_create_do
485 =head2 Part 9: Appendices
491 APPENDIX 1: CUT AND PASTE FOR POD-BASED EXAMPLES
497 "Un-indenting" with Vi/Vim
501 "Un-indenting" with Emacs
507 APPENDIX 2: USING MYSQL AND POSTGRESQL