Cleaned up Tut files; no substantive changes
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Manual / Tutorial.pod
CommitLineData
83cea649 1=head1 NAME
2
4d583dd8 3Catalyst::Manual::Tutorial - Catalyst Tutorial: Overview
4
5
83cea649 6
7=head1 DESCRIPTION
8
64ccd8a8 9The Catalyst framework is a flexible and comprehensive environment for
10quickly building high-functionality web applications. This tutorial is
11design to provide a rapid introduction to its basics and most commonly
12used features while focusing on real-world best practices.
4d583dd8 13
14The tutorial is broken down into the following sections:
15
16=over 4
17
18=item *
19
64ccd8a8 20L<Introduction|Catalyst::Manual::Tutorial_Intro>
4d583dd8 21
22=item *
23
64ccd8a8 24L<Catalyst Basics|Catalyst::Manual::Tutorial_CatalystBasics>
4d583dd8 25
26=item *
27
64ccd8a8 28L<CRUD|Catalyst::Manual::Tutorial_BasicCRUD>
4d583dd8 29
30=item *
31
64ccd8a8 32L<Authentication|Catalyst::Manual::Tutorial_Authentication>
4d583dd8 33
34=item *
35
64ccd8a8 36L<Authorization|Catalyst::Manual::Tutorial_Authorization>
4d583dd8 37
38=item *
39
64ccd8a8 40L<Debugging|Catalyst::Manual::Tutorial_Debugging>
4d583dd8 41
42=item *
43
64ccd8a8 44L<Testing|Catalyst::Manual::Tutorial_Testing>
4d583dd8 45
46=item *
47
64ccd8a8 48L<CRUD|Catalyst::Manual::Tutorial_AdvancedCRUD>
4d583dd8 49
50=item *
51
64ccd8a8 52L<Appendicies|Catalyst::Manual::Tutorial_Appendicies>
4d583dd8 53
54=back
55
56
64ccd8a8 57Full source code is available for each section via the main Catalyst
58Subversion repository at
59L<http://dev.catalyst.perl.org/repos/Catalyst/trunk/examples/>. See the
60end of each section for the specifics on retrieving code for that
61section.
4d583dd8 62
64ccd8a8 63A tarball of the final application is available at
64C<to_be_compled_in_final_version>.
4d583dd8 65
66=head1 Detailed Table Of Contents
67
68=head2 Part 1: Introduction
69
70=over 4
71
72=item *
73
74VERSIONS AND CONVENTIONS USED IN THIS TUTORIAL
75
76=item *
77
78CATALYST INSTALLATION
79
80=item *
81
82DATABASES
83
84=item *
85
86WHERE TO GET WORKING CODE
87
88=back
89
90
4d583dd8 91=head2 Part 2: Catalyst Application Development Basics
92
93=over 4
94
95=item *
96
97CREATE A CATALYST PROJECT
98
99=item *
100
101CREATE A SQLITE DATABASE
102
103=item *
104
105EDIT THE LIST OF CATALYST PLUGINS
106
107=item *
108
109DATABASE ACCESS WITH DBIx::Class
110
111=over 4
112
113=item *
114
115Create a DBIC Schema File
116
117=item *
118
119Create the DBIC ``Result Source'' Files
120
121=item *
122
123Use Catalyst::Model::DBIC::Schema To Load The Model Class
124
125=back
126
127=item *
128
129CREATE A CATALYST CONTROLLER
130
131=item *
132
133CATALYST VIEWS
134
135=over 4
136
137=item *
138
139Create a Catalyst View Using TTSITE
140
141=item *
142
143Globally Customize Every View
144
145=item *
146
147Create a TT Template Page
148
149=back
150
151=item *
152
153RUN THE APPLICATION
154
155=back
156
157
4d583dd8 158=head2 Part 3: Basic CRUD
159
160=over 4
161
162=item *
163
164FORMLESS SUBMISSION
165
166=over 4
167
168=item *
169
170Include a Create Action in the Books Controller
171
172=item *
173
174Include a Template for the url_create Action:
175
176=item *
177
178Try the url_create Feature
179
180=back
181
182=item *
183
184MANUALLY BUILDING A CREATE FORM
185
186=over 4
187
188=item *
189
190Add Method to Display The Form
191
192=item *
193
194Add a Template for the Form
195
196=item *
197
198Add Method to Process Form Values and Update Database
199
200=item *
201
202Test Out The Form
203
204=back
205
206=item *
207
208A SIMPLE DELETE FEATURE
209
210=over 4
211
212=item *
213
214Include a Delete Link in the List
215
216=item *
217
218Add a Delete Action to the Controller
219
220=item *
221
222Try the Delete Feature
223
224=back
225
226=back
227
228
4d583dd8 229=head2 Part 4: Authentication
230
231=over 4
232
233=item *
234
235BASIC AUTHENTICATION
236
237=over 4
238
239=item *
240
241Add Users and Roles to the Database
242
243=item *
244
64ccd8a8 245Add User and Role Information to DBIC Schema
4d583dd8 246
247=item *
248
249Create New ``Result Source Objects''
250
251=item *
252
253Sanity-Check Reload of Development Server
254
255=item *
256
257Include Authentication and Session Plugins
258
259=item *
260
261Configure Authentication
262
263=item *
264
265Add Login and Logout Controllers
266
267=item *
268
269Add a Login Form TT Template Page
270
271=item *
272
273Add Valid User Check
274
275=item *
276
277Displaying Content Only to Authenticated Users
278
279=item *
280
281Try Out Authentication
282
283=back
284
285=item *
286
287USING PASSWORD HASHES
288
289=over 4
290
291=item *
292
293Get a SHA-1 Hash for the Password
294
295=item *
296
297Switch to SHA-1 Password Hashes in the Database
298
299=item *
300
301Enable SHA-1 Hash Passwords in Catalyst::Plugin::Authentication::Store::DBIC
302
303=item *
304
305Try Out the Hashed Passwords
306
307=back
308
309=back
310
311
4d583dd8 312=head2 Part 5: Authorization
313
314=over 4
315
316=item *
83cea649 317
4d583dd8 318BASIC AUTHORIZATION
83cea649 319
4d583dd8 320=over 4
83cea649 321
4d583dd8 322=item *
83cea649 323
64ccd8a8 324Update Plugins to Include Support for Authorization
83cea649 325
4d583dd8 326=item *
83cea649 327
4d583dd8 328Add Config Information for Authorization
83cea649 329
4d583dd8 330=item *
83cea649 331
4d583dd8 332Add Role-Specific Logic to the ``Book List'' Template
b248fa4a 333
4d583dd8 334=item *
83cea649 335
4d583dd8 336Limit Books::add to admin Users
83cea649 337
4d583dd8 338=item *
83cea649 339
4d583dd8 340Try Out Authentication And Authorization
83cea649 341
4d583dd8 342=back
b33ed88c 343
4d583dd8 344=item *
b248fa4a 345
4d583dd8 346ENABLE ACL-BASED AUTHORIZATION
b33ed88c 347
4d583dd8 348=over 4
b460ad78 349
4d583dd8 350=item *
83cea649 351
4d583dd8 352Add the Catalyst::Plugin::Authorization::ACL Plugin
b248fa4a 353
4d583dd8 354=item *
83cea649 355
4d583dd8 356Add ACL Rules to the Application Class
83cea649 357
4d583dd8 358=item *
387e4c50 359
4d583dd8 360Add a Method to Handle Access Violations
83cea649 361
4d583dd8 362=back
83cea649 363
4d583dd8 364=back
83cea649 365
83cea649 366
4d583dd8 367=head2 Part 6: Debugging
83cea649 368
4d583dd8 369=over 4
83cea649 370
4d583dd8 371=item *
83cea649 372
4d583dd8 373LOG STATEMENTS
83cea649 374
4d583dd8 375=item *
83cea649 376
4d583dd8 377RUNNING CATALYST UNDER THE PERL DEBUGGER
83cea649 378
4d583dd8 379=back
587d5860 380
587d5860 381
4d583dd8 382=head2 Part 7: Testing
83cea649 383
4d583dd8 384=over 4
83cea649 385
4d583dd8 386=item *
8d47005f 387
4d583dd8 388RUNNING THE "CANNED" CATALYST TESTS
8d47005f 389
4d583dd8 390=item *
8d47005f 391
4d583dd8 392RUNNING A SINGLE TEST
c425bfeb 393
4d583dd8 394=item *
c425bfeb 395
4d583dd8 396ADDING YOUR OWN TEST SCRIPT
8d47005f 397
4d583dd8 398=item *
8d47005f 399
4d583dd8 400SUPPORTING BOTH PRODUCTION AND TEST DATABASES
de6fb80a 401
4d583dd8 402=back
8d47005f 403
8d47005f 404
4d583dd8 405=head2 Part 8: Advanced CRUD
8d47005f 406
4d583dd8 407=over 4
8d47005f 408
4d583dd8 409=item *
8d47005f 410
4d583dd8 411HTML::WIDGET FORM CREATION
de6fb80a 412
4d583dd8 413=over 4
8d47005f 414
4d583dd8 415=item *
8d47005f 416
4d583dd8 417Add the HTML::Widget Plugin
8d47005f 418
4d583dd8 419=item *
8d47005f 420
4d583dd8 421Add a Form Creation Helper Method
8d47005f 422
4d583dd8 423=item *
8d47005f 424
4d583dd8 425Add Actions to Display and Save the Form
8d47005f 426
4d583dd8 427=item *
b460ad78 428
4d583dd8 429Update the CSS
b460ad78 430
4d583dd8 431=item *
b460ad78 432
4d583dd8 433Create a Template Page To Display The Form
b460ad78 434
4d583dd8 435=item *
b460ad78 436
4d583dd8 437Add Links for Create and Update via HTML::Widget
b460ad78 438
4d583dd8 439=item *
b460ad78 440
4d583dd8 441Test The <HTML::Widget> Create Form
b460ad78 442
4d583dd8 443=back
b460ad78 444
4d583dd8 445=item *
b460ad78 446
4d583dd8 447HTML::WIDGET VALIDATION AND FILTERING
b460ad78 448
4d583dd8 449=over 4
b460ad78 450
4d583dd8 451=item *
83cea649 452
4d583dd8 453Add Constraints and Filters to the Widget Creation Method
8d47005f 454
4d583dd8 455=item *
8d47005f 456
4d583dd8 457Rebuild the Form Submission Method to Include Validation
8d47005f 458
4d583dd8 459=item *
8d47005f 460
4d583dd8 461Try Out the Form
8d47005f 462
4d583dd8 463=back
8d47005f 464
4d583dd8 465=item *
8d47005f 466
4d583dd8 467Enable DBIx::Class::HTMLWidget Support
8d47005f 468
4d583dd8 469=over 4
8d47005f 470
4d583dd8 471=item *
83cea649 472
4d583dd8 473Add DBIx::Class::HTMLWidget to DBIC Model
b460ad78 474
4d583dd8 475=item *
b460ad78 476
4d583dd8 477Use populate_from_widget in hw_create_do
b460ad78 478
4d583dd8 479=back
b460ad78 480
4d583dd8 481=back
b460ad78 482
b460ad78 483
4d583dd8 484=head2 Part 9: Appendices
b460ad78 485
4d583dd8 486=over 4
b460ad78 487
4d583dd8 488=item *
8d47005f 489
4d583dd8 490APPENDIX 1: CUT AND PASTE FOR POD-BASED EXAMPLES
8d47005f 491
4d583dd8 492=over 4
8d47005f 493
4d583dd8 494=item *
8d47005f 495
4d583dd8 496"Un-indenting" with Vi/Vim
8d47005f 497
4d583dd8 498=item *
8d47005f 499
4d583dd8 500"Un-indenting" with Emacs
8d47005f 501
4d583dd8 502=back
8d47005f 503
4d583dd8 504=item *
8d47005f 505
4d583dd8 506APPENDIX 2: USING MYSQL AND POSTGRESQL
8d47005f 507
4d583dd8 508=over 4
8d47005f 509
4d583dd8 510=item *
b460ad78 511
4d583dd8 512MySQL
8d47005f 513
4d583dd8 514=item *
8d47005f 515
4d583dd8 516PostgreSQL
8d47005f 517
4d583dd8 518=back
b460ad78 519
4d583dd8 520=back
83cea649 521