referencing of nodes in content structure tree

Author Message

Felix Gluecklich

Wednesday 16 January 2008 4:32:36 am

At first i try it to copy the folder node named "Advertising".
Then i like to say: "Advertising" is only one time in eZ Publish,
therefore this folder "Advertising" is not an copy or an move.

This folder has to be an reference or an link to the original
folder named "Advertising". One changing of "Advertising"
instance of class Advertising and overall the new content
will be visible. Could it be true with ez Publish?

But in the admin side i see no possibilities, to referencing
an node (folder, frontpage, etc.).

Literature
|- Advertising (folder)
|- Shakespeare (folder)
   | - Advertising* (folder) ( this folder as reference / link to Advertising - no copy! )
   | - Romeo und Julia (folder)
   | - what you want (folder)
   | - Hamlet (folder)
|- Goethe (folder)
   | - Advertising* (folder) ( this folder as reference / link Advertising - no copy! )
   | - Faust (folder)
   | - Erlkoenig (folder)
   | - Stella (folder)

Send me an tipp in detail. Thanks.

Piotrek Karaś

Wednesday 16 January 2008 12:40:19 pm

I'm not sure if I have understood your need completely, but my guess is that you could need locations mechanism, which happens to be one of the core content management features in eZ. See this article and other ones in that chapter:
http://ez.no/doc/ez_publish/technical_manual/4_0/concepts_and_basics/content_management/the_content_node_tree

Hope this helps,
Piotrek

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Felix Gluecklich

Wednesday 16 January 2008 2:16:44 pm

I read your hint about locations. Look one more:

In software developing my example is like this:

Tree tree = new Tree();
Folder forum = new Folder("FORUM");
Folder news = new Folder("NEWS");
tree.add("1.0", news );
tree.add("2.3", news );
tree.add("4.0", forum);

The instance of folder is an reference / link.
The folder is on sereral locations in the tree.
I can change the content of folder, and
in every part of tree with an reference to my folder
the changed folder will show his content.

One place for changing updates all place with reference to this instance.

In the eZ doc about locations i am missing the place of node / object 31.
Where is the instance and where is the reference to this instance?

An reference to an instance point not to an object in memory,
it point to an place of address into an memory, like C++
An pointer to an pointer ... and so on.

I like to have one Node for writing about NEWS.
One time in my siteaccess and in my content structure.
The User in Role as Editor see only this place of real NEWS.

But my content structure is very big and large and have a lot of
sub trees and sub trees...

In several subtrees there are also an link or reference to NEWS.
This NEWS is pointing to my Node from above.

Just like the eZ location example... but i missing there the
real NEWS Node. Where this node have to be situated in content structure?

I think so:

Node 2
|- Node 10
   | - Node 12 NEWS <---- only here the editor will change content
   | - Node 13 Contact
| - Node 22
   |- reference to Node 12 News
   |- Node 223
|- Node 226
|- Node 401
   | - Node 422
   | - reference to Node 12 News

That what i want. What i am understand wrong?

Piotrek Karaś

Wednesday 16 January 2008 9:37:03 pm

Again, as far as I understand your examples, seems to me that we are talking about object locations. One object may have several node locations, one of which must be the main one. This main node location holds a physical object, the other ones only reference to the main one. Unfortunately, this native mechanism is object-level oriented and I don't think it will work for entire sub-structures. Folder follows the rules of any node/object, its subitems will not inherit from it, just like it happens with references in some operating systems. At least I'm not aware of such possibility.

Anyone else?

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Tino Adams

Wednesday 16 January 2008 10:57:25 pm

Referencing content nodes including sub-tree is not possible.
Felix, your Tree/Folder example makes sense but can't be applied to ezPublishs content structure. The content structure (content tree) is build with content nodes where a node is a so called location and each node refering to one content object. So your code example in ezPublish would look something like:

$folderObject= new Folder();
$articleObject= new Article();

/*
Root
|_ Folder
| |_ Article
|_Folder <- same as first folder but no children
*/

$tree= new Tree();
$root= $tree->getRoot();

$folderNode= $root->addChild(new ContentNode($folderObject));
$articleNode= $folderNode->addChild(new ContentNode($articleObject));

$folderNode2= $root->addChild(new ContentNode($folderObject));

As you can see I was able to reference the Folder twice in the tree but none of it's children (Article). That's because content objects (Folder, Article) don't have hierarchical relations but content nodes do.

Hope that helps.

Peter Putzer

Thursday 17 January 2008 1:54:45 am

One solution is to create a "Reference" class that contains a single object relation attribute. Then you just have to create template overrides for all possible view modes for this class and show the corresponding view of the related node instead.

However, this does not work if you iterate over a multilevel hierarchy manualle (i.e. without using node_view_gui).

Accessible website starting from eZ publish 3.0 (currently: 4.1.0): http://pluspunkt.at

Felix Gluecklich

Thursday 17 January 2008 2:49:47 am

Yes, you are right: The solution is: using "location".

main node
|- Common
   |- news (location: berlin, dresden)
- berlin
  |- news * 
-dresden
  |- news *

* will appear here automatically as node "news",
if the new location is choosed for node "news".

In the popup-menu over the left content structure menu there are only
items for create, move and copy of content structure nodes.
The referencing / linking item (called location)
is only in the overview of the current node possible.

But it works...

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 19:09:42
Script start
Timing: Jan 18 2025 19:09:42
Module start 'layout'
Timing: Jan 18 2025 19:09:42
Module start 'content'
Timing: Jan 18 2025 19:09:43
Module end 'content'
Timing: Jan 18 2025 19:09:43
Script end

Main resources:

Total runtime0.7592 sec
Peak memory usage4,096.0000 KB
Database Queries73

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 589.4766152.6406
Module start 'layout' 0.00690.0039 742.117239.4766
Module start 'content' 0.01080.7470 781.5938685.3594
Module end 'content' 0.75770.0015 1,466.953120.1250
Script end 0.7592  1,487.0781 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4301160.0002
Check MTime0.00130.1733160.0001
Mysql Total
Database connection0.00090.118210.0009
Mysqli_queries0.680689.6476730.0093
Looping result0.00070.0936710.0000
Template Total0.721395.020.3607
Template load0.00190.256720.0010
Template processing0.719494.747720.3597
Template load and register function0.00010.017210.0001
states
state_id_array0.00110.144510.0011
state_identifier_array0.00320.424920.0016
Override
Cache load0.00190.2447710.0000
Sytem overhead
Fetch class attribute can translate value0.00100.136440.0003
Fetch class attribute name0.00110.145690.0001
XML
Image XML parsing0.00130.168540.0003
class_abstraction
Instantiating content class attribute0.00000.0045100.0000
General
dbfile0.00100.1358230.0000
String conversion0.00000.001140.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
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
15content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
22content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 54
 Number of unique templates used: 7

Time used to render debug report: 0.0004 secs