]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole.pm
fixed search ordering in Maypole::Model::CDBI and parameter handling in CGI::Maypole
[maypole.git] / lib / Maypole.pm
index 6ab5bc029860121331a1285467ef68d961f4a2ec..6b4fe3f0a56d250f7261e2cfc4e53cb98449cbb2 100644 (file)
@@ -5,7 +5,10 @@ use UNIVERSAL::require;
 use strict;
 use warnings;
 use Maypole::Config;
 use strict;
 use warnings;
 use Maypole::Config;
+use Maypole::Constants;
+
 our $VERSION = '2.0';
 our $VERSION = '2.0';
+
 __PACKAGE__->mk_classdata($_) for qw( config init_done view_object );
 __PACKAGE__->mk_accessors(
     qw( ar params query objects model_class template_args output path
 __PACKAGE__->mk_classdata($_) for qw( config init_done view_object );
 __PACKAGE__->mk_accessors(
     qw( ar params query objects model_class template_args output path
@@ -13,7 +16,6 @@ __PACKAGE__->mk_accessors(
 );
 __PACKAGE__->config( Maypole::Config->new() );
 __PACKAGE__->init_done(0);
 );
 __PACKAGE__->config( Maypole::Config->new() );
 __PACKAGE__->init_done(0);
-use Maypole::Constants;
 
 sub debug { 0 }
 
 
 sub debug { 0 }
 
@@ -128,23 +130,15 @@ sub is_applicable {
     $config->ok_tables || $config->ok_tables( $config->display_tables );
     $config->ok_tables( { map { $_ => 1 } @{ $config->ok_tables } } )
       if ref $config->ok_tables eq "ARRAY";
     $config->ok_tables || $config->ok_tables( $config->display_tables );
     $config->ok_tables( { map { $_ => 1 } @{ $config->ok_tables } } )
       if ref $config->ok_tables eq "ARRAY";
-    warn "We don't have that table ($self->{table})"
+    warn "We don't have that table ($self->{table}).\n"
+      . "Available tables are: "
+      . join( ",", @{ $config->{display_tables} } )
       if $self->debug
       and not $config->ok_tables->{ $self->{table} };
     return DECLINED() unless exists $config->ok_tables->{ $self->{table} };
 
       if $self->debug
       and not $config->ok_tables->{ $self->{table} };
     return DECLINED() unless exists $config->ok_tables->{ $self->{table} };
 
-    # Does the action method exist?
-    my $cv = $self->model_class->can( $self->{action} );
-    warn "We don't have that action ($self->{action})"
-      if $self->debug and not $cv;
-    return DECLINED() unless $cv;
-
-    # Is it exported?
-    $self->{method_attribs} = join " ", attributes::get($cv);
-    do {
-        warn "$self->{action} not exported" if $self->debug;
-        return DECLINED();
-    } unless $self->{method_attribs} =~ /\bExported\b/i;
+    # Is it public?
+    return DECLINED unless $self->model_class->is_public( $self->{action} );
     return OK();
 }
 
     return OK();
 }
 
@@ -211,7 +205,7 @@ See L<Maypole::Application>.
 =head1 DESCRIPTION
 
 This documents the Maypole request object. For user documentation, see
 =head1 DESCRIPTION
 
 This documents the Maypole request object. For user documentation, see
-L<Maypole::Tutorial>.
+L<Maypole::Manual>.
 
 =head2 CLASS METHODS
 
 
 =head2 CLASS METHODS
 
@@ -221,11 +215,10 @@ Returns the L<Maypole::Config> object
 
 =head3 setup
 
 
 =head3 setup
 
-    My::App->setup();
+    My::App->setup($data_source, $user, $password, \%attr);
 
 
-    Initialise the maypole application and model classes. Your
-    application should
-    call this after setting configuration via L<"config">
+Initialise the maypole application and model classes. Your application should
+call this after setting configuration via L<"config">
 
 =head3 init
 
 
 =head3 init
 
@@ -241,9 +234,8 @@ Get/set the Maypole::View object
 
     sub My::App::debug {1}
 
 
     sub My::App::debug {1}
 
-    Returns the debugging flag. Override this in your application class
-    to
-    enable/disable debugging.
+Returns the debugging flag. Override this in your application class to
+enable/disable debugging.
 
 =head2 INSTANCE METHODS
 
 
 =head2 INSTANCE METHODS
 
@@ -355,7 +347,7 @@ C<objects> list. See L<Maypole::Model> for more information.
 
     $r->template_args->{foo} = 'bar';
 
 
     $r->template_args->{foo} = 'bar';
 
-    Get/set a hash of template variables.
+Get/set a hash of template variables.
 
 =head3 template
 
 
 =head3 template
 
@@ -414,7 +406,7 @@ Simon Cozens, C<simon@cpan.org>
 
 =head1 THANK YOU
 
 
 =head1 THANK YOU
 
-Danijel Milicevic, Jesse Scheidlower, Jody Belka, Marcus Ramberg,
+Danijel Milicevic, Dave Slack, Jesse Sheidlower, Jody Belka, Marcus Ramberg,
 Mickael Joanne, Simon Flack, Veljko Vidovic and all the others who've
 helped.
 
 Mickael Joanne, Simon Flack, Veljko Vidovic and all the others who've
 helped.