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