Share » Forums » Developer » eZContentOperationCollection vs...

eZContentOperationCollection vs content/updateobjectstate operation

eZContentOperationCollection vs content/updateobjectstate operation

Wednesday 29 June 2011 3:13:50 pm - 4 replies

Author Message

Damien Pobel

Thursday 30 June 2011 5:12:59 am

Hi Marko,

So there's a check if the content_updateobjectstate exists, and if ti doesn't then eZContentOperationCollection::updateObjectState() is used.

Why this amibguity? Why do we have the ability to use both ways and not only one?

It's not exactly a check against content_updateobjectstate existence but against wether the operation is activated or not in workflow.ini/[OperationSettings]/AvailableOperations

So both will do the job, but with the operation you can plug a workflow event type while without you can't.

This is done this way to avoid the performance penalty of always using the operation even if there's no workflow.

Cheers

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

Marko Žmak

Thursday 30 June 2011 5:27:25 am

This is done this way to avoid the performance penalty of always using the operation even if there's no workflow.

Any idea about how much is the penalty?

Is this pinciple, of avoiding using operations where there's no workflow, used consistently through the eZP code? Is it done like this in all parts where we can have/nothave operations and workflows?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Damien Pobel

Friday 01 July 2011 10:30:19 am

I'm not sure about the performance penalty...

But, yes this is done like this for all operations that were added in 4.2 or 4.3 (I don't remember which version) :

$ grep -RH 'eZOperationHandler::operationIsAvailable' *
extension/ezjscore/classes/ezjscserverfunctionsnode.php:        if ( eZOperationHandler::operationIsAvailable( 'content_updatepriority' ) )
kernel/content/view.php:if ( eZOperationHandler::operationIsAvailable( 'content_read' ) )
kernel/content/translation.php:        if ( eZOperationHandler::operationIsAvailable( 'content_updateinitiallanguage' ) )
kernel/content/translation.php:    if ( eZOperationHandler::operationIsAvailable( 'content_updatealwaysavailable' ) )
kernel/content/translation.php:        if ( eZOperationHandler::operationIsAvailable( 'content_removetranslation' ) )
kernel/content/state_edit.php:            if ( eZOperationHandler::operationIsAvailable( 'content_updateobjectstate' ) )
kernel/content/action.php:    if ( eZOperationHandler::operationIsAvailable( 'content_sort' ) )
kernel/content/action.php:        if ( eZOperationHandler::operationIsAvailable( 'content_move' ) )
kernel/content/action.php:    if ( eZOperationHandler::operationIsAvailable( 'content_swap' ) )
kernel/content/action.php:            if ( eZOperationHandler::operationIsAvailable( 'content_updatemainassignment' ) )
kernel/content/action.php:        if ( eZOperationHandler::operationIsAvailable( 'content_addlocation' ) )
kernel/content/action.php:        if ( eZOperationHandler::operationIsAvailable( 'content_removelocation' ) )
kernel/content/action.php:        if ( eZOperationHandler::operationIsAvailable( 'content_updatepriority' ) )
kernel/content/action.php:            if ( eZOperationHandler::operationIsAvailable( 'content_createnodefeed' ) )
kernel/content/action.php:            if ( eZOperationHandler::operationIsAvailable( 'content_removenodefeed' ) )
kernel/content/removeobject.php:    if ( eZOperationHandler::operationIsAvailable( 'content_delete' ) )
kernel/content/removeobject.php:        if ( eZOperationHandler::operationIsAvailable( 'content_removelocation' ) )
kernel/content/section_edit.php:                            if ( eZOperationHandler::operationIsAvailable( 'content_updatesection' ) )
kernel/content/hide.php:if ( eZOperationHandler::operationIsAvailable( 'content_hide' ) )
kernel/state/assign.php:    if ( eZOperationHandler::operationIsAvailable( 'content_updateobjectstate' ) )
kernel/user/preferences.php:if ( eZOperationHandler::operationIsAvailable( 'user_preferences' ) )
kernel/user/ezuseroperationcollection.php:            if ( eZOperationHandler::operationIsAvailable( 'user_activation' ) )
kernel/user/password.php:                if ( eZOperationHandler::operationIsAvailable( 'user_password' ) )
kernel/user/forgotpassword.php:        if ( eZOperationHandler::operationIsAvailable( 'user_password' ) )
kernel/user/forgotpassword.php:            if ( eZOperationHandler::operationIsAvailable( 'user_forgotpassword' ) )
kernel/user/activate.php:    if ( eZOperationHandler::operationIsAvailable( 'user_activation' ) )
kernel/user/setting.php:    if ( eZOperationHandler::operationIsAvailable( 'user_setsettings' ) )

Cheers

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

Marko Žmak

Saturday 02 July 2011 5:31:20 am

So I guess disabling some of the available operations for which I don't need workflows could bring some performance improvements...

I wonder how much improvement would bring and is it worth the work?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu