Forums / Developer / zeta Components – eZ Publish interface

zeta Components – eZ Publish interface

Author Message

Phillip Casablancas

Monday 13 September 2010 5:32:21 am

Hi Guys,

is there any possibility to fetch Nodes from eZ publish in zeta Components?

for example, I have two folders. the first folder contains the eZ publish installation and the second folder contains a file that tries to fetch nodes from eZ publish.

André R.

Monday 13 September 2010 7:07:10 am

Loading a node depends of lots of things: settings / db / siteaccess / extensions..., so it's far easier to do it inside an eZ Publish module / extension :)

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Phillip Casablancas

Monday 13 September 2010 11:35:09 am

I know that it's far easier to do it, but is there any possibility to do it outside from ezpublish?

or any other way to fetch nodes from eZpublish inside eZcomponents..

Phillip Casablancas

Monday 13 September 2010 11:43:18 pm

Okay, i found a solution:

<?php

/* /var/www/ezpublish_test/test.php */

chdir( "/var/www/ezpublish-installation/" );
require 'autoload.php';
$node = eZContentObjectTreeNode::fetch( 1 );
var_dump( $node );
?>

André R.

Tuesday 14 September 2010 1:21:57 am

yes, if you keep all db settings in settings/override, that will work.

But any settings in siteaccesses or extensions will not.

For 4.4 you should be able to do something like this (only change from 4.3 is eZSiteAccess::change() instead of changeAccess() from access.php):

chdir( "/var/www/ezpublish-installation/" );
require 'autoload.php';
eZExtension::activateExtensions( 'default' );
$access = eZSiteAccess::change( array('name' => '<siteaccess-name>') );
eZExtension::activateExtensions( 'access' );
$node = eZContentObjectTreeNode::fetch( 1 );
var_dump( $node );

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom