NAME

CGI::WPM::Base - Demo of CGI::Portable that is subclassed by 7 other demos.

DEPENDENCIES

Perl Version

5.004

Standard Modules

I<none>

Nonstandard Modules

CGI::Portable 0.42

SYNOPSIS

What are the subclasses of this:

CGI::WPM::GuestBook, CGI::WPM::MailForm, CGI::WPM::MultiPage, CGI::WPM::Redirect, CGI::WPM::SegTextDoc, CGI::WPM::Static, and CGI::WPM::Usage.

How you pass extra Globals-type info to subclasses of this that need it:

# Note that $globals is an CGI::Portable object.
# Code like this goes in your startup shell.

$globals->default_application_title( 'Aardvark On The Range' );
$globals->default_maintainer_name( 'Tony Simons' );
$globals->default_maintainer_email_address( 'tony@aardvark.net' );
$globals->default_maintainer_email_screen_url_path( '/contact/us' );
$globals->default_smtp_server( 'mail.aardvark.net' );  # defa to 'localhost'
$globals->default_smtp_timeout( 30 );  # that's also the default

# And below that you can call_component() on subclasses.
# The above global-type settings complement the "preferences" below and 
# in the subclasses, but for these mods they don't live in the preferences.

DESCRIPTION

This Perl 5 object class is part of a demonstration of CGI::Portable in use. It is one of a set of "application components" that takes its settings and user input through CGI::Portable and uses that class to send its user output. This demo module set can be used together to implement a web site complete with static html pages, e-mail forms, guest books, segmented text document display, usage tracking, and url-forwarding. Of course, true to the intent of CGI::Portable, each of the modules in this demo set can be used independantly of the others.

SYNTAX

This class does not export any functions or methods, so you need to call them using object notation. This means using Class->function() for functions and $object->method() for methods. If you are inheriting this class for your own modules, then that often means something like $self->method().

PUBLIC FUNCTIONS AND METHODS

main( GLOBALS )

You invoke this method to run the application component that is encapsulated by this class. The required argument GLOBALS is an CGI::Portable object that you have previously configured to hold the instance settings and user input for this class. When this method returns then the encapsulated application will have finished and you can get its user output from the CGI::Portable object.

PREFERENCES HANDLED BY THIS MODULE

This POD is coming when I get the time to write it.

All of the properties below can be used with any subclass of Base, but are not mentioned separately in any of those modules.

Most of the preferences below correspond directly to CGI::Portable output properties. Any properties that are already defined by the subclass of this class have higher precedence and if they are set then the properties below are not applied; these properties are applied if the subclass does not set them.

page_body, on the other hand, has high precedence. If it is set then the subclass is never called at all; useful for when you want static html content that is defined in your preferences.

page_header and page_footer and page_replace are always used since they don't replace the existing html body but add to it or search and replace in it.

amend_msg doesn't apply to any of the above rules.

amend_msg  # personalized html appears on error page instead of default msg

http_target   # window target that our output goes in

page_body    # if defined, no subclass is used and this literal used instead

page_header  # content goes above our subclass's
page_footer  # content goes below our subclass's
page_title   # title for this document
page_author  # author for this document
page_meta    # meta tags for this document
page_css_src   # stylesheet urls to link in
page_css_code  # css code to embed in head
page_body_attr # params to put in <BODY>
page_replace   # search and replacements to perform

METHOD TO OVERRIDE BY SUBCLASSES

main_dispatch() -- their version of main(), which is handled in Base

PRIVATE METHODS FOR USE BY SUBCLASSES

This POD is coming when I get the time to write it.

_get_amendment_message()

AUTHOR

Copyright (c) 1999-2001, Darren R. Duncan. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. However, I do request that this copyright information remain attached to the file. If you modify this module and redistribute a changed version then please attach a note listing the modifications.

I am always interested in knowing how my work helps others, so if you put this module to use in any of your own code then please send me the URL. Also, if you make modifications to the module because it doesn't work the way you need, please send me a copy so that I can roll desirable changes into the main release.

Address comments, suggestions, and bug reports to perl@DarrenDuncan.net.

SEE ALSO

perl(1), CGI::Portable, CGI::WPM::GuestBook, CGI::WPM::MailForm, CGI::WPM::MultiPage, CGI::WPM::Redirect, CGI::WPM::SegTextDoc, CGI::WPM::Static, and CGI::WPM::Usage, CGI::Portable::AdapterCGI.