I have yet to find out how extensible it is as I am busy prototyping my father-in-law's website. Maypole allows me to knock together a nice UI to manage the objects and quickly change the application schema via my mysql login and emacs to update the handful of LoC required to power it.
So far my only immediate questions are :
I am sure the later two are answered somewhere in the documentation, just thought I would mention that they are the first questions I would ask once I had a basic site up (which I now have).
I also got a mail from 'zengargoyle' about maypole - he would have replied to my post but lost his password and mailed me instead :
it looks like Maypole is still at 1.4 which i've been playing with
for a month or so.
the URL handling is a bit screwy, the examples have you give the base_url as http://somwhere/with/trailing/slash/ and it won't work without the last / but the templates aren't consistent and you'll end up with links that have '//' in them which is ugly.
whichever you choose CGI::Maypole or Apache::MVC for your driver, the parse_location function handles munging the URL. i think the regex might be a bit off and changed it to:
$self->{path} =~ s/^($loc\/*)?//;
and fixed up the templates to always put their own slashes.
[% base %] / [% table %] / [% action %]
in the Class::DBI::AsForm module there's some sort of bug that causes TEXT objects (in mysql database) to not have their current values set as default. if you edit a row with a TEXT object, the textarea comes up empty while varchar/int/etc have their current values.
i changed this in the to_field function which cleared up the problem and doesn't seem to break anything else...
#my $class = ref $self || $self;
my $class = $self;
for command line testing the Maypole::CLI docs are a bit off. this is my cli test script.
#!/usr/bin/perl
use lib './lib';
use Maypole::CLI qw( Sharpe ); # Sharpe is my app
@ARGV=( join('/', 'http://somewhere/path/to/sharpe', @ARGV) );
@r=Sharpe->handler;
print "$Maypole::CLI::buffer\n@r\n";
other than that, Maypole has worked out rather nicely. i'm about a month away from having my app all finished up and hope to contribute some patches then.
oh, i have a working FCGI::Maypole for mod_fastcgi if you dislike mod_perl and mod_cgi isn't fast enough.
oh, and you'll have to hack a bit if you want to send cookies from the CGI implementations. the Apache::MVC uses Apache::Request which has a place to set cookies to be sent back to the user. the CGI::Simple based CGI::Maypole doesn't (nor a way to send a redirect).
i just added an extra request variables and overrode the send_output funtion.
sub send_output {
my $r = shift;
if ( $r->{redirect} ) {
return print $r->{cgi}->redirect( $r->{redirect} );
}
my @cookies = values %{ $r->{cookies} };
push @headers, -cookies => [ @cookies ] if @cookies;
print $r->{cgi}->header(
-type => $r->{content_type},
-content_length => length $r->{output},
@headers,
);
print $r->{output};
}
cheers carl
feedback from carl (Score:2)
the beerdb.css is included in the latest CVS. there are some pointers on the wiki where to get a copy (or from the web cvs interface) or
$ wget http://dsl81-hayter.usc.edu/m
@JAPH = qw(Hacker Perl Another Just);
print reverse @JAPH;