Create a node ?

Author Message

Bermudez Alban

Tuesday 14 February 2006 3:05:25 am

Hello world,

I want to import file in EzPublish. The file is create but not the node.

the code which create node :

		$newNode =& new ezcontentobjecttreenode();
		$newNode->setAttribute( 'node_id', $contentObject->attribute( 'id' ));
		$newNode->setAttribute( 'parent_node_id', 59);
		$newNode->setAttribute( 'sort_field', 2);
		$newNode->setAttribute( 'sort_order', 0 );
		$newNode->setAttribute( 'contentobject_version', 1 );
		$newNode->setAttribute( 'contentobject_is_published', 1 );
		$newNode->setAttribute( 'main_node_id', $contentObject->attribute( 'id' ));
		$newNode->setAttribute( 'contentobject_id',  $contentObject->attribute('id'));
		$newNode->setName('TestAB');
		$newNode->updateSubTreePath();
		$newNode->store();
		eZContentObjectTreeNode::updateNodeVisibility( $newNode, eZContentObjectTreeNode::fetch(59), false );

The line in the ezcontentobject_tree table is insered but the path_identification_string is wrong and the path_string is null.

And if I change this values with phpMyAdmin, the file does not appear either. How can i do?

Thansk :)

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 19 2025 04:29:44
Script start
Timing: Jan 19 2025 04:29:44
Module start 'layout'
Timing: Jan 19 2025 04:29:44
Module start 'content'
Timing: Jan 19 2025 04:29:44
Module end 'content'
Timing: Jan 19 2025 04:29:44
Script end

Main resources:

Total runtime0.0176 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 589.0313152.6094
Module start 'layout' 0.00650.0028 741.640639.3984
Module start 'content' 0.00930.0060 781.039185.2109
Module end 'content' 0.01530.0022 866.250030.3047
Script end 0.0176  896.5547 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002715.4525140.0002
Check MTime0.00126.5454140.0001
Mysql Total
Database connection0.00126.961410.0012
Mysqli_queries0.002614.726230.0009
Looping result0.00000.090810.0000
Template Total0.00179.610.0017
Template load0.00095.251510.0009
Template processing0.00084.358710.0008
Override
Cache load0.00063.415710.0006
General
dbfile0.00169.205180.0002
String conversion0.00000.039340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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