Forums / Developer / Custom Edit Handler Publish function

Custom Edit Handler Publish function

Author Message

Jim Thaxton

Tuesday 29 December 2009 4:18:04 pm

I am creating a the custom edit handler for our site. I have the files in place and the new custom edit module available. When creating or saving an object in eZ, I can get to the FetchInput() function (I put a var_dump, exit or alternately an eZLog::write) but it never hits the publish functions.

After publish, I want to take the image(s) upload and perform some additional manipulation. I did this for another project in an earlier version of eZ and that code does not work exactly which leads me to believe I am missing something with the updates. Our site is on version 4.1.

Here is the code from my customedithandler.php function:

<?php
/* Custom edit handler for the Lux Goddess eZPublish Web site. On publish, new images and their aliases will be pushed to the cachefly cdn */
class customeditHandler extends eZContentObjectEditHandler{    function fetchInput( $http, &$module, &$class, $object, &$version, $contentObjectAttributes, $editVersion, $editLanguage, $fromLanguage  )    {          $logName = 'common.log';      $dir = 'var/log';      eZLog::write( 'fetchInput', $logName, $dir );

        }     static function storeActionList()    {        return array('publish');    }     function publish( $contentObjectID, $contentObjectVersion ) {          // fetch object      $logName = 'notice.log';      $dir = 'var/log';      eZLog::write( 'publish', $logName, $dir );            $object =& eZContentObject::fetch( $contentObjectID );
      var_dump($object);      // get content class object      $contentClass = $object->attribute('content_class');    } // publish}?><?php
/* Custom edit handler for the Lux Goddess eZPublish Web site. On publish, new images and their aliases will be pushed to the cachefly cdn */
class customeditHandler extends eZContentObjectEditHandler{    function fetchInput( $http, &$module, &$class, $object, &$version, $contentObjectAttributes, $editVersion, $editLanguage, $fromLanguage  )    {          $logName = 'common.log';      $dir = 'var/log';      eZLog::write( 'fetchInput', $logName, $dir );

        }     static function storeActionList()    {        return array('publish');    }     function publish( $contentObjectID, $contentObjectVersion ) {          // fetch object      $logName = 'notice.log';      $dir = 'var/log';      eZLog::write( 'publish', $logName, $dir );            $object =& eZContentObject::fetch( $contentObjectID );
      var_dump($object);      // get content class object      $contentClass = $object->attribute('content_class');    } // publish}?>

Web Developer
Coupon Cabin
Chicago, IL

Jim Thaxton

Tuesday 29 December 2009 6:47:58 pm

I realized my test return array('publish') should not be in the storeActionList() function. That should just have return array(); in it, I was curious if that would get content to the publish function but it did not.

Web Developer
Coupon Cabin
Chicago, IL

Jim Thaxton

Wednesday 30 December 2009 9:15:40 am

Sorry, sorted this one out. the Ez Environment I am working with has disabled the publishObjectExtensionHandler method so I need to find an alternate method to make my updates.

Thanks!

--Jim

Web Developer
Coupon Cabin
Chicago, IL

eZ debug

Timing: Jan 18 2025 00:01:00
Script start
Timing: Jan 18 2025 00:01:00
Module start 'content'
Timing: Jan 18 2025 00:01:00
Module end 'content'
Timing: Jan 18 2025 00:01:00
Script end

Main resources:

Total runtime0.7506 sec
Peak memory usage4,096.0000 KB
Database Queries192

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 588.8516180.8281
Module start 'content' 0.00480.6140 769.6797469.8828
Module end 'content' 0.61880.1317 1,239.5625333.6250
Script end 0.7505  1,573.1875 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.4962210.0002
Check MTime0.00150.1934210.0001
Mysql Total
Database connection0.00070.096710.0007
Mysqli_queries0.690591.99441920.0036
Looping result0.00190.25441900.0000
Template Total0.723596.420.3618
Template load0.00180.240120.0009
Template processing0.721796.160820.3609
Template load and register function0.00020.021310.0002
states
state_id_array0.00030.043010.0003
state_identifier_array0.00110.152120.0006
Override
Cache load0.00150.1955130.0001
Sytem overhead
Fetch class attribute can translate value0.00120.155620.0006
Fetch class attribute name0.00140.186730.0005
XML
Image XML parsing0.00040.053020.0002
class_abstraction
Instantiating content class attribute0.00000.000930.0000
General
dbfile0.00510.6737210.0002
String conversion0.00000.000630.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 9
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs