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