export node content in HTML

Author Message

Michal Slocinski

Friday 11 April 2008 3:03:46 pm

Hi

I'd like to implement some script (running from CLI) that would get node ID as input parameter, apply template and give back output in HTML format.

I did some work already but one thing I can't figure out is how to apply some template to XML fetched from DB in order to get HTML back.

Can you point me into some direction of eZ publish API that will allow for that or some short example?

regards,

Michal

Łukasz Serwatka

Saturday 12 April 2008 1:34:44 am

Hi Michał,

You may find this useful:

http://serwatka.net/blog/ezxmltext_how_to_store_and_ouput_your_content
http://serwatka.net/blog/fetching_ez_publish_content_objects_with_php
http://serwatka.net/blog/ez_publish_content_object_attributes_output_rendering

Note that that examples are for PHP4, so you need to take care about the references mostly while working with PHP5.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Michal Slocinski

Saturday 12 April 2008 3:17:24 am

Thank you for input - it's very valuable for my future experiments and understanding eZ publish APIs.

In the mean time, reviewed 'kernel/content/view.php' and came up with this:

$data = eZNodeviewfunctions::contentViewGenerate( false, $args );

which pretty much does all I need.

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 18 2025 16:05:41
Script start
Timing: Jan 18 2025 16:05:41
Module start 'layout'
Timing: Jan 18 2025 16:05:41
Module start 'content'
Timing: Jan 18 2025 16:05:42
Module end 'content'
Timing: Jan 18 2025 16:05:42
Script end

Main resources:

Total runtime0.9511 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0068 589.0234152.6250
Module start 'layout' 0.00680.0034 741.648439.4453
Module start 'content' 0.01020.9395 781.0938535.6953
Module end 'content' 0.94970.0014 1,316.78918.1641
Script end 0.9511  1,324.9531 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.3530160.0002
Check MTime0.00140.1461160.0001
Mysql Total
Database connection0.00060.066210.0006
Mysqli_queries0.898094.4144570.0158
Looping result0.00070.0699550.0000
Template Total0.903995.020.4519
Template load0.00240.250720.0012
Template processing0.901594.778820.4507
Template load and register function0.00020.019610.0002
states
state_id_array0.00250.267010.0025
state_identifier_array0.00300.314520.0015
Override
Cache load0.00200.2115220.0001
Sytem overhead
Fetch class attribute can translate value0.00070.072520.0003
Fetch class attribute name0.00100.103940.0002
XML
Image XML parsing0.00080.084920.0004
class_abstraction
Instantiating content class attribute0.00000.001140.0000
General
dbfile0.00080.0865180.0000
String conversion0.00000.000940.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/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: 13
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs