[Maypole] plurals or class not found problems?

Kevin kevin-temp2@writesoon.com
Wed, 23 Jun 2004 01:00:09 -0700


I'm terribly excited about maypole, as I'd just been planning something  
similar based on automatic class definitions from databases when I  
discovered it was already done awhile ago (I love it when that happens).

Anyways, I'm having a frustrating time getting it working with anything  
besides the examples (I hate it when that happens).

Specifically, documentation is great until it's not detailed enough, like  
what the possible 'words' are for the class::dbi::loader::relationship  
strings.

I'm trying to override it with my own has_a relationships, but that seems  
to perhaps have problems with plurals?  As does the class definitions in  
general perhaps, as I'm not seeing the custom classes's exported methods  
at all either.

#apache conf#
<Location /ap> SetHandler perl-script
   PerlHandler Allpoetry
</Location>

#Allpoetry.pm (has_a detail only)
Allpoetry->config->{display_tables} = [qw[poets poems comments]];
Allpoetry->config->{template_root} = "/my/templates/root/";
Allpoetry->config->{uri_base} = "http://allpoetry.com/ap/";
Allpoetry->config->{rows_per_page} = 10;
Allpoetry->setup("dbi:mysql:allpoetry",user,pass);
Allpoetry::Poems->has_a(mid => Allpoetry::Poets);
Allpoetry::Comments->has_a(mid => Allpoetry::Poets);
Allpoetry::Comments->has_a(lid => Allpoetry::Poems);
Allpoetry::Poets->require;

#Allpoetry/Poets.pm#
package Allpoetry::Poets;
sub display_columns { ("name", "created", "legend", 'security',  
'points')   }
sub printit :Exported {
	$r->{output} = "Hello, world!";
}

requesting /ap/poet/printit gives:
file error - poetprintit: not found at  
/usr/lib/perl5/site_perl/5.6.1/Maypole/View/Base.pm line 66.

Additionally, trying to do /ap/poet/list causes the program to hit a loop  
sucking up memory and cpu until I kill the process (notgood :P).

Usually I would throw warn statements in the code in various places, but  
subclassing OO to do that gets frustrating (tradeoff with functionality it  
seems).  I should try running it outside the web environment with the  
command line, that's next.

I've upgraded to version 1.5, and am using perl 5.6.1 (old, I know), and  
Apache 1.3.27

Any suggestions?  I've tried to explain things as best I can, but let me  
know if anything needs clarification.

Thanks for your help,
Kevin
Allpoetry.com Community Manager
"Speak into the wind and listen to the response"