Adjust wording for mod_perl
[catagits/Catalyst-Manual.git] / lib / Catalyst / Manual / Tutorial.pod
CommitLineData
5e602627 1=head1 NAME
2
3Catalyst::Manual::Tutorial - Catalyst Tutorial: Overview
4
5=head1 DESCRIPTION
6
7The Catalyst framework is a flexible and comprehensive environment for
8quickly building high-functionality web applications. This tutorial is
9designed to provide a rapid introduction to its basics and its most
10commonly used features while focusing on real-world best practices.
11
276c4698 12We suggest that you read this introduction on the web. Make sure you are
13reading the latest version of the tutorial by visiting
14L<http://search.cpan.org/perldoc?Catalyst::Manual::Tutorial>. Alternatively
15you can use CPAN modules like L<Pod::Webserver>, L<Pod::POM::Web>,
16L<Pod::Browser> (Catalyst based), or L<CPAN::Mini::Webserver> to read a local
17copy of the tutorial.
18
5e602627 19The tutorial is divided into the following sections:
20
1435672d 21B<NOTE: CLICK THESE LINKS TO JUMP TO CHAPTERS> (the index links above
5e602627 22only navigate inside this page).
23
24=over 4
25
3533daff 26=item 1
5e602627 27
1c96f145 28L<Introduction|Catalyst::Manual::Tutorial::01_Intro>
5e602627 29
3533daff 30=item 2
5e602627 31
1c96f145 32L<Catalyst Basics|Catalyst::Manual::Tutorial::02_CatalystBasics>
5e602627 33
3533daff 34=item 3
35
1c96f145 36L<More Catalyst Basics|Catalyst::Manual::Tutorial::03_MoreCatalystBasics>
3533daff 37
38=item 4
5e602627 39
1c96f145 40L<Basic CRUD|Catalyst::Manual::Tutorial::04_BasicCRUD>
5e602627 41
3533daff 42=item 5
5e602627 43
1c96f145 44L<Authentication|Catalyst::Manual::Tutorial::05_Authentication>
5e602627 45
3533daff 46=item 6
5e602627 47
1c96f145 48L<Authorization|Catalyst::Manual::Tutorial::06_Authorization>
5e602627 49
3533daff 50=item 7
5e602627 51
1c96f145 52L<Debugging|Catalyst::Manual::Tutorial::07_Debugging>
5e602627 53
3533daff 54=item 8
5e602627 55
1c96f145 56L<Testing|Catalyst::Manual::Tutorial::08_Testing>
5e602627 57
3533daff 58=item 9
5e602627 59
1c96f145 60L<Advanced CRUD|Catalyst::Manual::Tutorial::09_AdvancedCRUD>
5e602627 61
3533daff 62=item 10
5e602627 63
1c96f145 64L<Appendices|Catalyst::Manual::Tutorial::10_Appendices>
5e602627 65
66=back
67
4b4d3884 68Final code tarballs for each chapter of the tutorial are available at
028b4e1a 69L<http://dev.catalyst.perl.org/repos/Catalyst/trunk/examples/Tutorial/>.
5e602627 70
71
72=head1 Detailed Table of Contents
73
3533daff 74
1c96f145 75=head2 L<Chapter 1: Intro|Catalyst::Manual::Tutorial::01_Intro>
4b4d3884 76
77Note: Click on the heading in the previous line to jump to the actual
78chapter. Below is a "table of contents" for this chapter.
5e602627 79
80=over 4
81
82=item *
83
84VERSIONS AND CONVENTIONS USED IN THIS TUTORIAL
85
86=item *
87
88CATALYST INSTALLATION
89
90=item *
91
92DATABASES
93
94=item *
95
96WHERE TO GET WORKING CODE
97
98=back
99
100
1c96f145 101=head2 L<Chapter 2: Catalyst Basics|Catalyst::Manual::Tutorial::02_CatalystBasics>
4b4d3884 102
103Note: Click on the heading in the previous line to jump to the actual
104chapter. Below is a "table of contents" for this chapter.
5e602627 105
106=over 4
107
108=item *
109
110CREATE A CATALYST PROJECT
111
112=item *
113
3533daff 114HELLO WORLD
115
116=over 4
5e602627 117
118=item *
119
3533daff 120The Simplest Way
5e602627 121
122=item *
123
3533daff 124Hello, World! Using a View and a Template
5e602627 125
3533daff 126=back
5e602627 127
128=item *
129
3533daff 130CREATE A SIMPLE CONTROLLER AND AN ACTION
131
132=back
5e602627 133
5e602627 134
1c96f145 135=head2 L<Chapter 3: More Catalyst Basics|Catalyst::Manual::Tutorial::03_MoreCatalystBasics>
3533daff 136
4b4d3884 137Note: Click on the heading in the previous line to jump to the actual
138chapter. Below is a "table of contents" for this chapter.
3533daff 139
140=over 4
5e602627 141
142=item *
143
3533daff 144CREATE A NEW APPLICATION
5e602627 145
3533daff 146=item *
5e602627 147
3533daff 148EDIT THE LIST OF CATALYST PLUGINS
5e602627 149
150=item *
151
152CREATE A CATALYST CONTROLLER
153
154=item *
155
156CATALYST VIEWS
157
158
159=over 4
160
161=item *
162
4ab6212d 163Create a Catalyst View
5e602627 164
165=item *
166
4ab6212d 167Create a TT Template Page
5e602627 168
169=item *
170
4ab6212d 171Test Run The Application
3533daff 172
173=back
5e602627 174
175=item *
176
3533daff 177CREATE A SQLITE DATABASE
178
179=item *
180
181DATABASE ACCESS WITH DBIx::Class
182
183=over 4
184
185=item *
186
187Create a Dynamic DBIC Model
5e602627 188
189=back
190
3533daff 191=item *
192
4ab6212d 193ENABLE THE MODEL IN THE CONTROLLER
194
195=over 4
196
197=item *
198
199Test Run The Application
200
201=back
202
203=item *
204
205CREATE A WRAPPER FOR THE VIEW
206
207=over 4
208
209=item *
210
211Configure TT.pm For The Wrapper
212
213=item *
214
215Create the Wrapper Template File and Stylesheet
216
217=item *
218
219Test Run The Application
220
221=back
3533daff 222
223=item *
224
225A STATIC DATABASE MODEL WITH DBIx::Class
226
227=over 4
228
229=item *
230
231Create Static DBIC Schema Files
232
233=item *
234
235Updating the Generated DBIC Schema Files
236
4ab6212d 237=item *
238
239Run The Application
240
3533daff 241=back
5e602627 242
243=item *
244
4ab6212d 245UPDATING THE VIEW
5e602627 246
247=item *
248
3533daff 249RUNNING THE APPLICATION FROM THE COMMAND LINE
250
251=item *
252
4ab6212d 253OPTIONAL INFORMATION
3533daff 254
255=over 4
256
257=item *
258
259Using RenderView for the Default View
260
261=item *
262
263Using The Default Template Name
264
265=item *
266
267Return To A Manually-Specified Template
268
269=back
5e602627 270
271=back
272
3533daff 273
1c96f145 274=head2 L<Chapter 4: Basic CRUD|Catalyst::Manual::Tutorial::04_BasicCRUD>
4b4d3884 275
276Note: Click on the heading in the previous line to jump to the actual
277chapter. Below is a "table of contents" for this chapter.
5e602627 278
279=over 4
280
281=item *
282
283FORMLESS SUBMISSION
284
285=over 4
286
287=item *
288
289Include a Create Action in the Books Controller
290
291=item *
292
293Include a Template for the url_create Action:
294
295=item *
296
297Try the url_create Feature
298
299=back
300
301=item *
302
4ab6212d 303CONVERT TO A CHAINED ACTION
304
305=over 4
306
307=item *
308
309Try the Chained Action
310
311=item *
312
313Refactor to Use a "Base" Method to Start the Chains
314
315=back
316
317=item *
318
5e602627 319MANUALLY BUILDING A CREATE FORM
320
321=over 4
322
323=item *
324
325Add a Method to Display the Form
326
327=item *
328
329Add a Template for the Form
330
331=item *
332
333Add Method to Process Form Values and Update Database
334
335=item *
336
337Test Out the Form
338
339=back
340
341=item *
342
343A SIMPLE DELETE FEATURE
344
345=over 4
346
347=item *
348
349Include a Delete Link in the List
350
351=item *
352
4ab6212d 353Add a Common Method to Retrieve a Book for the Chain
354
355=item *
356
5e602627 357Add a Delete Action to the Controller
358
359=item *
360
361Try the Delete Feature
362
3533daff 363=item *
364
365Fixing a Dangerous URL
366
367=item *
368
369Try the Delete and Redirect Logic
370
371=item *
372
373Using uri_for to Pass Query Parameters
374
375=item *
376
377Try the Delete and Redirect With Query Param Logic
378
5e602627 379=back
380
4ab6212d 381=item *
382
383EXPLORING THE POWER OF DBIC
384
385=over 4
386
387=item *
388
389Add Datetime Columns to Our Existing Books Table
390
391=item *
392
393Update DBIC to Automatically Handle the Datetime Columns
394
395=item *
396
397Create a ResultSet Class
398
399=item *
400
401Chaining ResultSets
402
403=item *
404
405Adding Methods to Result Classes
406
407=back
408
5e602627 409=back
410
3533daff 411
1c96f145 412=head2 L<Chapter 5: Authentication|Catalyst::Manual::Tutorial::05_Authentication>
4b4d3884 413
414Note: Click on the heading in the previous line to jump to the actual
415chapter. Below is a "table of contents" for this chapter.
5e602627 416
417=over 4
418
419=item *
420
421BASIC AUTHENTICATION
422
423=over 4
424
425=item *
426
427Add Users and Roles to the Database
428
429=item *
430
431Add User and Role Information to DBIC Schema
432
433=item *
434
5e602627 435Sanity-Check Reload of Development Server
436
437=item *
438
439Include Authentication and Session Plugins
440
441=item *
442
443Configure Authentication
444
445=item *
446
447Add Login and Logout Controllers
448
449=item *
450
451Add a Login Form TT Template Page
452
453=item *
454
455Add Valid User Check
456
457=item *
458
459Displaying Content Only to Authenticated Users
460
461=item *
462
463Try Out Authentication
464
465=back
466
467=item *
468
469USING PASSWORD HASHES
470
471=over 4
472
473=item *
474
475Get a SHA-1 Hash for the Password
476
477=item *
478
479Switch to SHA-1 Password Hashes in the Database
480
481=item *
482
483Enable SHA-1 Hash Passwords in Catalyst::Plugin::Authentication::Store::DBIC
484
485=item *
486
487Try Out the Hashed Passwords
488
489=back
490
3533daff 491=item *
492
493USING THE SESSION FOR FLASH
494
495=over 4
496
497=item *
498
499Try Out Flash
500
501=item *
502
503Switch To Flash-To-Stash
504
5e602627 505=back
506
3533daff 507=back
508
509
1c96f145 510=head2 L<Chapter 6: Authorization|Catalyst::Manual::Tutorial::06_Authorization>
4b4d3884 511
512Note: Click on the heading in the previous line to jump to the actual
513chapter. Below is a "table of contents" for this chapter.
5e602627 514
515=over 4
516
517=item *
518
519BASIC AUTHORIZATION
520
521=over 4
522
523=item *
524
525Update Plugins to Include Support for Authorization
526
527=item *
528
529Add Config Information for Authorization
530
531=item *
532
533Add Role-Specific Logic to the ``Book List'' Template
534
535=item *
536
537Limit Books::add to admin Users
538
539=item *
540
541Try Out Authentication And Authorization
542
543=back
544
545=item *
546
4ab6212d 547ENABLE MODEL-BASED AUTHORIZATION
5e602627 548
549=back
550
3533daff 551
1c96f145 552=head2 L<Chapter 7: Debugging|Catalyst::Manual::Tutorial::07_Debugging>
4b4d3884 553
554Note: Click on the heading in the previous line to jump to the actual
555chapter. Below is a "table of contents" for this chapter.
5e602627 556
557=over 4
558
559=item *
560
561LOG STATEMENTS
562
563=item *
564
565RUNNING CATALYST UNDER THE PERL DEBUGGER
566
567=item *
568
569DEBUGGING MODULES FROM CPAN
570
4ab6212d 571=item *
572
573TT DEBUGGING
574
5e602627 575=back
576
3533daff 577
1c96f145 578=head2 L<Chapter 8: Testing|Catalyst::Manual::Tutorial::08_Testing>
4b4d3884 579
580Note: Click on the heading in the previous line to jump to the actual
581chapter. Below is a "table of contents" for this chapter.
5e602627 582
583=over 4
584
585=item *
586
587RUNNING THE "CANNED" CATALYST TESTS
588
589=item *
590
591RUNNING A SINGLE TEST
592
593=item *
594
595ADDING YOUR OWN TEST SCRIPT
596
597=item *
598
599SUPPORTING BOTH PRODUCTION AND TEST DATABASES
600
601=back
602
5e602627 603
1c96f145 604=head2 L<Chapter 9: Advanced CRUD|Catalyst::Manual::Tutorial::09_AdvancedCRUD>
4b4d3884 605
606Note: Click on the heading in the previous line to jump to the actual
607chapter. Below is a "table of contents" for this chapter.
5e602627 608
609=over 4
610
611=item *
612
3533daff 613ADVANCED CRUD OPTIONS
5e602627 614
615=back
616
5e602627 617
1c96f145 618=head2 L<Chapter 10: Appendices|Catalyst::Manual::Tutorial::10_Appendices>
4b4d3884 619
620Note: Click on the heading in the previous line to jump to the actual
621chapter. Below is a "table of contents" for this chapter.
5e602627 622
623=over 4
624
625=item *
626
627APPENDIX 1: CUT AND PASTE FOR POD-BASED EXAMPLES
628
629=over 4
630
631=item *
632
633"Un-indenting" with Vi/Vim
634
635=item *
636
637"Un-indenting" with Emacs
638
639=back
640
641=item *
642
643APPENDIX 2: USING MYSQL AND POSTGRESQL
644
645=over 4
646
647=item *
648
649MySQL
650
651=item *
652
653PostgreSQL
654
655=back
656
657=item *
658
659APPENDIX 3: IMPROVED HASHING SCRIPT
660
661=back
662
663
664=head1 THANKS
665
666This tutorial would not have been possible without the input of many
667different people in the Catalyst community. In particular, the
668primary author would like to thank:
669
670=over 4
671
672=item *
673
674Sebastian Riedel for founding the Catalyst project.
675
676=item *
677
678The members of the Catalyst Core Team for their tireless efforts to
679advance the Catalyst project. Although all of the Core Team members
680have played a key role in this tutorial, it would have never been
681possible without the critical contributions of: Matt Trout, for his
682unfathomable knowledge of all things Perl and Catalyst (and his
683willingness to answer lots of my questions); Jesse Sheidlower, for his
684incredible skill with the written word and dedication to improving the
685Catalyst documentation; and Yuval Kogman, for his work on the Catalyst
686"Auth & Authz" plugins (the original focus of the tutorial) and other
687key Catalyst modules.
688
689=item *
690
691Other Catalyst documentation folks like Kieren Diment, Gavin Henry,
692and Jess Robinson (including their work on the original Catalyst
3533daff 693tutorial).
694
695=item *
696
474c24ba 697Kieren Diment for his oversite of Catalyst-related documentation.
5e602627 698
699=item *
700
701Everyone on #catalyst and #catalyst-dev.
702
703=item *
704
3533daff 705Louis Moore (who thanks Marcello Romani and Tom Lanyon) for the
706PostgreSQL content in the Appendix.
707
708=item *
709
5e602627 710People who have emailed me with corrections and suggestions on the
057bb795 711tutorial. As of the most recent release, this include: Florian Ragwitz,
712Mauro Andreolini, Jim Howard, Giovanni Gigante, William Moreno, Bryan
713Roach, Ashley Berlin, David Kamholz, Kevin Old, Henning Sprang, Jeremy
714Jones, David Kurtz, Ingo Wichmann, Shlomi Fish, Murray Walker, Adam
715Witney and xenoterracide (Caleb Cushing). Thanks to Devin Austin for
716coming up with an initial version of a non-TTSite wrapper page. Also, a
717huge thank you to Kiffin Gish for all the hard work on the "database
718depluralization" effort and Rafael Kitover for the work on updating the
719tutorial to include foreign key support for SQLite. I'm sure I am
720missing some names here... apologies for that (please let me know if you
721name should be here).
5e602627 722
723=back
724
725=head1 AUTHOR
726
727Kennedy Clark, C<hkclark@gmail.com>
728
729Please report any errors, issues or suggestions to the author. The
730most recent version of the Catalyst Tutorial can be found at
59884771 731L<http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Manual/5.80/trunk/lib/Catalyst/Manual/Tutorial/>.
5e602627 732
45c7830f 733Copyright 2006-2008, Kennedy Clark, under Creative Commons License
5e602627 734(L<http://creativecommons.org/licenses/by-nc-sa/2.5/>).