CAM::App - Web database application framework

LICENSE

Copyright 2005 Clotho Advanced Media, Inc., <cpan@clotho.com>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

ABOUT CLOTHO

"CAM" stands for Clotho Advanced Media Inc. (www.clotho.com) which developed this module. Contact us at cpan@clotho.com.

INSTALLATION

Install via one of the following:
perl Makefile.PL
make
make test
make install

or

perl Build.PL
perl Build
perl Build test
perl Build install

DESCRIPTION

This module implements a basic framework for building web database applications with the CAM libraries. It is designed to be subclassed (see SUBCLASSING below) by your software to provide web functionality with low overhead. It is intended for the usual Apache, Perl, MySQL, and Linux environment, but as little as possible is hardcoded for that idiom (or, when hardcoded, we try to make the pieces overrideable).

External libraries referenced:

Required
CGI CAM::Template Optional: (NOTE! Some of these have not yet been released to CPAN) CGI::Compress::Gzip DBI CAM::Session CAM::SQLManager CAM::SQLObject CAM::EmailTemplate CAM::EmailTemplate::SMTP CAM::Template::Cache

COMPARISON

The Perl module CAM::App most closely resembles is CGI::Application. It's main advantages over that module are:

It's main disadvantages vs. CGI::Application are:

And features which may or may not be advantages:

In general, CGI::Application is great for highly-structured web applications that are easily broken into use modes. CAM::App is good for apps that are much more free form, and just need a little help with organization.

SUBCLASSING

There are a few important steps for you to use this library.

  1. Although it's not strictly necessary, we HIGHLY recommend starting with a subclass. This can be as simple as creating a trivial file like this in, for example, "MyApp.pm":

    package MyApp; use CAM::App; our @ISA = qw(CAM::App); 1;

  2. Create a configuration file. We recommend starting with the SampleConfig.pm, but you can quite easily build your own from scratch.

    cp example/SampleConfig.pm MyConfig.pm edit MyConfig.pm

  3. Set up your CGI script to use MyApp and MyConfig. It should contain lines something like this.

    use lib qw(.); # or where ever you stored the new .pm file use MyApp; use MyConfig;

my $app = MyApp->new(config => MyConfig->new()); $app->authenticate() or $app->error("Login failed"); my $cgi = $app->getCGI();
...