Forums / Developer / Content object node / node assignment?

Content object node / node assignment?

Author Message

Marin Orlic

Thursday 15 December 2005 1:26:38 pm

Can someone explain the meaning of node assignment? I understand the logic of contentobjects and there corresponding node(s), but what's with the node assignments??

Thx.

Bertrand Dunogier

Wednesday 21 December 2005 10:40:47 am

A node assignment is just an entry in the ezcontentobjecttreenode table. It says that node X references object Y. One node references one object, and an object can be referenced by 0 to N nodes.

Marin Orlic

Thursday 22 December 2005 1:39:30 am

Ok, you're talking about ezcontentobject_tree table.. what's eznode_assignment? Does the first handle versions and the second current tree?

Norman Leutner

Friday 23 December 2005 12:25:53 am

As Bertrand already told,

an object can be assingned to N nodes.
The relation between object and node is called "node assignment".

With that relation you can build content trees without redundant data.

In example:
You build a site and want to have the same content on two sites.
Just assign the object to another node.

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Marin Orlic

Wednesday 28 December 2005 2:07:37 pm

How are nodes created?

Is this right:
When an object is first posted, its main node is created with node assignment, and then later, if it is published to additional locations, new assignments are created.

What happens if the main node needs to be changed? Is just the assignment modified or? How to delete main node (in PHP ? :)

Thanks for your answers :)

Norman Leutner

Thursday 29 December 2005 7:55:29 am

Yes It is right.
When you create a contentpage within ez,
a node with a the related contentobject is created.

When you add a second location, another node is created.

Every node and object has an attribute called "main_node_id" which contains the assigned main node .

I hope this helps

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Marin Orlic

Monday 02 January 2006 3:31:22 pm

Wait wait.. if the second node is create when another location is added, what's the purpose of node assignments? Sounds to me that in this case it would be a 1:1 relationship, not 1:N.. Or are nodes used to store additional version info?

Kristof Coomans

Tuesday 03 January 2006 12:59:25 am

When you edit an object, you can add additional node assignments for it (in the old admin interface, eZ publish before the 3.5 release). When adding such a node assignment, the eznode_assignment table is used to store the assignment information for the specific version of the object. These assignments are not present in the content tree until the version gets published. The actual tree is represented by the ezcontentobject_tree table.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Xavier Dutoit

Tuesday 03 January 2006 4:47:50 am

You can still assign the nodes while editing after 3.5.

however you haveto customise your edit.tpl to add a few fields:

UseNodeAssigments=1
and set MainNodeID to whatever you want

You can (have to ?) assign to several placements using other variables. I've used it for a website and works well. I don't have the details right now...

X+

http://www.sydesy.com