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

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 19 2025 03:15:10
Script start
Timing: Jan 19 2025 03:15:10
Module start 'layout'
Timing: Jan 19 2025 03:15:10
Module start 'content'
Timing: Jan 19 2025 03:15:10
Module end 'content'
Timing: Jan 19 2025 03:15:10
Script end

Main resources:

Total runtime0.6981 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 589.2891152.6406
Module start 'layout' 0.00510.0030 741.929739.4766
Module start 'content' 0.00810.6885 781.4063422.6094
Module end 'content' 0.69660.0015 1,204.015612.1250
Script end 0.6981  1,216.1406 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.4335160.0002
Check MTime0.00130.1822160.0001
Mysql Total
Database connection0.00090.122610.0009
Mysqli_queries0.657294.1396460.0143
Looping result0.00040.0519440.0000
Template Total0.670996.120.3354
Template load0.00180.261020.0009
Template processing0.669095.831820.3345
Template load and register function0.00020.033210.0002
states
state_id_array0.00100.141310.0010
state_identifier_array0.00080.110020.0004
Override
Cache load0.00150.2148200.0001
Sytem overhead
Fetch class attribute can translate value0.00040.057110.0004
Fetch class attribute name0.00070.100010.0007
XML
Image XML parsing0.00010.013010.0001
class_abstraction
Instantiating content class attribute0.00000.000610.0000
General
dbfile0.00130.1903100.0001
String conversion0.00000.001240.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs