The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Catalyst::Manual::Tutorial - Catalyst Tutorial: Overview

DESCRIPTION

The Catalyst framework is a flexible and comprehensive environment for quickly building high-functionality web applications. This tutorial is designed to provide a rapid introduction to its basics and its most commonly used features while focusing on real-world best practices.

The tutorial is divided into the following sections:

A tarball of the final application is available at to_be_compled_in_final_version.

Detailed Table Of Contents

Part 1: Introduction

  • VERSIONS AND CONVENTIONS USED IN THIS TUTORIAL

  • CATALYST INSTALLATION

  • DATABASES

  • WHERE TO GET WORKING CODE

Part 2: Catalyst Application Development Basics

  • CREATE A CATALYST PROJECT

  • CREATE A SQLITE DATABASE

  • EDIT THE LIST OF CATALYST PLUGINS

  • DATABASE ACCESS WITH DBIx::Class

  • Create a DBIC Schema File

  • Create the DBIC ``Result Source'' Files

  • Use Catalyst::Model::DBIC::Schema to Load the Model Class

        =item *

    CREATE A CATALYST CONTROLLER

  • CATALYST VIEWS

    • Create a Catalyst View Using TTSite

    • Globally Customize Every View

    • Create a TT Template Page

  • RUN THE APPLICATION

Part 3: Basic CRUD

  • FORMLESS SUBMISSION

    • Include a Create Action in the Books Controller

    • Include a Template for the url_create Action:

    • Try the url_create Feature

  • MANUALLY BUILDING A CREATE FORM

    • Add a Method to Display the Form

    • Add a Template for the Form

    • Add Method to Process Form Values and Update Database

    • Test Out the Form

  • A SIMPLE DELETE FEATURE

    • Include a Delete Link in the List

    • Add a Delete Action to the Controller

    • Try the Delete Feature

Part 4: Authentication

  • BASIC AUTHENTICATION

    • Add Users and Roles to the Database

    • Add User and Role Information to DBIC Schema

    • Create New ``Result Source Objects''

    • Sanity-Check Reload of Development Server

    • Include Authentication and Session Plugins

    • Configure Authentication

    • Add Login and Logout Controllers

    • Add a Login Form TT Template Page

    • Add Valid User Check

    • Displaying Content Only to Authenticated Users

    • Try Out Authentication

  • USING PASSWORD HASHES

    • Get a SHA-1 Hash for the Password

    • Switch to SHA-1 Password Hashes in the Database

    • Enable SHA-1 Hash Passwords in Catalyst::Plugin::Authentication::Store::DBIC

    • Try Out the Hashed Passwords

Part 5: Authorization

  • BASIC AUTHORIZATION

    • Update Plugins to Include Support for Authorization

    • Add Config Information for Authorization

    • Add Role-Specific Logic to the ``Book List'' Template

    • Limit Books::add to admin Users

    • Try Out Authentication And Authorization

  • ENABLE ACL-BASED AUTHORIZATION

    • Add the Catalyst::Plugin::Authorization::ACL Plugin

    • Add ACL Rules to the Application Class

    • Add a Method to Handle Access Violations

Part 6: Debugging

  • LOG STATEMENTS

  • RUNNING CATALYST UNDER THE PERL DEBUGGER

Part 7: Testing

  • RUNNING THE "CANNED" CATALYST TESTS

  • RUNNING A SINGLE TEST

  • ADDING YOUR OWN TEST SCRIPT

  • SUPPORTING BOTH PRODUCTION AND TEST DATABASES

Part 8: Advanced CRUD

  • HTML::WIDGET FORM CREATION

    • Add the HTML::Widget Plugin

    • Add a Form Creation Helper Method

    • Add Actions to Display and Save the Form

    • Update the CSS

    • Create a Template Page To Display The Form

    • Add Links for Create and Update via HTML::Widget

    • Test The <HTML::Widget> Create Form

  • HTML::WIDGET VALIDATION AND FILTERING

    • Add Constraints and Filters to the Widget Creation Method

    • Rebuild the Form Submission Method to Include Validation

    • Try Out the Form

  • Enable DBIx::Class::HTMLWidget Support

    • Add DBIx::Class::HTMLWidget to DBIC Model

    • Use populate_from_widget in hw_create_do

Part 9: Appendices

  • APPENDIX 1: CUT AND PASTE FOR POD-BASED EXAMPLES

    • "Un-indenting" with Vi/Vim

    • "Un-indenting" with Emacs

  • APPENDIX 2: USING MYSQL AND POSTGRESQL

    • MySQL

    • PostgreSQL