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