Forums / Extensions / Custom Fetch in a custom Extension

Custom Fetch in a custom Extension

Author Message

Joël LEGER

Wednesday 11 June 2008 8:46:14 am

Hi,

i followed the jacextension tutorial (http://ez.no/developer/articles/an_introduction_to_developing_ez_publish_extensions/template_fetch_function)
and the template operator works fine but not the template fetch function.
In the debug, i found out that eZ can't find the class "eZModul1FunctionCollection", so i was wondering if this solution with function_definition.php and ezmodul1functioncollection.php is not deprecated ?

arica chen

Wednesday 11 June 2008 8:26:08 pm


You may wish to try move the file "../jacextension\modules\modul1\ezmodul1functioncollection.php" to the directory "..\jacextension\classes".

Felix Woldt

Thursday 12 June 2008 1:31:56 am

Hi,

fine that you read my tutorial :-).

What ez version do you use.
The tutorial was written for ez 3.x and in ez 4 it is possible that you have to change some things.

if you use ez4 try to use the php script

php bin/php/ezpgenerateautoloads.php -e -v

to update the ezroot/autoloads/ezp_extension.php

http://www.jac-systeme.de - Developers united in eZ Publish: http://www.cjw-network.com

CJW Newsletter 1.0.0 released: http://projects.ez.no/cjw_newsletter

Felix Woldt

Thursday 12 June 2008 2:46:17 am

Hi,

i upgrade the source code of the tutorial.
I got the same problem, that the class could not be found.

You must update autoloads.php to solve the problem.

I will put the complete source code for ez4 of jacextension on projects.ez.no in the next days.

Felix

http://www.jac-systeme.de - Developers united in eZ Publish: http://www.cjw-network.com

CJW Newsletter 1.0.0 released: http://projects.ez.no/cjw_newsletter

Felix Woldt

Thursday 12 June 2008 3:57:00 am

I create a new project on projects.ez.no for all stuff related to jacextension
including sourcecode for ez 3.x and ez 4.x version.

http://projects.ez.no/jacextension

http://www.jac-systeme.de - Developers united in eZ Publish: http://www.cjw-network.com

CJW Newsletter 1.0.0 released: http://projects.ez.no/cjw_newsletter

Joël LEGER

Thursday 12 June 2008 5:39:34 am

yes it works better
thks

Radek Gasiorek

Friday 04 July 2008 7:37:50 am

First of all I would like to say Hello to whole EZ community thank you Felix for you helpfull article.

After working with some other cmss and developing a few in-house ones I've found EZ has all features (on developing, framework and conceptional level) I was thinking about but had never so many resources to support it at once. Now I know I would never to it with team of max 3 developers - anyway big respect to architecture designers of EZ.

Ok, now regarding to the article and exacly the problem mentioned above

I am using E 4.0 (ezcomponents installed as well). I have no access to ssh, php's 'system' methods are blocked (it is not possible to call php bin/php/ezpgenerateautoloads.php -e -v ).

'Regenerate autoloads array' button doesn't resolve the issue with not found eZModul1FunctionCollection Class for list method (there is still no class eZModul1FunctionCollection generated in autoload/ezp_extension.php).

The only thing I could do was a manual update of autoload/ezp_extension.php adding there 'eZModul1FunctionCollection' => 'extension/jacextension/modules/modul1/ezmodul1functioncollection.php' what finally solved “can't find eZModul1FunctionCollection class for method list” problem.

My question is: doesn't it violence integrity and modularity tests. other words: what happened if I export this module as a black-box package and install it on another EZ installation/server - will it be required to update manually autoloads/ezp_extension.php (assume server has no ssh and blocked system method)? If the answer is 'yes' it means it is not fully independent package. I would like to keep modularity for extensions - its very important for its reuse – that why I am asking about so 'trivial' thing. After all – probably I've lost something – I am new in EZ :)

PS: I did try to move ezmodul1functioncollection.php to classes subdirectory as well.

cheers all
r.

Framework - key to success

eZ debug

Timing: Jan 30 2025 00:46:04
Script start
Timing: Jan 30 2025 00:46:04
Module start 'content'
Timing: Jan 30 2025 00:46:04
Module end 'content'
Timing: Jan 30 2025 00:46:05
Script end

Main resources:

Total runtime0.2707 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 587.9531180.8281
Module start 'content' 0.00640.0052 768.7813102.0078
Module end 'content' 0.01160.2591 870.7891530.2969
Script end 0.2706  1,401.0859 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00341.2445200.0002
Check MTime0.00120.4530200.0001
Mysql Total
Database connection0.00060.236810.0006
Mysqli_queries0.226883.79091410.0016
Looping result0.00170.62671390.0000
Template Total0.258695.510.2586
Template load0.00080.309910.0008
Template processing0.257895.228410.2578
Override
Cache load0.00060.207610.0006
Sytem overhead
Fetch class attribute can translate value0.00080.277810.0008
XML
Image XML parsing0.00020.069510.0002
General
dbfile0.00431.5996200.0002
String conversion0.00000.001830.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.0001 secs