NAME

OpenInteract2::Manage::Package::CreatePackageFromTable - Create a package with full CRUDS capability based on a database table

SYNOPSIS

#!/usr/bin/perl

use strict;
use OpenInteract2::Manage;

my $website_dir = '/home/httpd/mysite';
my %PARAMS = ( ... );
my $task = OpenInteract2::Manage->new( 'easy_app', \%PARAMS );
my @status = $task->execute;
foreach my $s ( @status ) {
    my $ok_label      = ( $s->{is_ok} eq 'yes' )
                          ? 'OK' : 'NOT OK';
    print "Status OK?  $s->{is_ok}\n",
          "$s->{message}\n";
}

DESCRIPTION

Most applications just interact with data in a database table, right? This task allows you to get a jump start on developing basic CRUDS capability -- CRUDS is CReate, Update, Delete and Search. Just point it at your database and table and it will create:

  • Action class and configuration with the methods 'search_form', 'search', 'display_add', 'add', 'display_form', 'update', 'display' and 'delete'.

  • SPOPS configuration necessary to map objects to your table.

  • Template Toolkit templates for a search form, search results form, data entry form and static display.

One thing we currently don't create is a SQL structure from your existing one -- patches welcome!

REQUIRED OPTIONS

package

name of package

package_dir

directory to create package subdirectory in; defaults to current directory

dsn

DBI DSN specifying a driver and any necessary database, host, port, etc. information. Whatever you use as the first argument in your DBI connect() call, use that here.

table

Name of the table you want to base your package on.

username

Username to connect to dsn.

password

Password for username to connect to dsn.

STATUS INFORMATION

We don't use any additional information in the returned status.

COPYRIGHT

Copyright (C) 2005 Chris Winters. All rights reserved.

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

AUTHORS

Chris Winters, <chris@cwinters.com>