Hi Richard,
On 15/09/06, richard head <[EMAIL PROTECTED]> wrote:
> But………….. problems with the actions. In your previous message, you said one
> should create actions in packages like so:
>
> package BS::Actions::Provider;
> use Maypole::Application;
No no no ;)
like this:
package myapplication::some_class_in_the_application;
use base qw(Maypole::Model::CDBI::Plain Class::DBI);
sub methodname : Exported {
}
> ....
>
> BS::Actions::Provider dame_chicas_con_grande_culos() :Exported
> {
> ....
>
> }
>
> although this seemed somewhat strange to me, since is deviates from Perl's
> syntax, I did what any modern day naïve "Google Programmer" would do, and
> tried it; without having intimate knowledge of the underlying semantics
Of course the syntax is not correct - I'm not sure where you got it from.
You use it like :
sub packagename::methodname : Exported {
}
where Exported is the Attribute.
> my code is as follows:
>
> #!/usr/bin/perl
> use strict;
> use warnings;
> use BS::Web::Driver;
> BS::Web:: Driver ->run();
>
>
> my "driver":
>
> package BS::Web::Driver;
> use strict;
> use warnings;
> use base 'CGI::Maypole';
> use Maypole::Model::CDBI::Plain;
> use BS::Actions::Grrr;
>
> BS::Web::Driver->config->model("Maypole::Model::CDBI::Plain");
> BS::Web::Driver->setup([qw/BS::DB::Provider/]);
> BS::Web::Driver->config->uri_base("http://localhost/bs/bs.cgi");
> BS::Web:: Driver ->config->template_root("/home/dh/bs/templates");
> 1;
That looks reasonably ok. Presumably it compiles (if BS::Actions:Grr
has no syntax error)
> and my action:
>
> package BS::Actions::Grrr;
> use Maypole::Application;
You don't need to use Maypole::Application here. You use it in the
driver and knowhere else.
Instead you need :
use base qw(Maypole::Model::CDBI::Plain);
> sub tester :Exported {
> my ($class,$r) = @_;
> #get provider into and cats etc...
> }
>
> 1;
That bit's fine.
Hopefully that makes it clearer.
I'll add a worked example of how to do this to the documentation in
the next week.
Good Luck
A.
--
http://www.aarontrevena.co.uk
LAMP System Integration, Development and Hosting
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Maypole-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-users