[Zope-CMF] Re: [dev] ActionProviderBase redux proposal

yuppie y.2004_ at wcm-solutions.de
Wed Jul 21 14:06:03 EDT 2004


Hi!


Dieter Maurer wrote:
> yuppie wrote at 2004-7-16 19:54 +0200:
>>...
>>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.
> 
> 
> +1

This is now on yuppie-apb-redo-branch.

What about completing the implementation of the 'description' property? 
I know that this should be customizable in the long run, but I think 
having 'description' in the default set doesn't hurt.


Some comments regarding the changes:


Using listFilteredActionsFor:
-----------------------------

Now all Action mappings returned by listFilteredActionsFor are 
ActionInfo objects. Each ActionInfo object has the following keys:

   - id (string): not unique identifier

   - title (string)

   - url (string): URL to access the action

   - category (string): one of "user", "folder", "object", "global",
     "workflow" or a custom category

   - visible (boolean)

   - available (boolean): the result of checking the condition

   - allowed (boolean): the result of checking permissions

Deprecated keys:

   - name (string): use 'id' or 'title' instead

   - permissions (tuple): use 'allowed' instead; The user must have at
     least one of the listed permissions to access the action. If the
     list is empty, the user is allowed.

Duplicates are no longer filtered out by listFilteredActionsFor, but 
there should not be any duplicates anyway.


Using third party action providers:
-----------------------------------

Now all action providers should implement the ActionProvider interface. 
In CMF 1.5 other action providers still work, but using them is deprecated.

While recommended, it is not necessary to switch to ActionInformation 
objects for now. But listActions has to be updated like this::

   -    def listActions(self, info):
   +    def listActions(self, info=None, object=None):
   +        if object is not None or info is None:
   +            info = getOAI(self, object)


Cheers,
	Yuppie




More information about the Zope-CMF mailing list