Forums / Developer / Attribute filtering in node fetching operations

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

eZ debug

Timing: Jan 18 2025 04:17:19
Script start
Timing: Jan 18 2025 04:17:19
Module start 'content'
Timing: Jan 18 2025 04:17:19
Module end 'content'
Timing: Jan 18 2025 04:17:19
Script end

Main resources:

Total runtime0.2087 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0082 588.9766180.8125
Module start 'content' 0.00820.0048 769.789197.8359
Module end 'content' 0.01310.1953 867.6250526.2500
Script end 0.2084  1,393.8750 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00341.6443200.0002
Check MTime0.00140.6600200.0001
Mysql Total
Database connection0.00120.588310.0012
Mysqli_queries0.156875.12841410.0011
Looping result0.00150.73211390.0000
Template Total0.195093.410.1950
Template load0.00090.420110.0009
Template processing0.194192.989410.1941
Override
Cache load0.00060.294110.0006
Sytem overhead
Fetch class attribute can translate value0.00090.436010.0009
XML
Image XML parsing0.00040.189310.0004
General
dbfile0.00180.8697200.0001
String conversion0.00000.002930.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs