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

eZ debug

Timing: Jan 31 2025 08:20:47
Script start
Timing: Jan 31 2025 08:20:47
Module start 'content'
Timing: Jan 31 2025 08:20:47
Module end 'content'
Timing: Jan 31 2025 08:20:47
Script end

Main resources:

Total runtime0.2810 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 587.7578180.8516
Module start 'content' 0.00720.0061 768.6094101.9375
Module end 'content' 0.01330.2676 870.5469529.8359
Script end 0.2809  1,400.3828 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00301.0693200.0002
Check MTime0.00120.4357200.0001
Mysql Total
Database connection0.00080.272610.0008
Mysqli_queries0.235783.87721410.0017
Looping result0.00120.44331390.0000
Template Total0.267395.110.2673
Template load0.00070.264810.0007
Template processing0.266594.847310.2665
Override
Cache load0.00050.179810.0005
Sytem overhead
Fetch class attribute can translate value0.00090.305010.0009
XML
Image XML parsing0.00020.088210.0002
General
dbfile0.00652.3064200.0003
String conversion0.00000.001730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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