CleanCode Perl Libraries

CGI enhancements for input validation, page generation, and page sequencing (website navigation).

CGI::* Summary
Handy Provides assorted data manipulation functions.
PageGenerator Dynamic web-page generator.
PageSequencer Creates navigation between static or dynamic web pages.
PageValidator Top-level object for validating data.

There are three basic building blocks which may be used separately or in combination. Here's a brief description of how to combine them:

To create a web page based on data libraries, start with a template HTML file which defines the static portion of your web page and provides place holders for the dynamic portions. See CGI::PageGenerator for more.

Next, create a sequencer configuration file, which specifies the layout of the fields on each web page, how the pages connect to each other, and which template file to use. See CGI::PageSequencer for more.

For each field you've specified in the sequencer file, there must be a corresponding definition in one of the data library files, used both for field generation and for field validation. See CGI::PageValidator for more.

If you wish to include automatic client-side form validation for your web page, you need to include a place-holder in your template file, indicate which buttons on each web page invoke validation in your sequence file, and provide proper constraints (and possibly code plugins) in your data library files. For server-side validation, you must instrument your code to invoke the validation engine--the same engine as used on the client-side!

With all those pieces in place, you can generate an on-the-fly web page from the command-line, or as output handed back to a client from a web server. See the sample program for how to instrument your code just to use the validator, or for how to generate a page with validation.

Since: CleanCode 0.9

CleanCode Perl Libraries Copyright © 2001-2013 Michael Sorens - Revised 2013.06.30 Get CleanCode at Fast, secure and Free Open Source software downloads