X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole%2FManual%2FWorkflow.pod;h=d860523b1dc9ebe60a8ef5c345feb517534d6a34;hb=628ecd5d9d294e601c79c7509140d02dcd7a1d40;hp=622d75564a6ce7fd2c766aa87af28a2a44d035d9;hpb=bf26883dc1ef2013406a5777f60eb007574905f5;p=maypole.git diff --git a/lib/Maypole/Manual/Workflow.pod b/lib/Maypole/Manual/Workflow.pod index 622d755..d860523 100644 --- a/lib/Maypole/Manual/Workflow.pod +++ b/lib/Maypole/Manual/Workflow.pod @@ -1,10 +1,13 @@ =pod -=head1 NAME +=head1 Maypole's Request Workflow -Maypole::Manual::Workflow - Describes the progress of a request through Maypole +This chapter describes the progress of a request through Maypole. -=head1 SYNOPSIS +An application based on C provides an Apache or CGI handler, +and eventually delivers a page. This document explains how that happens, +and how to influence it. We'll use the C project as our example. +Here's a diagram that gives an overview: config $h | @@ -26,18 +29,11 @@ Maypole::Manual::Workflow - Describes the progress of a request through Maypole | $r->view_object->process($r) - -=head1 DESCRIPTION - -An application based on C will provide an Apache handler, -and eventually deliver a page. This document explains how that happens, -and how to influence it. We'll use the C project as our example. - =head2 Initialize class -When the first request comes in, the class will call its own -C method. This creates a new view object, sets up inheritance -relationships between the model classes and their parent, and so on. +When the first request comes in, the application class will call its own +C method, inherited from L. +This creates a new view object. =head2 Construction @@ -89,15 +85,24 @@ or whatever other codes for permissions problems. We then look for an appropriate C method to call; first it will try calling the C method of the model class, or, if that does not exist, the C method on itself. By -default, this allows access to everyone for everything. Similarly, this -should return an Apache status code. +default, this allows access to everyone for everything. +Your C methods must return an Apache status code: C or +C. These codes are defined by the L +module, which is automatically used by your application. =head2 Add any additional data to the request -The open-ended C method allows any additional fiddling +You can write an C method to do any additional fiddling with the request object before it is despatched. Specifically, it allows you to add to the C slot, which is a hash of arguments to -be added to the template. +be added to the template, like this: + + sub additional_data { + my $self = shift; + $self->{template_args}{answer} = 42; + } + +which adds a new template variable C with the value 42. =head2 Ask model for widget set @@ -105,16 +110,6 @@ Asking the model class to C the current request allows it to do any work it needs for the given command, and populate the C and C