Creating a custom trigger

Creating a custom trigger

Wednesday 19 July 2006 11:05:40 am - 6 replies

Author Message

Kristof Coomans

Thursday 20 July 2006 1:58:06 am

Hello Dmytro

Use /kernel/content/operation_defenition.php instead of /kernel/classes/operation_defenition.php.

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

Dmytro Tomilovskiy

Thursday 20 July 2006 4:52:46 am

Greetings everyone.

I have noticed a couple of mistakes in my post:

1. operation_defenition.php is in kernel/content
2. the code that was added to operation_defenition.php is this

$OperationList['remove'] = array ( 'name' => 'remove', 
				     	     'default_call_method' => array('kernel/content/ezcontentoperationcollection.php', 
                                                                  'class' => 'eZContentOperationCollection'), 
                                   'parameter_type' => 'standard', 
                                   'parameters' => array( array( 'name' => 'object_id', 
                                                                 'type' => 'integer', 
                                                                 'required' => true) ), 
                                   'keys' => array('object_id'), 
                                   'body' => array( array( 'type' => 'trigger', 
                                                           'name' => 'pre_remove', 
                                                           'keys' => array('object_id','version') ) )
					 ); 

And one more thing. In removeobject.php the following line

$contentObjectID = $http->sessionVariable( 'ContentObjectID' );

Gives you something rather strange - %objectID'. Isnt it supposed to be smth like 157?

Thank you for your time.

Kristof Coomans

Tuesday 25 July 2006 10:10:50 am

 Isnt it supposed to be smth like 157?

Indeed it should be something like that. Strange.

I would recommend to move the code for the actual removal of the object to the operation as well (an entry of type "method" in the "body" array). An operation with only a trigger doesn't make much sense.

Which version of eZ publish are you using? Keep posting your code, then I can try to help you make it working.

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

Kristof Coomans

Tuesday 25 July 2006 10:13:07 am

I haven't tried this contribution myself but it could be a useful example: http://ez.no/community/contribs/hacks/content_remove_workflow

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

nehal shah

Thursday 28 October 2010 6:36:56 am

Hi

I want to create new custom trigger.

So i want to know how can i view my trigger in the trigger list?

In which file i have to make changes, and please give me sample code of any custom trigger if possible.

Thank you

nehal shah

Thursday 28 October 2010 11:03:32 pm

Hi

Take a look at the question asked by Dmytro Tomiloyskiy, for craeting custom trigger he added code in to the kernel/content/operation_definition.php.

But my question is that how would he know that to go only that particular php file for add trigger,i cant understand where this would define, or how developer would know that he/she has to go with this specific file only?

Thank you

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

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