The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Wizard - A framework for building wizard-style applications.

SYNOPSIS

  # Create a new Wizard
  use Wizard ();
  my $wiz = Wizard->new(%attr);

  # Let the wizard create a form
  my $form = $wiz->Form(%attr);

  # Start the wizard, by running the form
  $wiz->Run($form);

DESCRIPTION

The Wizard package enables you to create simple input forms in the style of Windows wizards and combine them into a complete application, typically for system administration. The users input form is handled in a single sub, the so-called action. Any action consists of 3 phases:

1.)

Processing the input data.

2.)

Saving the input data.

3.)

Returning data describing the next input form.

You typically only need to setup the actions, the Wizard system should do anything else for you.

The framework is based on the wizard object. Different wizard classes are available, for example Form::Wiz::Shell for running the wizard within a shell or Form::Wiz::HTML for running within a web browser. See also Wizard::Shell(3) and Wizard::HTML(3)

CLASS INTERFACE

In all cases errors are handled by throwing Perl exceptions, thus we won't talk about errors at all in what follows.

Creating a wizard

  my $wiz = Wizard->new(\%attr);

(Class method) The new method will create a wizard object for you. It receives a hash ref of attributes as arguments. Currently known attributes are:

formClass

The wizards form class. For example, the Wizard::Shell class will have Wizard::Form::Shell as form class. Wizard::Form(3).

Working with input forms

  # Create a new form
  my $form = $wiz->Form(%attr);

  # Fetch the current form
  $form = $wiz->Form();

(Instance methods) The Form method will create a new form for you. The form is an instance of the wizards formClass, see above. There's always a single form associated to the wizard: The previous form is removed by creating the next one. The action returns a list of input elements that will be used for creating the next form. Wizard::Elem(3).

Running the wizard

  $form = $wiz->Run($data);

(Instance method) This method is running a single action. The action will read input from $data (typically a CGI or Apache::Request object) by calling its param method. The action returns a list of form elements that will be used for creating the next form. This form will be methods return value.

AUTHORS AND COPYRIGHT

This module is

  Copyright (C) 1999     Jochen Wiedmann
                         Am Eisteich 9
                         72555 Metzingen
                         Germany

                         Email: joe@ispsoft.de
                         Phone: +49 7123 14887

                 and     Amarendran R. Subramanian
                         Grundstr. 32
                         72810 Gomaringen
                         Germany

                         Email: amar@ispsoft.de
                         Phone: +49 7072 920696

All Rights Reserved.

You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.