| Config::Model::WizardHelper - Helps to create wizard widget for config models |
Config::Model::WizardHelper - Helps to create wizard widget for config models
use Config::Model ;
my $inst = $model -> instance ( root_class_name => 'Master', instance_name => 'test1');
my $root = $inst -> config_root ;
my $wizard = $inst -> wizard_helper ( leaf_cb => sub { ... }, hash_element_cb => sub { ... } ); $wizard->start ;
This module provides a class that is able to scan a configuration tree and will call back user defined subroutines on one of the following condition:
A configuration item contains an error (mostly undefined mandatory values)
A configuration item has a important level. See
level parameter
for details.
By default, the wizard will only scan element with an intermediate
permission.
The wizard helper supports going forward and backward during the scan
(to support back and next buttons on a wizard widget).
The constructor should be used only by the Config::Model::Instance manpage with the wizard_helper method.
A wizard helper will need at least two kind of call-back that must be provided by the user: a call-back for leaf elements and a call-back for hash elements (which will be also used for list elements).
These call-back must be passed when creating the wizard object (the
parameters are named leaf_cb and hash_element_cb)
Here are the the parameters accepted by wizard_helper:
Whether to call back when an important element is found (default 1).
Specifies the permission of the element scanned by the wizard (default 'intermediate').
Subroutine called backed for leaf elements. See Callback prototypes in the Config::Model::ObjTreeScanner manpage for signature and details. (mandatory)
Subroutine called backed for hash elements. See Callback prototypes in the Config::Model::ObjTreeScanner manpage for signature and details. (mandatory)
By default, leaf_cb will be called for all types of leaf elements
(i.e enum. integer, strings, ...). But you can provide dedicated
call-back for each type of leaf:
enum_value_cb, integer_value_cb, number_value_cb, boolean_value_cb, uniline_value_cb, string_value_cb
Likewise, you can also provide a call-back dedicated to list elements with
list_element_cb
Start the scan and perform call-back when needed. This function will return when the scan is completely done.
Set wizard in forward (default) mode.
Set wizard in backward mode.
Dominique Dumont, (ddumont at cpan dot org)
the Config::Model manpage, the Config::Model::Instance manpage, the Config::Model::Node manpage, the Config::Model::HashId manpage, the Config::Model::ListId manpage, the Config::Model::Value manpage, the Config::Model::CheckList manpage, the Config::Model::ObjTreeScanner manpage,
| Config::Model::WizardHelper - Helps to create wizard widget for config models |