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
112 CREATE A CATALYST CONTROLLER
122 Create a Catalyst View Using TTSite
126 Globally Customize Every View
130 Create a TT Template Page
140 =head2 Part 3: Basic CRUD
152 Include a Create Action in the Books Controller
156 Include a Template for the url_create Action:
160 Try the url_create Feature
166 MANUALLY BUILDING A CREATE FORM
172 Add a Method to Display the Form
176 Add a Template for the Form
180 Add Method to Process Form Values and Update Database
190 A SIMPLE DELETE FEATURE
196 Include a Delete Link in the List
200 Add a Delete Action to the Controller
204 Try the Delete Feature
210 =head2 Part 4: Authentication
222 Add Users and Roles to the Database
226 Add User and Role Information to DBIC Schema
230 Create New ``Result Source Objects''
234 Sanity-Check Reload of Development Server
238 Include Authentication and Session Plugins
242 Configure Authentication
246 Add Login and Logout Controllers
250 Add a Login Form TT Template Page
258 Displaying Content Only to Authenticated Users
262 Try Out Authentication
268 USING PASSWORD HASHES
274 Get a SHA-1 Hash for the Password
278 Switch to SHA-1 Password Hashes in the Database
282 Enable SHA-1 Hash Passwords in Catalyst::Plugin::Authentication::Store::DBIC
286 Try Out the Hashed Passwords
292 =head2 Part 5: Authorization
304 Update Plugins to Include Support for Authorization
308 Add Config Information for Authorization
312 Add Role-Specific Logic to the ``Book List'' Template
316 Limit Books::add to admin Users
320 Try Out Authentication And Authorization
326 ENABLE ACL-BASED AUTHORIZATION
332 Add the Catalyst::Plugin::Authorization::ACL Plugin
336 Add ACL Rules to the Application Class
340 Add a Method to Handle Access Violations
346 =head2 Part 6: Debugging
356 RUNNING CATALYST UNDER THE PERL DEBUGGER
360 =head2 Part 7: Testing
366 RUNNING THE "CANNED" CATALYST TESTS
370 RUNNING A SINGLE TEST
374 ADDING YOUR OWN TEST SCRIPT
378 SUPPORTING BOTH PRODUCTION AND TEST DATABASES
382 =head2 Part 8: Advanced CRUD
388 HTML::WIDGET FORM CREATION
394 Add the HTML::Widget Plugin
398 Add a Form Creation Helper Method
402 Add Actions to Display and Save the Form
410 Create a Template Page To Display The Form
414 Add Links for Create and Update via HTML::Widget
418 Test The <HTML::Widget> Create Form
424 HTML::WIDGET VALIDATION AND FILTERING
430 Add Constraints and Filters to the Widget Creation Method
434 Rebuild the Form Submission Method to Include Validation
444 Enable DBIx::Class::HTMLWidget Support
450 Add DBIx::Class::HTMLWidget to DBIC Model
454 Use populate_from_widget in hw_create_do
460 =head2 Part 9: Appendices
466 APPENDIX 1: CUT AND PASTE FOR POD-BASED EXAMPLES
472 "Un-indenting" with Vi/Vim
476 "Un-indenting" with Emacs
482 APPENDIX 2: USING MYSQL AND POSTGRESQL