[Zope-CMF] [dev] ActionProviderBase redux proposal
yuppie
y.2004_ at wcm-solutions.de
Fri Jul 16 13:54:02 EDT 2004
Hi!
Background:
There are two types of Actions: Simple dictionaries and the newer and
more powerful ActionInformation objects.
The methods for listing Actions return always simple dictionaries.
Creating dicts from ActionInformation objects is done late in the
process because resolving TALES expressions is expensive and some
Actions are filtered out before returning the list.
In CMF 1.4 the Actions Tool did the filtering and created the dicts, in
CMF 1.5 alpha ActionProviderBase does it. In CMF 1.4 the Actions Tool
had different code for both kinds of Actions, now ActionProviderBase has
the code for ActionInformation Actions and OldstyleActionProviderBase
the code for dict Actions.
Proposal:
Add a new ActionInfo class that implements a 'lazy' dict. This way we
can create the dict at the beginning of the process *and* resolve TALES
expressions only if needed. This class could also be used as a wrapper
for dict Actions and set defaults for keys that are not defined in these
Actions.
This way we can use the same code for both Action types and remove
OldstyleActionProviderBase again.
This would also be a first step for improving DCWorkflow Actions: Both
kinds of Actions could be mixed, so the Workflow Tool could return dicts
from old hardcoded workflow definitions like CMFDefault/DefaultWorkflow
and ActionInformation based Actions from DCWorkflow.
That idea is inspired by <http://collector.zope.org/CMF/232> and should
make resolving it easier.
If that sounds like a good idea I'd like to implement it before 1.5 beta
is released.
Cheers,
Yuppie
More information about the Zope-CMF
mailing list