Forums / Developer / custom action and collected informations

custom action and collected informations

Author Message

sergio da silva

Monday 12 January 2009 2:53:21 am

Hello,

i created a custom action for a form which works:

In "<b>extension\ezdoubleposting\settings\content.ini.append.php</b>", i have:

<?php /*

[ActionSettings]
ExtensionDirectories[]=ezdoubleposting
*/ ?>

and in "<b>extension\ezdoubleposting\actions\content_actionhandler.php</b>", i have:

<?php
include_once( 'lib/ezutils/classes/ezoperationhandler.php' );

function ezdoubleposting_ContentActionHandler( &$module, &$http, &$objectID ) 
{ 
   if( $http->hasPostVariable("CustomAction") ) 
   { 
     // code for a doubleposting
     .
     .
     .
     //code for the informations collection
     return $module->run( "collectinformation", array() );
   } 
} ?>

The doubleposting is working but now, i would like to do the doubleposting <b>and</b> to collect informations into EZPublish and i don't manage to do the last one.

I tried to create a module:

"<b>extension\ezdoubleposting\modules\ezdoubleposting\module.php</b>"

<?php
$Module = array( 'name' => 'ezdoubleposting' );

$ViewList = array();

$ViewList['collectinformation'] = array(
    'functions' => array( 'read' ),
    'default_navigation_part' => 'ezcontentnavigationpart',
    'script' => 'collectinformation.php',
    'single_post_actions' => array( 'CustomAction' => 'CollectInformation' ),
    'post_action_parameters' => array( 'CollectInformation' => array( 'ContentObjectID' => 'ContentObjectID',
                                                                      'ContentNodeID' => 'ContentNodeID',
                                                                      'ViewMode' => 'ViewMode' ) ),
    'params' => array(  ) );?>

And in "<b>extension\ezdoubleposting\modules\collectinformation.php</b>", i put exactly the same code as in the "kernel\content\collectinformation.php" file:

<?php
//
// Created on: <21-Nov-2002 18:27:06 bf>
//
// SOFTWARE NAME: eZ Publish
// SOFTWARE RELEASE: 4.0.1
// BUILD VERSION: 22260
// COPYRIGHT NOTICE: Copyright (C) 1999-2008 eZ Systems AS
// SOFTWARE LICENSE: GNU General Public License v2.0
// NOTICE: >
//   This program is free software; you can redistribute it and/or
//   modify it under the terms of version 2.0  of the GNU General
//   Public License as published by the Free Software Foundation.
//
//   This program is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//   GNU General Public License for more details.
//
//   You should have received a copy of version 2.0 of the GNU General
//   Public License along with this program; if not, write to the Free
//   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
//   MA 02110-1301, USA.
//
//

//include_once( 'kernel/classes/ezinformationcollection.php' );
//include_once( 'kernel/classes/datatypes/ezuser/ezuser.php' );
//include_once( "lib/ezdb/classes/ezdb.php" );
//include_once( 'lib/ezutils/classes/ezmail.php' );
//include_once( 'lib/ezutils/classes/ezmailtransport.php' );
require_once( 'kernel/common/template.php' );

$Module = $Params['Module'];
$http = eZHTTPTool::instance();

if ( $Module->isCurrentAction( 'CollectInformation' ) )
{
    $ObjectID = $Module->actionParameter( 'ContentObjectID' );
    .
    .
    .
    return eZModule::HOOK_STATUS_CANCEL_RUN;
}

?>

And i add in the "<b>extension\ezdoubleposting\settings\content.ini.append.php</b>" file

[ModuleSettings]
ExtensionRepositories[]=ezdoubleposting

And it doesn't work :( (the doubleposting works but not the informations collector)

Someone already tried to do that?? I need help, please

Thank you

eZ debug

Timing: Jan 30 2025 21:44:36
Script start
Timing: Jan 30 2025 21:44:36
Module start 'content'
Timing: Jan 30 2025 21:44:36
Module end 'content'
Timing: Jan 30 2025 21:44:36
Script end

Main resources:

Total runtime0.2446 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0078 588.0625370.2734
Module start 'content' 0.00780.0131 958.33591,001.5000
Module end 'content' 0.02080.2237 1,959.83593,897.0391
Script end 0.2446  5,856.8750 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00461.8792200.0002
Check MTime0.00130.5293200.0001
Mysql Total
Database connection0.00060.261610.0006
Mysqli_queries0.144459.01151410.0010
Looping result0.00210.83801390.0000
Template Total0.223391.310.2233
Template load0.00090.358410.0009
Template processing0.222490.909110.2224
Override
Cache load0.00060.244010.0006
Sytem overhead
Fetch class attribute can translate value0.00180.753310.0018
XML
Image XML parsing0.00030.134110.0003
General
dbfile0.00522.1141200.0003
String conversion0.00000.002430.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.0003 secs