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

Author Message

gilles guirand

Wednesday 08 June 2011 9:11:53 am

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);

--
Gilles Guirand
eZ Community Board Member
http://twitter.com/gandbox
http://www.gandbox.fr

Carlos Revillo

Wednesday 08 June 2011 9:38:52 am

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. 

SEBBANE Alexandre

Wednesday 08 June 2011 9:52:33 am

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

Paris, France

gilles guirand

Thursday 09 June 2011 3:14:57 am

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

--
Gilles Guirand
eZ Community Board Member
http://twitter.com/gandbox
http://www.gandbox.fr

Carlos Revillo

Thursday 09 June 2011 3:37:04 am

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?

SEBBANE Alexandre

Thursday 09 June 2011 10:07:20 am

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

Paris, France

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 01:02:30
Script start
Timing: Jan 18 2025 01:02:30
Module start 'layout'
Timing: Jan 18 2025 01:02:30
Module start 'content'
Timing: Jan 18 2025 01:02:31
Module end 'content'
Timing: Jan 18 2025 01:02:31
Script end

Main resources:

Total runtime0.1630 sec
Peak memory usage4,096.0000 KB
Database Queries70

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 588.4219152.6875
Module start 'layout' 0.00610.0117 741.109439.5313
Module start 'content' 0.01790.1437 780.6406630.0547
Module end 'content' 0.16160.0014 1,410.695316.0703
Script end 0.1629  1,426.7656 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00321.9499160.0002
Check MTime0.00130.7803160.0001
Mysql Total
Database connection0.00080.501310.0008
Mysqli_queries0.097359.6769700.0014
Looping result0.00060.3890680.0000
Template Total0.119273.120.0596
Template load0.00201.236920.0010
Template processing0.117271.903720.0586
Template load and register function0.00010.077410.0001
states
state_id_array0.00100.595610.0010
state_identifier_array0.00070.403720.0003
Override
Cache load0.00171.0516640.0000
Sytem overhead
Fetch class attribute can translate value0.00070.403030.0002
Fetch class attribute name0.00110.650880.0001
XML
Image XML parsing0.00412.515630.0014
class_abstraction
Instantiating content class attribute0.00000.0111100.0000
General
dbfile0.00563.4093230.0002
String conversion0.00000.005140.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
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 29
 Number of unique templates used: 7

Time used to render debug report: 0.0004 secs