Ron Savage > CGI-Application-Bouquet-Rose > cgi.app.gen.pl

Download:
CGI-Application-Bouquet-Rose-1.05.tgz

Annotate this POD

View/Report Bugs
Source  

NAME ^

cgi.app.gen.pl - Generate a set of CGI::Application- and CGI::Application::Dispatch-based classes

SYNOPSIS ^

cgiapp.pl [options]

        Options:
        -docroot The optional path to the web server's doc root
        -exclude An optional regexp of table names to exclude
        -help
        -module A mandatory module name, e.g. Local::Wine
        -output_dir The optional path to the output dir
        -remove
        -tmpl_path The optional path to CGI::Application::Bouquet::Rose's template directory
        -verbose

Exit value: 0.

Note: HTML::Template is used as the template processor.

Typical usage:

Download http://savage.net.au/Perl/Local-Wine-1.06.tgz

        shell> cd /home/yourself/perl.modules
        shell> tar xvzf Local-Wine-1.06.tgz
        shell> less README

or examine the documentation for CGI::Application::Bouquet::Rose.

OPTIONS ^

-docroot The optional path to the web server's doc root

The path to the web server's doc root.

If not specified, the value defaults to the value in lib/CGI/Application/Bouquet/Rose/.htcgi.bouquet.conf.

The option defaults to /var/www.

Several templates are copied to a directory below this point.

Specifically, if docroot is /var/www/html, say, then this directory is created: /var/www/html/assets/templates/, and then below that the value of -module (below) is converted into lower case and appended. So Local::Module would mean adding local/module/.

Finally, these template are copied into that directory:

content.tmpl
main.menu.tmpl
search.form.tmpl
web.page.tmpl

Lastly, the output file CGIApp.pm has a call to tmpl_path('/var/www/html/assets/templates/local/module') inserted into its code.

This allows for /var/www/html/assets/css/ and /var/www/html/assets/js/ at a later date.

This option is optional.

-exclude aRegExp

A regexp (without the //) of table names to exclude

If not specified, the value defaults to the value in lib/CGI/Application/Bouquet/Rose/.htcgi.bouquet.conf.

The default value is ^(?:pg_|sql_), which suits users of Postgres.

This option is optional.

-help

Print help and exit.

-module A module name, e.g. Local::Wine

Generate a set of modules under this name. So, Local::Wine would result in:

./lib/Local/Wine/CGIApp.pm
./lib/Local/Wine/Dispatcher.pm
./lib/Local/Wine/MainMenu.pm
./lib/Local/Wine/CGIApp/*.pm (1 per table)

This option defaults to 'Local::Wine', because the CGI::Application::Bouquet::Rose distro uses the Local::Wine distro in all its documentation. See examples/Local-Wine-1.06.tgz.

This option is mandatory.

-output_dir The optional path to the output dir

The path is where the output modules will be written.

If not specified, the value defaults to the value in lib/CGI/Application/Bouquet/Rose/.htcgi.bouquet.conf.

The option defaults to ./lib.

See the discussion of -module above for more information.

This option is optional.

-remove

Remove files generated by an earlier run of this program.

The default value is 0, meaning do not remove files.

This option is optional.

-tmpl_path aPath

The optional path to CGI::Application::Bouquet::Rose's template directory

If not specified, the value defaults to the value in lib/CGI/Application/Bouquet/Rose/.htcgi.bouquet.conf.

The option defaults to ./templates.

This option is optional.

-verbose

Print verbose messages.

If not specified, the value defaults to the value in lib/CGI/Application/Bouquet/Rose/.htcgi.bouquet.conf.

The default value is 0.

DESCRIPTION ^

cgi.app.gen.pl generates a set of CGI::Application- and CGI::Application::Dispatch-based classes.

syntax highlighting: