Attribute filtering in node fetching operations

Author Message

Volker Lenz

Thursday 15 July 2004 10:15:42 am

I'd like to use an attribute filter which checks if a given value is in a multivalue-attribute of content objects. However, attribute filtering does not support the sql-operator IN, which checks if a given value is in a multivalue-database field.

Are there any attribute filter extensions around which allow for filter statements like

ExtendedAttributeFilter,array(array('value x' 'IN' 'multi_value_field y'))

I am currently not keen to write this one myself ;-)

Paul Borgermans

Friday 16 July 2004 5:10:05 am

Hi Volker

I added IN and LIKE to the attribute filter operators in node fetching. I use it in a form where user can click one or more status checkboxes to filter the display of TODO items. The IN filter expects an array like (1,3,5) which you have to provide in the template and is actually passed as extra parameters to the templates in my implementation.

I think this can be useful for you too, I'll upload the modified class ezcontentobjecttreenode to pubsvn later today.

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Volker Lenz

Saturday 17 July 2004 7:20:25 am

Hi Paul,

you're really a great blockbuster ;-)

Thanks a lot & kind regards.

BTW. I am going to deploy this feature in new Edition PieServer for ezp Rel. 3.4 ;-)

Volker

Paul Borgermans

Saturday 17 July 2004 7:32:43 am

Sorry,

Got connection problems (vpn from home). I'll have to do it monday. I hope it can wait until then, the mods are really very simple

Best regards

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Paul Borgermans

Tuesday 20 July 2004 9:15:56 am

Hello

Only could do it now :-(

You can find my mod in the community svn server adding 'like' and 'in' attribute filters:

http://pubsvn.ez.no/viewcvs/community/trunk/kernel/classes/ezcontentobjecttreenode.php

I patched against rev 7077 of the trunk. If you inspect the diffs, you see it is all very easy to do.

To feed an 'in' array, I usually assemble this array as a string from checkboxes inside a form. The form lets the user specify some nifty filters in a trouble ticket like interface.

If you like it, you can fire another suggestion to the ez crew to incorporate both filter options in the standard code base (I already did without success).

Best regards

-paul

(gone until next monday)

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

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

Main resources:

Total runtime0.7180 sec
Peak memory usage4,096.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0073 588.0469152.6406
Module start 'layout' 0.00730.0037 740.687539.4766
Module start 'content' 0.01100.7051 780.1641563.3672
Module end 'content' 0.71610.0018 1,343.531316.4375
Script end 0.7180  1,359.9688 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.5267160.0002
Check MTime0.00160.2235160.0001
Mysql Total
Database connection0.00090.128410.0009
Mysqli_queries0.652890.9221630.0104
Looping result0.00060.0899610.0000
Template Total0.685195.420.3425
Template load0.00260.359920.0013
Template processing0.682595.055720.3412
Template load and register function0.00010.015610.0001
states
state_id_array0.00080.113810.0008
state_identifier_array0.00110.151120.0005
Override
Cache load0.00200.2819400.0001
Sytem overhead
Fetch class attribute can translate value0.00060.082220.0003
Fetch class attribute name0.00170.231870.0002
XML
Image XML parsing0.00130.187020.0007
class_abstraction
Instantiating content class attribute0.00000.0034100.0000
General
dbfile0.00090.1211230.0000
String conversion0.00000.001540.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
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs