Automating the creation of a new object after publishing

Author Message

Lo' F.

Thursday 21 July 2011 8:08:28 am

Hello everybody!

Here's what I need:

After publishing objects of a certain class, I need to automate the creation of a new object of a related [sub-]class.

In other words, currently, following the creation of an object of this class, I have to create another object under it which is bound up with its parent. This is something I do manually but it's not handy, so if after publishing the main object I could launch the creation of a new object of a specific class under its node that would be great.

How could I manage to accomplish that?

loredanaebook.it

Damien Pobel

Thursday 21 July 2011 1:14:12 pm

Hi,

To execute an action after an object is published you can write a after publish worflow event type or a content edit handler. For workflows, there's a nice tutorial on how to write a custom workflow event. For content edit handlers, the most relevant publication is probably this article from Ɓukasz.

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

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 30 2025 00:17:42
Script start
Timing: Jan 30 2025 00:17:42
Module start 'layout'
Timing: Jan 30 2025 00:17:42
Module start 'content'
Timing: Jan 30 2025 00:17:42
Module end 'content'
Timing: Jan 30 2025 00:17:42
Script end

Main resources:

Total runtime0.0152 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.0049 588.3906151.2422
Module start 'layout' 0.00490.0026 739.632836.7188
Module start 'content' 0.00740.0065 776.351690.3281
Module end 'content' 0.01400.0012 866.679729.9766
Script end 0.0152  896.6563 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002113.8002140.0001
Check MTime0.00106.3954140.0001
Mysql Total
Database connection0.00095.606910.0009
Mysqli_queries0.002415.805130.0008
Looping result0.00000.072110.0000
Template Total0.00096.010.0009
Template load0.00074.655510.0007
Template processing0.00021.327710.0002
Override
Cache load0.00042.906110.0004
General
dbfile0.002717.993380.0003
String conversion0.00000.037640.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