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

eZ debug

Timing: Jan 29 2025 13:30:34
Script start
Timing: Jan 29 2025 13:30:34
Module start 'content'
Timing: Jan 29 2025 13:30:34
Module end 'content'
Timing: Jan 29 2025 13:30:34
Script end

Main resources:

Total runtime0.1105 sec
Peak memory usage4,096.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 587.9531180.8281
Module start 'content' 0.00460.0060 768.781397.9141
Module end 'content' 0.01060.0998 866.6953526.0000
Script end 0.1104  1,392.6953 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00292.6245200.0001
Check MTime0.00121.0842200.0001
Mysql Total
Database connection0.00070.598110.0007
Mysqli_queries0.072765.78271410.0005
Looping result0.00080.73041390.0000
Template Total0.099590.110.0995
Template load0.00070.647910.0007
Template processing0.098889.428210.0988
Override
Cache load0.00050.417310.0005
Sytem overhead
Fetch class attribute can translate value0.00040.394610.0004
XML
Image XML parsing0.00020.206310.0002
General
dbfile0.00726.5174200.0004
String conversion0.00000.002630.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