Misc updates to adjust Parts 8 & 9 and update their final tarball code
[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
12The tutorial is divided into the following sections:
13
14B<NOTE:> CLICK THESE LINKS TO JUMP TO CHAPTERS (the index links above
15only navigate inside this page).
16
17=over 4
18
3533daff 19=item 1
5e602627 20
21L<Introduction|Catalyst::Manual::Tutorial::Intro>
22
3533daff 23=item 2
5e602627 24
25L<Catalyst Basics|Catalyst::Manual::Tutorial::CatalystBasics>
26
3533daff 27=item 3
28
29L<More Catalyst Basics|Catalyst::Manual::Tutorial::MoreCatalystBasics>
30
31=item 4
5e602627 32
33L<Basic CRUD|Catalyst::Manual::Tutorial::BasicCRUD>
34
3533daff 35=item 5
5e602627 36
37L<Authentication|Catalyst::Manual::Tutorial::Authentication>
38
3533daff 39=item 6
5e602627 40
41L<Authorization|Catalyst::Manual::Tutorial::Authorization>
42
3533daff 43=item 7
5e602627 44
45L<Debugging|Catalyst::Manual::Tutorial::Debugging>
46
3533daff 47=item 8
5e602627 48
49L<Testing|Catalyst::Manual::Tutorial::Testing>
50
3533daff 51=item 9
5e602627 52
53L<Advanced CRUD|Catalyst::Manual::Tutorial::AdvancedCRUD>
54
3533daff 55=item 10
5e602627 56
57L<Appendices|Catalyst::Manual::Tutorial::Appendices>
58
59=back
60
028b4e1a 61Tarballs for the final code for each part of the tutorial is available
62at
63L<http://dev.catalyst.perl.org/repos/Catalyst/trunk/examples/Tutorial/>.
5e602627 64
65
66=head1 Detailed Table of Contents
67
3533daff 68
5e602627 69=head2 L<Part 1: Introduction|Catalyst::Manual::Tutorial::Intro>
70
71=over 4
72
73=item *
74
75VERSIONS AND CONVENTIONS USED IN THIS TUTORIAL
76
77=item *
78
79CATALYST INSTALLATION
80
81=item *
82
83DATABASES
84
85=item *
86
87WHERE TO GET WORKING CODE
88
89=back
90
91
92=head2 L<Part 2: Catalyst Basics|Catalyst::Manual::Tutorial::CatalystBasics>
93
94=over 4
95
96=item *
97
98CREATE A CATALYST PROJECT
99
100=item *
101
3533daff 102HELLO WORLD
103
104=over 4
5e602627 105
106=item *
107
3533daff 108The Simplest Way
5e602627 109
110=item *
111
3533daff 112Hello, World! Using a View and a Template
5e602627 113
3533daff 114=back
5e602627 115
116=item *
117
3533daff 118CREATE A SIMPLE CONTROLLER AND AN ACTION
119
120=back
5e602627 121
5e602627 122
3533daff 123=head2 L<Part 3: More Catalyst Basics|Catalyst::Manual::Tutorial::MoreCatalystBasics>
124
125
126=over 4
5e602627 127
128=item *
129
3533daff 130CREATE A NEW APPLICATION
5e602627 131
3533daff 132=item *
5e602627 133
3533daff 134EDIT THE LIST OF CATALYST PLUGINS
5e602627 135
136=item *
137
138CREATE A CATALYST CONTROLLER
139
140=item *
141
142CATALYST VIEWS
143
144
145=over 4
146
147=item *
148
149Create a Catalyst View Using TTSite
150
151=item *
152
3533daff 153Globally Customize Every View
5e602627 154
155=item *
156
3533daff 157Create a TT Template Page
158
159=back
5e602627 160
161=item *
162
3533daff 163CREATE A SQLITE DATABASE
164
165=item *
166
167DATABASE ACCESS WITH DBIx::Class
168
169=over 4
170
171=item *
172
173Create a Dynamic DBIC Model
5e602627 174
175=back
176
3533daff 177=item *
178
179RUN THE APPLICATION
180
181=item *
182
183A STATIC DATABASE MODEL WITH DBIx::Class
184
185=over 4
186
187=item *
188
189Create Static DBIC Schema Files
190
191=item *
192
193Updating the Generated DBIC Schema Files
194
195=back
5e602627 196
197=item *
198
199RUN THE APPLICATION
200
201=item *
202
3533daff 203RUNNING THE APPLICATION FROM THE COMMAND LINE
204
205=item *
206
207UPDATING THE VIEW
208
209=over 4
210
211=item *
212
213Using RenderView for the Default View
214
215=item *
216
217Using The Default Template Name
218
219=item *
220
221Return To A Manually-Specified Template
222
223=back
5e602627 224
225=back
226
3533daff 227
228=head2 L<Part 4: Basic CRUD|Catalyst::Manual::Tutorial::BasicCRUD>
5e602627 229
230=over 4
231
232=item *
233
234FORMLESS SUBMISSION
235
236=over 4
237
238=item *
239
240Include a Create Action in the Books Controller
241
242=item *
243
244Include a Template for the url_create Action:
245
246=item *
247
248Try the url_create Feature
249
250=back
251
252=item *
253
254MANUALLY BUILDING A CREATE FORM
255
256=over 4
257
258=item *
259
260Add a Method to Display the Form
261
262=item *
263
264Add a Template for the Form
265
266=item *
267
268Add Method to Process Form Values and Update Database
269
270=item *
271
272Test Out the Form
273
274=back
275
276=item *
277
278A SIMPLE DELETE FEATURE
279
280=over 4
281
282=item *
283
284Include a Delete Link in the List
285
286=item *
287
288Add a Delete Action to the Controller
289
290=item *
291
292Try the Delete Feature
293
3533daff 294=item *
295
296Fixing a Dangerous URL
297
298=item *
299
300Try the Delete and Redirect Logic
301
302=item *
303
304Using uri_for to Pass Query Parameters
305
306=item *
307
308Try the Delete and Redirect With Query Param Logic
309
5e602627 310=back
311
312=back
313
3533daff 314
315=head2 L<Part 5: Authentication|Catalyst::Manual::Tutorial::Authentication>
5e602627 316
317=over 4
318
319=item *
320
321BASIC AUTHENTICATION
322
323=over 4
324
325=item *
326
327Add Users and Roles to the Database
328
329=item *
330
331Add User and Role Information to DBIC Schema
332
333=item *
334
5e602627 335Sanity-Check Reload of Development Server
336
337=item *
338
339Include Authentication and Session Plugins
340
341=item *
342
343Configure Authentication
344
345=item *
346
347Add Login and Logout Controllers
348
349=item *
350
351Add a Login Form TT Template Page
352
353=item *
354
355Add Valid User Check
356
357=item *
358
359Displaying Content Only to Authenticated Users
360
361=item *
362
363Try Out Authentication
364
365=back
366
367=item *
368
369USING PASSWORD HASHES
370
371=over 4
372
373=item *
374
375Get a SHA-1 Hash for the Password
376
377=item *
378
379Switch to SHA-1 Password Hashes in the Database
380
381=item *
382
383Enable SHA-1 Hash Passwords in Catalyst::Plugin::Authentication::Store::DBIC
384
385=item *
386
387Try Out the Hashed Passwords
388
389=back
390
3533daff 391=item *
392
393USING THE SESSION FOR FLASH
394
395=over 4
396
397=item *
398
399Try Out Flash
400
401=item *
402
403Switch To Flash-To-Stash
404
5e602627 405=back
406
3533daff 407=back
408
409
410=head2 L<Part 6: Authorization|Catalyst::Manual::Tutorial::Authorization>
5e602627 411
412=over 4
413
414=item *
415
416BASIC AUTHORIZATION
417
418=over 4
419
420=item *
421
422Update Plugins to Include Support for Authorization
423
424=item *
425
426Add Config Information for Authorization
427
428=item *
429
430Add Role-Specific Logic to the ``Book List'' Template
431
432=item *
433
434Limit Books::add to admin Users
435
436=item *
437
438Try Out Authentication And Authorization
439
440=back
441
442=item *
443
444ENABLE ACL-BASED AUTHORIZATION
445
446=over 4
447
448=item *
449
450Add the Catalyst::Plugin::Authorization::ACL Plugin
451
452=item *
453
454Add ACL Rules to the Application Class
455
456=item *
457
458Add a Method to Handle Access Violations
459
460=back
461
462=back
463
3533daff 464
465=head2 L<Part 7: Debugging|Catalyst::Manual::Tutorial::Debugging>
5e602627 466
467=over 4
468
469=item *
470
471LOG STATEMENTS
472
473=item *
474
475RUNNING CATALYST UNDER THE PERL DEBUGGER
476
477=item *
478
479DEBUGGING MODULES FROM CPAN
480
481=back
482
3533daff 483
484=head2 L<Part 8: Testing|Catalyst::Manual::Tutorial::Testing>
5e602627 485
486=over 4
487
488=item *
489
490RUNNING THE "CANNED" CATALYST TESTS
491
492=item *
493
494RUNNING A SINGLE TEST
495
496=item *
497
498ADDING YOUR OWN TEST SCRIPT
499
500=item *
501
502SUPPORTING BOTH PRODUCTION AND TEST DATABASES
503
504=back
505
5e602627 506
3533daff 507=head2 L<Part 9: Advanced CRUD|Catalyst::Manual::Tutorial::AdvancedCRUD>
5e602627 508
509=over 4
510
511=item *
512
3533daff 513ADVANCED CRUD OPTIONS
5e602627 514
515=back
516
5e602627 517
3533daff 518=head2 L<Part 10: Appendices|Catalyst::Manual::Tutorial::Appendices>
5e602627 519
520=over 4
521
522=item *
523
524APPENDIX 1: CUT AND PASTE FOR POD-BASED EXAMPLES
525
526=over 4
527
528=item *
529
530"Un-indenting" with Vi/Vim
531
532=item *
533
534"Un-indenting" with Emacs
535
536=back
537
538=item *
539
540APPENDIX 2: USING MYSQL AND POSTGRESQL
541
542=over 4
543
544=item *
545
546MySQL
547
548=item *
549
550PostgreSQL
551
552=back
553
554=item *
555
556APPENDIX 3: IMPROVED HASHING SCRIPT
557
558=back
559
560
561=head1 THANKS
562
563This tutorial would not have been possible without the input of many
564different people in the Catalyst community. In particular, the
565primary author would like to thank:
566
567=over 4
568
569=item *
570
571Sebastian Riedel for founding the Catalyst project.
572
573=item *
574
575The members of the Catalyst Core Team for their tireless efforts to
576advance the Catalyst project. Although all of the Core Team members
577have played a key role in this tutorial, it would have never been
578possible without the critical contributions of: Matt Trout, for his
579unfathomable knowledge of all things Perl and Catalyst (and his
580willingness to answer lots of my questions); Jesse Sheidlower, for his
581incredible skill with the written word and dedication to improving the
582Catalyst documentation; and Yuval Kogman, for his work on the Catalyst
583"Auth & Authz" plugins (the original focus of the tutorial) and other
584key Catalyst modules.
585
586=item *
587
588Other Catalyst documentation folks like Kieren Diment, Gavin Henry,
589and Jess Robinson (including their work on the original Catalyst
3533daff 590tutorial).
591
592=item *
593
474c24ba 594Kieren Diment for his oversite of Catalyst-related documentation.
5e602627 595
596=item *
597
598Everyone on #catalyst and #catalyst-dev.
599
600=item *
601
3533daff 602Louis Moore (who thanks Marcello Romani and Tom Lanyon) for the
603PostgreSQL content in the Appendix.
604
605=item *
606
5e602627 607People who have emailed me with corrections and suggestions on the
608tutorial. As of the most recent release, this include: Florian Ragwitz,
474c24ba 609Mauro Andreolini, Jim Howard, Giovanni Gigante, William Moreno, Bryan
610Roach, Ashley Berlin, David Kamholz, Kevin Old, Henning Sprang, Jeremy
611Jones, David Kurtz, Ingo Wichmann, and Shlomi Fish. Also, thanks to
612Devin Austin for coming up with an initial version of a non-TTSite
613wrapper page. I'm sure I am missing some names here... apologies for
614that (please let me know if you name should be here).
5e602627 615
616=back
617
618=head1 AUTHOR
619
620Kennedy Clark, C<hkclark@gmail.com>
621
622Please report any errors, issues or suggestions to the author. The
623most recent version of the Catalyst Tutorial can be found at
d712b826 624L<http://dev.catalyst.perl.org/repos/Catalyst/trunk/Catalyst-Manual/lib/Catalyst/Manual/Tutorial/>.
5e602627 625
45c7830f 626Copyright 2006-2008, Kennedy Clark, under Creative Commons License
5e602627 627(L<http://creativecommons.org/licenses/by-nc-sa/2.5/>).