wizard-procs.tcl

Wizard tool for the ArsDigita Templating System

Location:
packages/acs-templating/tcl/wizard-procs.tcl
Authors:
Karl Goldstein <karlg@arsdigita.com>
Jun Yamog
CVS Identification:
$Id: wizard-procs.tcl,v 1.23 2024/09/11 06:15:48 gustafn Exp $

Procedures in this file

Detailed information

template::wizard (public)

 template::wizard command [ args... ]

alias proc to call the real template::wizard::proc

Parameters:
command (required)
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

template::wizard::add (private)

 template::wizard::add step_id [ args... ]

Append a step to a wizard

Parameters:
step_id (required)
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 template::wizard::create template::wizard::create (public) template::wizard::add template::wizard::add template::wizard::create->template::wizard::add template::util::get_opts template::util::get_opts (public) template::wizard::add->template::util::get_opts template::wizard::get_forward_url template::wizard::get_forward_url (public) template::wizard::add->template::wizard::get_forward_url template::wizard::get_reference template::wizard::get_reference (private) template::wizard::add->template::wizard::get_reference

Testcases:
No testcase defined.

template::wizard::create (public)

 template::wizard::create [ args... ]

example:
    template::wizard create -action "wizard" -name my_wizard -params {
        my_param1 my_param2
    } -steps {
        1 -label "Step 1" -url "step1"
        2 -label "Step 2" -url "step2"
        3 -label "Step 3" -url "step3"
    }
    
  • action - the url where the wizard will always submit, normally is the same as your current wizard file. Has no effect for subwizards.
  • name - use to distinguish between the different wizards, since you can have 1 or more subwizard. "name" must be a bare Tcl word (no spaces etc.)
  • params - are used to keep values that you would like to pass on to the other steps
  • steps - are used to define what includes to use for each step of the wizard

See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 template::adp_level template::adp_level (public) template::util::get_opts template::util::get_opts (public) template::wizard::add template::wizard::add (private) template::wizard::get_wizards template::wizard::get_wizards (private) template::wizard::create template::wizard::create template::wizard::create->template::adp_level template::wizard::create->template::util::get_opts template::wizard::create->template::wizard::add template::wizard::create->template::wizard::get_wizards

Testcases:
No testcase defined.

template::wizard::current_step (private)

 template::wizard::current_step

convenience method to get the step for the http params or from the wizard step definition

See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 template::wizard::get_visited_step template::wizard::get_visited_step (public) template::wizard::current_step template::wizard::current_step template::wizard::get_visited_step->template::wizard::current_step template::wizard::submit template::wizard::submit (public) template::wizard::submit->template::wizard::current_step template::wizard::get_reference template::wizard::get_reference (private) template::wizard::current_step->template::wizard::get_reference

Testcases:
No testcase defined.

template::wizard::exists (public)

 template::wizard::exists
Returns:
1 if a wizard is currently defined
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

template::wizard::forward (public)

 template::wizard::forward

call when a step has been validated and completed. checks which submit button was pressed and proceeds accordingly.

See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 template::forward template::forward (public) template::wizard::get_forward_url template::wizard::get_forward_url (public) template::wizard::get_reference template::wizard::get_reference (private) template::wizard::forward template::wizard::forward template::wizard::forward->template::forward template::wizard::forward->template::wizard::get_forward_url template::wizard::forward->template::wizard::get_reference

Testcases:
No testcase defined.

template::wizard::get_action_url (public)

 template::wizard::get_action_url

Retrieve the URL to the action

See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 template::wizard::get_reference template::wizard::get_reference (private) template::wizard::get_action_url template::wizard::get_action_url template::wizard::get_action_url->template::wizard::get_reference

Testcases:
No testcase defined.

template::wizard::get_current_name (public)

 template::wizard::get_current_name

get the current wizard name

See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 template::wizard::get_reference template::wizard::get_reference (private) template::wizard::get_current_name template::wizard::get_current_name template::wizard::get_current_name->template::wizard::get_reference

Testcases:
No testcase defined.

template::wizard::get_current_step (public)

 template::wizard::get_current_step [ -start start ]

Set the step to display for this particular request This is determined by the wizard_step parameter. If not set, the first step is used.

Make sure that you call any "template::wizard set_param" if needed before calling get_current_step. get_current_step will redirect to the wizard -action properly setting all -params value and its other needed http state vars

The wizard will rewrite the url always. Only self submitting forms are preserved. Once the form is finished processing the wizard will take over and rewrite the url.

Switches:
-start (optional)
Optionally specify
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 template::forward template::forward (public) template::wizard::get_forward_url template::wizard::get_forward_url (public) template::wizard::get_reference template::wizard::get_reference (private) template::wizard::get_visited_step template::wizard::get_visited_step (public) template::wizard::get_current_step template::wizard::get_current_step template::wizard::get_current_step->template::forward template::wizard::get_current_step->template::wizard::get_forward_url template::wizard::get_current_step->template::wizard::get_reference template::wizard::get_current_step->template::wizard::get_visited_step

Testcases:
No testcase defined.

template::wizard::get_forward_url (public)

 template::wizard::get_forward_url step_id

Build the redirect URL for the next step

Parameters:
step_id (required)
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 template::wizard::add template::wizard::add (private) template::wizard::get_forward_url template::wizard::get_forward_url template::wizard::add->template::wizard::get_forward_url template::wizard::forward template::wizard::forward (public) template::wizard::forward->template::wizard::get_forward_url template::wizard::get_current_step template::wizard::get_current_step (public) template::wizard::get_current_step->template::wizard::get_forward_url template::adp_level template::adp_level (public) template::wizard::get_forward_url->template::adp_level template::wizard::get_reference template::wizard::get_reference (private) template::wizard::get_forward_url->template::wizard::get_reference

Testcases:
No testcase defined.

template::wizard::get_param (public)

 template::wizard::get_param name

Get a wizard's param value

"template::wizard get_param" has the advantage over ad_page_contract of getting the param value during the response time. What does this mean? It will properly get the current value of the param which was set by "template::wizard set_param", while ad_page_contract will not pick that up since it will get what is the request http var value. This is because "template::wizard get_param" gets the value from the Tcl var while ad_page_contract gets the value from the http var. So while processing in Tcl that value may change.

Parameters:
name (required)
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 template::wizard::get_visited_step template::wizard::get_visited_step (public) template::wizard::get_param template::wizard::get_param template::wizard::get_visited_step->template::wizard::get_param template::adp_level template::adp_level (public) template::wizard::get_param->template::adp_level

Testcases:
No testcase defined.

template::wizard::get_reference (private)

 template::wizard::get_reference

Get a reference to the wizard steps (internal helper)

See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 template::wizard::add template::wizard::add (private) template::wizard::get_reference template::wizard::get_reference template::wizard::add->template::wizard::get_reference template::wizard::current_step template::wizard::current_step (private) template::wizard::current_step->template::wizard::get_reference template::wizard::forward template::wizard::forward (public) template::wizard::forward->template::wizard::get_reference template::wizard::get_action_url template::wizard::get_action_url (public) template::wizard::get_action_url->template::wizard::get_reference template::wizard::get_current_name template::wizard::get_current_name (public) template::wizard::get_current_name->template::wizard::get_reference

Testcases:
No testcase defined.

template::wizard::get_visited_step (public)

 template::wizard::get_visited_step

get the last visited step

See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 template::wizard::get_current_step template::wizard::get_current_step (public) template::wizard::get_visited_step template::wizard::get_visited_step template::wizard::get_current_step->template::wizard::get_visited_step template::wizard::save_last_visited_step template::wizard::save_last_visited_step (public) template::wizard::save_last_visited_step->template::wizard::get_visited_step template::wizard::current_step template::wizard::current_step (private) template::wizard::get_visited_step->template::wizard::current_step template::wizard::get_param template::wizard::get_param (public) template::wizard::get_visited_step->template::wizard::get_param template::wizard::get_reference template::wizard::get_reference (private) template::wizard::get_visited_step->template::wizard::get_reference

Testcases:
No testcase defined.

template::wizard::get_wizards (private)

 template::wizard::get_wizards

we will get all the wizards that we have passed through

See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 template::wizard::create template::wizard::create (public) template::wizard::get_wizards template::wizard::get_wizards template::wizard::create->template::wizard::get_wizards template::wizard::get_wizards_levels template::wizard::get_wizards_levels (private) template::wizard::get_wizards->template::wizard::get_wizards_levels

Testcases:
No testcase defined.

template::wizard::get_wizards_levels (private)

 template::wizard::get_wizards_levels

internal helper proc to get the different levels of wizards from current to parent

See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 template::wizard::get_wizards template::wizard::get_wizards (private) template::wizard::get_wizards_levels template::wizard::get_wizards_levels template::wizard::get_wizards->template::wizard::get_wizards_levels template::wizard::submit template::wizard::submit (public) template::wizard::submit->template::wizard::get_wizards_levels

Testcases:
No testcase defined.

template::wizard::load_last_visited_step (public)

 template::wizard::load_last_visited_step -key key

loads the last visited step from the db

Switches:
-key (required)
unique identifier for a particular wizard normally the main object_id the wizard is manipulating use this step before get_current_step
Author:
Jun Yamog
Created:
june 2003
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 ad_get_client_property ad_get_client_property (public) template::wizard::get_reference template::wizard::get_reference (private) template::wizard::set_visited_step template::wizard::set_visited_step (public) template::wizard::load_last_visited_step template::wizard::load_last_visited_step template::wizard::load_last_visited_step->ad_get_client_property template::wizard::load_last_visited_step->template::wizard::get_reference template::wizard::load_last_visited_step->template::wizard::set_visited_step

Testcases:
No testcase defined.

template::wizard::save_last_visited_step (public)

 template::wizard::save_last_visited_step -key key

saves the last visisted step to the db

Switches:
-key (required)
unique identifier for a particular wizard normally the main object_id the wizard is manipulating use this step after get_current_step
Author:
Jun Yamog
Created:
june 2003
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 ad_set_client_property ad_set_client_property (public) template::wizard::get_reference template::wizard::get_reference (private) template::wizard::get_visited_step template::wizard::get_visited_step (public) template::wizard::save_last_visited_step template::wizard::save_last_visited_step template::wizard::save_last_visited_step->ad_set_client_property template::wizard::save_last_visited_step->template::wizard::get_reference template::wizard::save_last_visited_step->template::wizard::get_visited_step

Testcases:
No testcase defined.

template::wizard::set_finish_url (public)

 template::wizard::set_finish_url finish_url

Set the URL to be used for redirection, when the finish button is pressed.

Parameters:
finish_url (required)
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 template::wizard::get_reference template::wizard::get_reference (private) template::wizard::set_finish_url template::wizard::set_finish_url template::wizard::set_finish_url->template::wizard::get_reference

Testcases:
No testcase defined.

template::wizard::set_param (public)

 template::wizard::set_param name value

Set a wizard's param for passthrough

Normally you place this in the steps of the wizard where the form has been processed. A param is normally used when you want to reuse a value across the steps.

Note: if you are to use "template::wizard set_param" on a wizard file ex. (wizard.tcl). Make sure to do it before "template::wizard get_current_step". So when "template::wizard get_current_step" redirects it will properly set the correct values of the param to the new value.

Parameters:
name (required)
value (required)
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 template::wizard::set_visited_step template::wizard::set_visited_step (public) template::wizard::set_param template::wizard::set_param template::wizard::set_visited_step->template::wizard::set_param template::adp_level template::adp_level (public) template::wizard::set_param->template::adp_level

Testcases:
No testcase defined.

template::wizard::set_visited_step (public)

 template::wizard::set_visited_step step_id

set the last visited step

Parameters:
step_id (required)
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 template::wizard::load_last_visited_step template::wizard::load_last_visited_step (public) template::wizard::set_visited_step template::wizard::set_visited_step template::wizard::load_last_visited_step->template::wizard::set_visited_step template::wizard::get_reference template::wizard::get_reference (private) template::wizard::set_visited_step->template::wizard::get_reference template::wizard::set_param template::wizard::set_param (public) template::wizard::set_visited_step->template::wizard::set_param

Testcases:
No testcase defined.

template::wizard::submit (public)

 template::wizard::submit form_id [ args... ]

Add the appropriate buttons to the submit wizard Also create a list of all the buttons The optional -buttons parameter is a list of name-value pairs, in form {name label} {name label...} The valid button names are back, next, repeat, finish

Also writes the params to the form as hidden elements to keep the state of the wizard.

The following values are acceptable for the buttons: back, next and finish. Back buttons are not rendered if the step is the first step, like wise next buttons are not displayed if its the last step. Finish can appear on any step and will finish the current wizard even if not all steps are done.

Parameters:
form_id (required)
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 template::adp_level template::adp_level (public) template::element template::element (public) template::element::exists template::element::exists (public) template::util::get_opts template::util::get_opts (public) template::wizard::current_step template::wizard::current_step (private) template::wizard::submit template::wizard::submit template::wizard::submit->template::adp_level template::wizard::submit->template::element template::wizard::submit->template::element::exists template::wizard::submit->template::util::get_opts template::wizard::submit->template::wizard::current_step

Testcases:
No testcase defined.
[ show source ]