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