DbFramework is a collection of classes for manipulating Mysql databases. The classes are loosely based on the CDIF Data Model Subject Area. This module will help you to - Present data model objects (tables, columns) as HTML - Add persistency to your Perl objects - Manipulate your Mysql databases through an HTML forms interface See the POD for further details. paul@miraclefish.com Prerequisites ============= Alias CGI DBI Msql-Mysql-modules ePerl (for dbforms.cgi) Installation ============ 1) Ensure you have installed the prerequisites above. 2) perl Makefile.PL make make test (requires 2 Mysql databases: 'test, 'music') make install HTML forms application ---------------------- Read the 'DATA MODEL RULES' section in the DataModel man page for important information on how to create your database schema. Install forms/dbforms.cgi in a CGI directory. Call it with http://host/cgi_path/dbforms.cgi?db=foo where 'foo' is the name of a Mysql database. To do ===== * Tue Jan 12, 1999 BUG - dbforms.cgi/Persistent.pm can't update columns in the pk e.g. where an attribute in the pk is a fk FEATURE - 'subforms' FEATURE - arbitrary sql in templates * Fri Jan 8, 1999 BUG - >1 fk relating to the same pk table in a single table is not handled by dbforms.cgi * Fri Jan 1 23:40:32 GMT 1999 Select and modify pane column order sometimes don't match 4/1/1999 - User-defined templates specify attributes to be used for foreign keys - Allow relationships between the same table (in different roles). Needs documenting * Make Bundle::DbFramework * Schema grammar - might be better off using Jeeves (from the Panther book) - should handle relationships of degree >2 - could be CDIF compliant * Attributes of relationships should be stored so that full schema including attributes of relationships can be built from meta-data. * add support for UNIQUE columns (different to ordinary KEYs) * make primary key in grammar optional (1:1 relationships) * make relationships optional in grammar History ======= ------------------------------------------------------------------------------- RELEASE 1.06 = UI Default input templates now produce 'datasheet' view. = API Attribute:: - New method as_html_heading() Key:: - New method as_html_heading() PrimaryKey:: - New method as_html_heading() Table:: - New method as_html_heading() 6-1-1999 Paul Sharpe ------------------------------------------------------------------------------- RELEASE 1.05 = INTERFACE Table - New method dbh($dbh) (added pod for AUTOLOAD() method) = Improved form and template support - new() now takes list of forms rather than template definitions and evals configuration from config.pl files. - New method read_form() - More pod - Default output templates now handle foreign keys by replacing them with columns from the related table. - template tag can now contain a list of attributes to be substituted for values. dbforms.cgi - fills values from related table for foreign keys in default output template. - Now handles user-defined forms. 18-Dec-1998 Paul Sharpe ------------------------------------------------------------------------------- RELEASE 1.04 = INTERFACE ForeignKey - New method as_html_form_field(\%values) Table - as_html_form() now returns fields for foreign keys too. - fill_template() now creates selection boxes for tags. = dbforms.cgi New experimental UI separating search and modify. Catches and displays SQL errors. 11-Dec-1998 Paul Sharpe ------------------------------------------------------------------------------- RELEASE 1.03 - Bug fixes. 11-Dec-1998 Paul Sharpe ------------------------------------------------------------------------------- RELEASE 1.02 - dbforms.cgi HTML forms application - Bug fixes: Table::select(), Attribute::as_html_form_field() - INTERFACE *_h_byname() methods take an array rather than an arrayref Persistent - New method make_class() - New method fill_template() - New method as_html_form() - fill_template() now takes $name argument Table - New method in_foreign_key() - as_html_form() doesn't return
container so doesn't require $action argument. - New method in_key() - New method in_primary_key() - New method in_any_key() - New method non_key_attributes() - Removed method html_pk_select_field() - New attribute/methods HAS_FOREIGN_KEYS_H - fill_template() now supports placeholders. Key - New method belongs_to() - new() now takes a reference to a hash of templates. - fill_template() now takes a template name and reference to a hash of values. - templates() removed - New method set_templates() - New method bgcolor() Attribute - New method _input_template() - New method _output_template() - New method bgcolor() PrimaryKey - New method html_select_field() 26-Nov-1998 Paul Sharpe ------------------------------------------------------------------------------- RELEASE 1.01 (FIRST PUBLIC RELEASE)