NAME

CGI::Ex::Recipes - A usage example for CGI::Ex::App!

VERSION

Version 0.01

SYNOPSIS

You may find in index.cgi the following:

use CGI::Ex::Recipes;
CGI::Ex::Recipes->new({
    conf_file => './conf/Recipes.conf',
})->navigate;
...

DESCRIPTION

This small but relatively complete application was inspired by the examples given by Paul in his documentation. I decided to go further and experiment with the recomendations and features which the framework provides. You are encouraged to play with it and use it as a starting point for far more complex and customized applications.

REQUIREMENTS

CGI::Ex
DBI
DBD::SQLite
SQL::Abstract
YAML

INSTALL

1. CPAN
    
2. svn checkout https://bcc.svn.sourceforge.net:443/svnroot/bcc/trunk/recipes
into some viewable by the server dir with option AllowOverride All

MOD_PERL

See in the distribution index.pl and perl/bin/startup.pl. Modify these files to meet your needs. More to write...

METHODS

Below are mentioned only methods which are overridden or not provided by CGI::Ex::App. Some of them or their modified variants, or parts of them will probably find their way up to the base module. Some of them did it already. This way they will become obsolete, but that is the point.

Others will stay here since they provide some specific for the application functionality. Writing more specific methods will meen you make your own application, reflecting your own buziness logic. This is good, because CGI::Ex::Recipes has done his job, by providing a codebase and starting point for you.

You are wellcome to give feedback if you think some functionality is enough common to go up straight to CGI::Ex::App.

Bellow are described overriten methods and methods defined in this package.

load_conf

Returns the value of $self->{load_conf} or 1(TRUE) by default.

pre_step

Returns 0 after executing $self->step_args().

allow_morph

Blindly returns the current value of allow_morph key in Recipes.conf, which should be interpreted as TRUE or FALSE.

path_info_map

This is just our example implementation, following recomendations in CGI::Ex::App.

skip

Ran at the beginning of the loop before prepare, info_complete, and finalize are called. If it returns true, nav_loop moves on to the next step (the current step is skipped).

In our case we bind it to the presence of the id parameter from the HTTP request. So if there is an id parameter it returns 0 otherwise 1.

get_pass_by_user

Returns the password for the given user. See the get_pass_by_user method of CGI::Ex::Auth for more information. Installed as a hook to the authentication object during the get_valid_auth method.

We get the password from the configuration file, which is enough for this demo, but you can do and SQL query for that purpose if you store your users' info in the database.

require_auth

Returns 0 or 1 depending on configuration for individual steps. This way we make only some steps to require authentication.

auth_args

Get authentication arguments from configuration if there is such and returns a hashref. The template_args are merged in also.

hash_base

post_navigate

UTILITY METHODS

These may go in another module - created specifically for this purpose. And ofcource there are plenty of modules providing beter implementation.

strftmime

now

AUTHOR

Красимир Беров, <k.berov at gmail.com>

BUGS

Probably many.

Please report any bugs or feature requests to k.berov@gmail.com by putting "CGI::Ex::Recipes" in the Subject line

ACKNOWLEDGEMENTS

Larry Wall - for Perl

Paul Seamons - for all his modules and especially for CGI::Ex didtro

Anyone wich published anything on CPAN

COPYRIGHT & LICENSE

Copyright 2007 Красимир Беров, all rights reserved.

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

1 POD Error

The following errors were encountered while parsing the POD:

Around line 306:

Non-ASCII character seen before =encoding in 'Красимир'. Assuming UTF-8