Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

TeeJay (2309)

  (email not shown publicly)

Working in Truro
Graduate with BSc (Hons) in Computer Systems and Networks
pm :,,
lug : Devon & Cornwall LUG
irc : TeeJay
skype : hashbangperl
livejournal : hashbangperl []
flickr :hashbangperl []

Journal of TeeJay (2309)

Friday June 18, 2004
10:32 AM

more on Maypole

[ #19353 ]
It rocks.

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 :

  • why no default css file included to go with the templates in the custom directory?
  • why no frontpage template in the factory directory - something like the apache default start page would be cool.
  • how do I change the order fields appear on the form?
  • How do I change dropdowns to use a field other than name or id?

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.

use lib './lib';

use Maypole::CLI qw( Sharpe );   # Sharpe is my app
@ARGV=( join('/', 'http://somewhere/path/to/sharpe',  @ARGV) );
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},

        print $r->{output};

cheers carl :)

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • * why no default css file included to go with the templates in the custom directory?

    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


    @JAPH = qw(Hacker Perl Another Just);
    print reverse @JAPH;