[Zope-CMF] [dev] refactoring listFilteredActionsFor: 2 questions

Yuppie schubbe at web.de
Thu Nov 20 12:23:57 EST 2003


Hi!


Working on the implementation of the proposal I stumbled over 2 issues:


1.) listFilteredActionsFor queries not only the ActionProviders listed 
in ActionsTool, but also the given object itself for Actions.

Is anybody using that feature? Are these objects ActionProviders or how 
is defined what they return? Do the return values need filtering?

I'd like to deprecate that feature, but I might be missing something.



2.) Recreating the ExpressionContext for each Action Provider is to 
expensive. I see 2 possible solutions:

a) caching ExpressionContext
============================

I still don't like to pass ExpressionContext around as argument.
( <http://mail.zope.org/pipermail/zope-cmf/2003-November/019820.html> )

So I experimented with storing the ExpressionContext in _v_skindata, 
based on the assumption that
i)  _v_skindata is always available in CMF
ii) _v_skindata is new for each request

It seems to work pretty well, but I'm not sure that's a sane approach 
and there might be better solutions. Any ideas?


b) call methods with ExpressionContext as argument
==================================================

Going back to the original proposal. Just making listFilteredActionsFor 
and getActionInfo public methods with an 'object' argument. 
listActionInfos would be private, listFilteredActionsFor and 
getActionInfo would create an ExpressionContext to call listActionInfos.

But if nobody tells me what's wrong with the caching approach, I'd 
prefer caching.


Any feedback is welcome!

TIA,
	Yuppie








More information about the Zope-CMF mailing list