3 Catalyst::Manual::Tutorial - Catalyst Tutorial: Overview
7 The Catalyst framework is a flexible and comprehensive environment for
8 quickly building high-functionality web applications. This tutorial is
9 designed to provide a rapid introduction to its basics and its most
10 commonly used features while focusing on real-world best practices.
12 The tutorial is divided into the following sections:
18 L<Introduction|Catalyst::Manual::Tutorial::Intro>
22 L<Catalyst Basics|Catalyst::Manual::Tutorial::CatalystBasics>
26 L<Basic CRUD|Catalyst::Manual::Tutorial::BasicCRUD>
30 L<Authentication|Catalyst::Manual::Tutorial::Authentication>
34 L<Authorization|Catalyst::Manual::Tutorial::Authorization>
38 L<Testing|Catalyst::Manual::Tutorial::Testing>
42 L<Advanced CRUD|Catalyst::Manual::Tutorial::AdvancedCRUD>
46 L<Appendices|Catalyst::Manual::Tutorial::Appendices>
50 A tarball of the final application is available at
51 C<to_be_compled_in_final_version>.
53 =head1 Detailed Table Of Contents
55 =head2 Part 1: Introduction
61 VERSIONS AND CONVENTIONS USED IN THIS TUTORIAL
73 WHERE TO GET WORKING CODE
78 =head2 Part 2: Catalyst Application Development Basics
84 CREATE A CATALYST PROJECT
88 CREATE A SQLITE DATABASE
92 EDIT THE LIST OF CATALYST PLUGINS
96 DATABASE ACCESS WITH DBIx::Class
100 Create a DBIC Schema File
104 Create the DBIC ``Result Source'' Files
108 Use Catalyst::Model::DBIC::Schema to Load the Model Class
114 CREATE A CATALYST CONTROLLER
124 Create a Catalyst View Using TTSite
128 Globally Customize Every View
132 Create a TT Template Page
142 =head2 Part 3: Basic CRUD
154 Include a Create Action in the Books Controller
158 Include a Template for the url_create Action:
162 Try the url_create Feature
168 MANUALLY BUILDING A CREATE FORM
174 Add a Method to Display the Form
178 Add a Template for the Form
182 Add Method to Process Form Values and Update Database
192 A SIMPLE DELETE FEATURE
198 Include a Delete Link in the List
202 Add a Delete Action to the Controller
206 Try the Delete Feature
212 =head2 Part 4: Authentication
224 Add Users and Roles to the Database
228 Add User and Role Information to DBIC Schema
232 Create New ``Result Source Objects''
236 Sanity-Check Reload of Development Server
240 Include Authentication and Session Plugins
244 Configure Authentication
248 Add Login and Logout Controllers
252 Add a Login Form TT Template Page
260 Displaying Content Only to Authenticated Users
264 Try Out Authentication
270 USING PASSWORD HASHES
276 Get a SHA-1 Hash for the Password
280 Switch to SHA-1 Password Hashes in the Database
284 Enable SHA-1 Hash Passwords in Catalyst::Plugin::Authentication::Store::DBIC
288 Try Out the Hashed Passwords
294 =head2 Part 5: Authorization
306 Update Plugins to Include Support for Authorization
310 Add Config Information for Authorization
314 Add Role-Specific Logic to the ``Book List'' Template
318 Limit Books::add to admin Users
322 Try Out Authentication And Authorization
328 ENABLE ACL-BASED AUTHORIZATION
334 Add the Catalyst::Plugin::Authorization::ACL Plugin
338 Add ACL Rules to the Application Class
342 Add a Method to Handle Access Violations
348 =head2 Part 6: Debugging
358 RUNNING CATALYST UNDER THE PERL DEBUGGER
362 =head2 Part 7: Testing
368 RUNNING THE "CANNED" CATALYST TESTS
372 RUNNING A SINGLE TEST
376 ADDING YOUR OWN TEST SCRIPT
380 SUPPORTING BOTH PRODUCTION AND TEST DATABASES
384 =head2 Part 8: Advanced CRUD
390 HTML::WIDGET FORM CREATION
396 Add the HTML::Widget Plugin
400 Add a Form Creation Helper Method
404 Add Actions to Display and Save the Form
412 Create a Template Page To Display The Form
416 Add Links for Create and Update via HTML::Widget
420 Test The <HTML::Widget> Create Form
426 HTML::WIDGET VALIDATION AND FILTERING
432 Add Constraints and Filters to the Widget Creation Method
436 Rebuild the Form Submission Method to Include Validation
446 Enable DBIx::Class::HTMLWidget Support
452 Add DBIx::Class::HTMLWidget to DBIC Model
456 Use populate_from_widget in hw_create_do
462 =head2 Part 9: Appendices
468 APPENDIX 1: CUT AND PASTE FOR POD-BASED EXAMPLES
474 "Un-indenting" with Vi/Vim
478 "Un-indenting" with Emacs
484 APPENDIX 2: USING MYSQL AND POSTGRESQL