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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 19:08:43
Script start
Timing: Jan 18 2025 19:08:43
Module start 'layout'
Timing: Jan 18 2025 19:08:43
Module start 'content'
Timing: Jan 18 2025 19:08:43
Module end 'content'
Timing: Jan 18 2025 19:08:43
Script end

Main resources:

Total runtime0.0186 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 588.9219152.6094
Module start 'layout' 0.00720.0035 741.531339.3984
Module start 'content' 0.01070.0055 780.929797.4141
Module end 'content' 0.01620.0024 878.343838.3047
Script end 0.0186  916.6484 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.003015.9522140.0002
Check MTime0.00137.1301140.0001
Mysql Total
Database connection0.00073.882810.0007
Mysqli_queries0.003820.647130.0013
Looping result0.00000.139410.0000
Template Total0.001910.210.0019
Template load0.00115.869010.0011
Template processing0.00084.275510.0008
Override
Cache load0.00084.184710.0008
General
dbfile0.00031.550180.0000
String conversion0.00000.058840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs