Currently in v 1.2.1, ExactSearchSubscription does not
work (aka does not allow to specify search terms) :
the following code can replace the one in
addSubscription.cpy :
--------------------------------------------
elif ptype == 'ExactSearchSubscription':
keywords['rpath']=context.REQUEST.form.get('rpath')
keywords['indices']=context.REQUEST.form.get('indices')
keywords['values']=context.REQUEST.form.get('values')
indices=keywords['indices'].split(',')
values=keywords['values'].split(',')
if not len(indices) == len(values):
raise "For ExactSearchSubscription number of
indices MUST be the same as number of values."
# formatting exact search for DataGrid Archetype Field
exact_search=[]
i=0
while i < len(indices):
exact_search.append({'Index':indices[i],
'Value':values[i]})
i += 1
keywords['exact_search']=exact_search
title=context.REQUEST.form.get('title', '')
if not title:
title=str(exact_search)
keywords['title']=title
-----------------------------------------------
Then portal_actions can be created with this kind of url :
addSubscription?ptype=ExactSearchSubscription&rpath=/&title=Sommaire&indices=review_state,sort_on,sort_order&values=published,created,reverse
Logged In: YES
user_id=994708
Err, indentation has been lost in the previous post, here I
attach a file with clean code instead of this mess.
Logged In: YES
user_id=994708
sorry for the spam, here is the file *really* attached.
indented code instead of previous mess