The template root is the home of your application. So if the whole application is being handled by Maypole, then the template_root is the same as the document root. But if the Maypole application lives within a subdirectory of the website, then the template_root is the full path to that subdirectory. In your case, it'd be $DOCUMENT_ROOT/beerdb
The factory root is where Maypole looks if it doesn't find a template in the template_root, or a table-specific subdirectory. These are the templates that are provided in the distribution. I don't think they get installed anywhere during installation. You have to go into the build directory (somewhere in the .cpan directory) and fish them out and install them somewhere, say /usr/local/www/maypole. Or pull them out of the .tar.gz distribution file.
These undefined value errors look like you haven't inherited from MasonX::Maypole. Your BeerDB.pm needs to look a bit like this:
Now you can drop your own templates into $DOCUMENT_ROOT/beerdb, and they'll override those in /usr/local/www/maypole. And you can drop table-specific templates in $DOCUMENT_ROOT/beerdb/$table_moniker, and they'll override those in $DOCUMENT_ROOT/beerdb
Hmm. OK, you're right, there is a typo in the synopsis, and the comp_root call should be a nested arrayref:
Sorry about that. For the rest though, I'm still wondering if the paths are set up correctly. What is DocumentRoot set to in the Apache config? I'll go back and set up the BeerDB app here and see if it still works, my own app is a bit removed from that setup now.
Yep, the uninitialized masonx was a bug. I've just uploaded a new version (0.216) to CPAN. I've added a full BeerDB.pm example package (with real paths on a real server) and a corresponding VirtualHost Apache config. These are in the /doc directory of the distribution. Let me know if this helps.
OK. Don't set MasonCompRoot for a MasonX::Maypole app. MX::MP takes care of that. It sets the 'main' comp root to the template_root config setting. Your settings for this look OK:
There may be a gotcha with the factory root. In the distribution, you get
You need to copy the contents of lib/templates/factory to /Public/apache/maypole. In other words, the factory comp_root needs to point to the factory subdir of the supplied templates. Don't bother with the beerdb subdir by the way - it's just a single comp that I haven't ported from TT.
I'd noticed these warnings myself, but hadn't tracked them down yet. They're coming from somewhere deep in the Maypole/CDBI hierarchy, I'll try upgrading DBD::mysql as well. For the missing component, that was a bug in the frontpage template, it's fixed in 0.217. Looks like you're almost there!