]> git.decadent.org.uk Git - maypole.git/commitdiff
Added user() attribute and get_user() stub.
authorDavid Baird <cpan.zerofive@googlemail.com>
Thu, 10 Nov 2005 10:06:53 +0000 (10:06 +0000)
committerDavid Baird <cpan.zerofive@googlemail.com>
Thu, 10 Nov 2005 10:06:53 +0000 (10:06 +0000)
git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@423 48953598-375a-da11-a14b-00016c27c3ee

Changes
lib/Maypole.pm
wishlist.txt

diff --git a/Changes b/Changes
index 8a93719a1504a5ae1264dcb84f6ae818ec72436b..b93de7f48c9ef3533df4ef75358385d0607ffc42 100644 (file)
--- a/Changes
+++ b/Changes
@@ -21,7 +21,8 @@ API additions and enhancements:
     Maypole::Headers:
        add() alias to push() (wishlist 14142)
     Maypole:
-        - empty session() attribute, and get_session() method added.
+        - session() attribute, and get_session() method (no-op)
+        - user() attribute, and get_user() method (no-op)
         - get_session() now called during handler_guts() before authenticate()
         - new preprocess_path() method added and called by parse_path(), 
            parse_path() will leave any properties set by preprocess_path() in 
index 9f1af35366433899221fa6cf1fe191eb42dd8cfa..087f2b9daae744671f8cf3af72cd4886531edab8 100644 (file)
@@ -38,7 +38,7 @@ The canonical example used in the Maypole documentation is the beer database:
     $config->uri_base("http://localhost/beerdb");
     $config->template_root("/path/to/templates");
     $config->rows_per_page(10);
-    $config->display_tables([qw[beer brewery pub style]]);
+    $config->display_tables([qw/beer brewery pub style/]);
 
     # table relationships
     $config->relationships([
@@ -199,7 +199,7 @@ __PACKAGE__->mk_classdata($_) for qw( config init_done view_object );
 __PACKAGE__->mk_accessors(
     qw( params query objects model_class template_args output path
         args action template error document_encoding content_type table
-        headers_in headers_out stash session)
+        headers_in headers_out stash session user)
 );
 
 __PACKAGE__->config( Maypole::Config->new() );
@@ -437,6 +437,7 @@ sub handler : method
     return $status unless $status == Maypole::Constants::OK();
     
     $self->session($self->get_session);
+    $self->user($self->get_user);
     
     $status = $self->handler_guts;
     
@@ -691,12 +692,30 @@ sub is_model_applicable
 
 =item get_session
 
+Called immediately after C<start_request_hook()>.
+
+This method should return a session, which will be stored in the request's
+C<session> attribute.
+
 The default method is empty. 
 
 =cut
 
 sub get_session { }
 
+=item get_user
+
+Called immediately after C<get_session>.
+
+This method should return a user, which will be stored in the request's C<user>
+attribute.
+
+The default method is empty.
+
+=cut
+
+sub get_user {}
+
 =item call_authenticate
 
 This method first checks if the relevant model class
@@ -1200,7 +1219,7 @@ calls during processing of a request. This is a brief summary:
            |                        |                  |
            |-----+ init             |                  |
            ||<---+                  |                  |
-           ||                       |     new          |     view_object: e.g
+           ||                       |     new          |     view_object: e.g.
            ||---------------------------------------------> Maypole::View::TT
            |                        |                  |          |
            |                        |                  |          |
@@ -1230,6 +1249,9 @@ calls during processing of a request. This is a brief summary:
             |         ||-----+ get_session         |       |         |
             |         |||<---+                     |       |         |
             |         ||                           |       |         |
+            |         ||-----+ get_user            |       |         |
+            |         |||<---+                     |       |         |
+            |         ||                           |       |         |
             |         ||-----+ handler_guts        |       |         |
             |         |||<---+                     |       |         |
             |         |||     class_of($table)     |       |         |
@@ -1245,14 +1267,14 @@ calls during processing of a request. This is a brief summary:
             |         |||                          |       |         |
             |         |||-----+ additional_data    |       |         |
             |         ||||<---+                    |       |         |
-            |         |||             process      |       |   fetch_objects
-            |         |||--------------------------------->||-----+  |
+            |         |||             process      |       |         |
+            |         |||--------------------------------->||  fetch_objects
+            |         |||                          |       ||-----+  |
             |         |||                          |       |||<---+  |
             |         |||                          |       ||        |
             |         |||                          |       ||   $action
             |         |||                          |       ||-----+  |
-            |         |||                          |       |||<---+  |
-            |         |||                          |       |         |
+            |         |||                          |       |||<---+  |            
             |         |||         process          |       |         |
             |         |||------------------------------------------->|| template
             |         |||                          |       |         ||-----+
index 63e0ba3fa9732b6c6fa55620a86345e30c4ab529..7ee5bfbb76034566236441a483c9573736a0d972 100644 (file)
@@ -24,12 +24,18 @@ Re-implement Maypole::Cache as Maypole::Plugin::Cache, probably using
 Handle repeat form submissions.\r
 Implement internal_redirect().\r
 Build a more sophisticated app for testing. \r
+Move class_of() to the controller - need to do this to support multiple models. \r
+Multiple model support.\r
 \r
 3.0\r
 ====\r
 Encapsulate all request data in HTTP::Request object, and all response data \r
 in HTTP::Response object\r
 \r
+Look at HTTP::Body\r
+\r
+Easier file uploads - look at incorporating Mp::P::Upload\r
+\r
 Add email handling - like Rails - via model plugins. \r
 \r
 An e-commerce model plugin would be nice - or proof of concept.  \r