Forums / Developer / eZWizardBase

eZWizardBase

Author Message

Kristof Coomans

Wednesday 05 April 2006 4:29:19 am

Can somebody give me an example of the usage of eZWizardBase and eZWizardBaseClassLoader ( lib/ezutils/classes/ezwizardbase.php ) ?

eZWizardBase was introduced in eZ 3.5 but it seems that there's no single kernel module that uses it.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Richard Tuin

Thursday 06 April 2006 3:04:53 am

There are two wizards (using ezp 3.7.2) in the Admin -> Setup -> RAD section.

Template operator wizard
Datatype wizard

Maybe these wizards use the class you're after and find some sample code.

Kåre Køhler Høvik

Thursday 06 April 2006 5:27:01 am

Hi

The eZWizardBase was added due to requirements in customer projects. It was thought this would be used for the existing wizards in eZ publish as well, but this has not been done yet.

Kåre Høvik

Kristof Coomans

Thursday 06 April 2006 6:05:11 am

Thanks for your reply, Kåre. Can you give a little example or some documentation on how to use it? It could be a powerful base for some custom modules.

Am I correct in saying that each wizard step has to extend the eZWizardBase class and that I need to use the eZWizardBaseClassLoader in a custom module to load the current step from a given steparray?

Some thoughts about a piece of code in eZWizardBaseClassLoader::createClass:

        if ( isset( $stepArray['operation'] ) )
        {
            $operation = $stepArray['operation'];
            return $returnClass->$operation();
            eZDebug::writeNotice( 'Running : "' . $className . '->' . $operation . '()". Specified in StepArray',
                                  'eZWizardBaseClassLoader::createClass()' );
        }

The notice will never be written to the debug output. And why is the operation value not taken from $stepArray[$currentStep]['operation']? A steparray will currently look quite weird (at least to me):
$stepArray = array(
0 => array( 'file' => ..., 'class' => ... ),
1 => array( 'file' => ..., 'class' => ... ),
'operation' => ...
)

The comments for the eZWizardBase::preCheck function are stating that you can return false so the step doesn't get processed, but in eZWizardBase::run it's return value isn't used.

But probably I'm using it the wrong way, so any documentation is welcome. Thanks!

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Kristof Coomans

Friday 28 April 2006 1:25:51 am

I've just uploaded the User Creator extension ( http://ez.no/community/contribs/import_export/user_creator ) which uses eZWizardBase. I think it's a nice example.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Kåre Køhler Høvik

Monday 29 May 2006 8:34:35 am

Hi Kristof

I'm fixing the operation bug you pointed out now. The way it worked was kind of useless, as you pointed out. See: http://ez.no/bugs/view/8380

Kåre Høvik