]> git.decadent.org.uk Git - maypole.git/blob - README
some release preparation
[maypole.git] / README
1 NAME
2     Maypole - MVC web application framework
3
4 SYNOPSIS
5     See Maypole::Application.
6
7 DESCRIPTION
8     This documents the Maypole request object. For user documentation, see
9     Maypole::Manual.
10
11   CLASS METHODS
12    config
13     Returns the Maypole::Config object
14
15    setup
16         My::App->setup($data_source, $user, $password, \%attr);
17
18     Initialise the maypole application and model classes. Your application
19     should call this after setting configuration via "config"
20
21    init
22     You should not call this directly, but you may wish to override this to
23     add application-specific initialisation.
24
25    view_object
26     Get/set the Maypole::View object
27
28    debug
29         sub My::App::debug {1}
30
31     Returns the debugging flag. Override this in your application class to
32     enable/disable debugging.
33
34   INSTANCE METHODS
35    parse_location
36     Turns the backend request (e.g. Apache::MVC, Maypole, CGI) into a
37     Maypole request. It does this by setting the "path", and invoking
38     "parse_path" and "parse_args".
39
40     You should only need to define this method if you are writing a new
41     Maypole backend.
42
43    path
44     Returns the request path
45
46    parse_path
47     Parses the request path and sets the "args", "action" and "table"
48     properties
49
50    table
51     The table part of the Maypole request path
52
53    action
54     The action part of the Maypole request path
55
56    args
57     A list of remaining parts of the request path after table and action
58     have been removed
59
60    parse_args
61     Turns post data and query string paramaters into a hash of "params".
62
63     You should only need to define this method if you are writing a new
64     Maypole backend.
65
66    params
67     Returns a hash of request parameters. The source of the parameters may
68     vary depending on the Maypole backend, but they are usually populated
69     from request query string and POST data.
70
71     Note: Where muliple values of a parameter were supplied, the "params"
72     value will be an array reference.
73
74    get_template_root
75     Implimentation-specific path to template root.
76
77     You should only need to define this method if you are writing a new
78     Maypole backend. Otherwise, see "template_root" in Maypole::Config
79
80    get_request
81     You should only need to define this method if you are writing a new
82     Maypole backend. It should return something that looks like an Apache or
83     CGI request object, it defaults to blank.
84
85    is_applicable
86     Returns a Maypole::Constant to indicate whether the request is valid.
87
88     The default implimentation checks that "$r->table" is publicly
89     accessible and that the model class is configured to handle the
90     "$r->action"
91
92    authenticate
93     Returns a Maypole::Constant to indicate whether the user is
94     authenticated for the Maypole request.
95
96     The default implimentation returns "OK"
97
98    model_class
99     Returns the perl package name that will serve as the model for the
100     request. It corresponds to the request "table" attribute.
101
102    additional_data
103     Called before the model processes the request, this method gives you a
104     chance to do some processing for each request, for example, manipulating
105     "template_args".
106
107    objects
108     Get/set a list of model objects. The objects will be accessible in the
109     view templates.
110
111     If the first item in "$r->args" can be "retrieve()"d by the model class,
112     it will be removed from "args" and the retrieved object will be added to
113     the "objects" list. See Maypole::Model for more information.
114
115    template_args
116         $r->template_args->{foo} = 'bar';
117
118     Get/set a hash of template variables.
119
120    template
121     Get/set the template to be used by the view. By default, it returns
122     "$r->action"
123
124    exception
125     This method is called if any exceptions are raised during the
126     authentication or model/view processing. It should accept the exception
127     as a parameter and return a Maypole::Constant to indicate whether the
128     request should continue to be processed.
129
130    error
131     Get/set a request error
132
133    output
134     Get/set the response output. This is usually populated by the view
135     class. You can skip view processing by setting the "output".
136
137    document_encoding
138     Get/set the output encoding. Default: utf-8.
139
140    content_type
141     Get/set the output content type. Default: text/html
142
143    send_output
144     Sends the output and additional headers to the user.
145
146    call_authenticate
147     This method first checks if the relevant model class can authenticate
148     the user, or falls back to the default authenticate method of your
149     Maypole application.
150
151    call_exception
152     This model is called to catch exceptions, first after authenticate ,then
153     after processing the model class, and finally to check for exceptions
154     from the view class.
155
156     This method first checks if the relevant model class can handle
157     exceptions the user, or falls back to the default exception method of
158     your Maypole application.
159
160    handler
161     This method sets up the class if it's not done yet, sets some defaults
162     and leaves the dirty work to handler_guts.
163
164    handler_guts
165     This is the core of maypole. You don't want to know.
166
167 SEE ALSO
168     There's more documentation, examples, and a wiki at the Maypole web
169     site:
170
171     http://maypole.perl.org/
172
173     Maypole::Application,Apache::MVC, CGI::Maypole.
174
175 AUTHOR
176     Sebastian Riedel, c<sri@oook.de>
177
178 AUTHOR EMERITUS
179     Simon Cozens, "simon@cpan.org"
180
181 THANKS TO
182     Danijel Milicevic, Dave Slack, Jesse Sheidlower, Jody Belka, Marcus
183     Ramberg, Mickael Joanne, Simon Flack, Veljko Vidovic and all the others
184     who've helped.
185
186 LICENSE
187     You may distribute this code under the same terms as Perl itself.
188