Hello.

This is a very basic demonstration of Class::DBI::Factory. There's not much to it, but it is a bit more complicated than its rather limited goals require, the better to suggest how one might build a more complex application with CDF.

The demo requires Class::DBI::Factory and the Template Toolkit. Everything else should be installed for you during the installation of those two, including the right version of DBD::SQLite. 

It also requires a working Apache/mod_perl setup, with libapreq installed. In theory you should be able to work equally well with Apache 2, but I've only been able to make it work with 2.0.53, mod_perl rc4 and a libapreq svn snapshot. The API changes to mod_perl between rc4 and rc5 mean that it's unlikely to work out of the box with later versions, and as I write this I am completely unable to work out what's going on with libapreq. Stick with 1.3.x and mod_perl 1.29 for now.

The install script in this directory is normally run automagically during the installation of Class::DBI::Factory. If you want to run it by itself, the usage is:

	./install.pl [-v | -h] path [url] [port]

It will attempt to create that path if it doesn't exist, and bail out if it does exist and can't be used. Once installation is complete, the script will tell you what to do next.

To find out more about what's going on, cd to the installation directory and examine the files. The database is built during installation in a ./data subdir, but it's very normal, so we'll ignore that. There are four other active ingredients:

* data classes in ./lib/My

There's not much interesting in here either: very ordinary CDBI subclasses.

* templates in ./templates

These are more complicated than they need to be, mostly in order to show how to use the factory's relationships() method to automate display. The master template is _holder.html: it just brings in some page furniture and chooses a view. This isn't a very complicated application.

* request handler in ./lib/My/Handler.pm
  
This is a subclass of Class::DBI::Factory::Handler meant to show how it would normally be overridden. It's not really necessary here, but a more complex application would need it, probably along with a My::Factory and probably a My::Config too, though they might only contain a couple of methods each.

* configuration files in ./conf

./conf/site.conf contains a virtualhost definition ready to be Included in your Apache configuration. ./conf/cdf.conf is the main configuration file for the demo application. It shows the bare minimum required for a working system: class declarations, database access and a handful of display parameters.

If anything is unclear, you have any suggestions or you just want to explain how wrong-headed this is, please write to wrross@cpan.org. For proper bugs in Class::DBI::Factory and its offspring, please use http://rt.cpan.org.

William Ross
17 April 2005
