eZ Community » Forums » Extensions » eZ Flow » eZ Flow link block to pages with the...
expandshrink

eZ Flow link block to pages with the node_id and not the object_id

eZ Flow link block to pages with the node_id and not the object_id

Wednesday 08 June 2011 6:11:53 pm - 5 replies

Hi,

There is a free minding about the ezflow database model. The DB table is storing blocks by linking these blocks to a node_id (see below). Is there a reason for not using an object_id ?

Of course, this node_id usage cause some issues, you can imagine what's happend if you swap 2 nodes, of if you add some nodes locations

CREATE TABLE ezm_block (
    id CHAR(32) NOT NULL,
    zone_id CHAR(32) NOT NULL,
    name VARCHAR(255) NULL,
    node_id INTEGER UNSIGNED NOT NULL,
    overflow_id CHAR(32) NULL,
    last_update INTEGER UNSIGNED NULL DEFAULT 0,
    block_type VARCHAR(255) NULL,
    fetch_params LONGTEXT NULL,
    rotation_type INTEGER UNSIGNED NULL,
    rotation_interval INTEGER UNSIGNED NULL,
    is_removed INTEGER(2) UNSIGNED NULL DEFAULT 0,
    PRIMARY KEY(id)
) ENGINE=InnoDB;

CREATE INDEX ezm_block__is_removed ON ezm_block(is_removed);
CREATE INDEX ezm_block__node_id ON ezm_block(node_id);
CREATE TABLE ezm_pool (
    block_id CHAR(32) NOT NULL,
    object_id INTEGER UNSIGNED NOT NULL,
    node_id INTEGER UNSIGNED NOT NULL,
    priority INTEGER UNSIGNED NULL DEFAULT 0,
    ts_publication INTEGER NULL DEFAULT 0,
    ts_visible INTEGER UNSIGNED NULL DEFAULT 0,
    ts_hidden INTEGER UNSIGNED NULL DEFAULT 0,
    rotation_until INTEGER UNSIGNED NULL DEFAULT 0,
    moved_to CHAR(32) NULL,
    PRIMARY KEY(block_id, object_id)
) ENGINE=InnoDB;

CREATE INDEX ezm_pool__block_id__ts_publication__priority ON ezm_pool(block_id,ts_publication,priority);
CREATE INDEX ezm_pool__block_id__ts_visible ON ezm_pool(block_id,ts_visible);
CREATE INDEX ezm_pool__block_id__ts_hidden ON ezm_pool(block_id,ts_hidden);

Modified on Thursday 09 June 2011 12:07:14 pm by gilles guirand

Wednesday 08 June 2011 6:38:52 pm

this is a good one. if i'm not wrong, object_id was used in the firsts versions of ezflow, but that was changed to node_id. 

for me, it makes sense. when you browse for adding these elements to the blocks, you browse nodes and not objects. 

if you use the browse thing and probably select and object with several locations, how to tell ezflow that the result should link to that node and not to the main_node of the object? 

but i see your point. if you swap nodes probably you'll get some unwanted side effect, but ihmo that should be solved adding things to the swap operation. i mean 'if i swap this, look to ezflow blocks and change what is needed...'

Cheers. 

Wednesday 08 June 2011 6:52:33 pm

I agree with Carlos. besides when you choose a source in an dynamic blocs : which node had to be chose ...

Ezflow helps us to create pages in order to show the content tree in an another way : the content tree is for me a tree of nodes before a tree of object...

Alex

Thursday 09 June 2011 12:14:57 pm

No, i speak about the ezm_block table, and not the ezm_pool table. This table is storing the link between a "page" and its block, and not the link between a block and its related items (ezm_pool job)

I update the POST with the DB declaration

Modified on Thursday 09 June 2011 12:15:12 pm by gilles guirand

Thursday 09 June 2011 12:37:04 pm

oh i see... yep, didn't realize this...  this is totally different question... btw, i wondering what will happen if you add a block to a object with several locations... will it create several entries in that ezm_pool table?

i will try and see... but if the answer is no... then why we need that node_id there?

Thursday 09 June 2011 7:07:20 pm

yep same thing didn' see it at first time .

maybe something like cache you have the same in the all location so having the node_id avoid calculate cache many times ?

Alexandre

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from