[Zope-CMF] Re: ActionProviderBase.getActionById

Dieter Maurer dieter at handshake.de
Fri Oct 10 14:47:59 EDT 2003


Yuppie wrote at 2003-10-10 11:24 +0200:
 > alan runyan wrote:
 > > Could we land a getActionById on ActionProviderBase.  In plone
 > > we have tons of code that iterates through actions just to
 > > grab a specific action by its id.  Anyone see any downsides?
 > 
 > +1 in general

+1, from me, too.

 > Some thoughts regarding details:
 > 
 > 1.) We can't call this method getActionById. In CMF 1.4 and later 
 > TypeInformation subclasses from ActionProviderBase and its getActionById 
 > interface / implemtation doesn't make much sense in the context of 
 > ActionInformation objects. TypeInformation's getActionById was written 
 > for oldstyle type actions. I'd propose 'getActionInfo'.

Fine.

 > 2.) I'm not sure what identifies an Action: Id isn't unique. Id + 
 > Category would be more specific, but isn't unique either. Don't know 
 > what makes sence.

Ids should be unique. Let's punish people that have non-unique ids
(and just return the first one with the given id).

Anybody, that does not like this can make his ids unique.

 
 > 3.) The method should return the result of ActionInformation.getAction .

Fine

 > 4.) The method should check Permissions and Condition.

Not sure about this.
Maybe, the returned object should have a method
"available" that checks "Permissions" and "Condition".

 > 5.) It should be possible to pass a chain of action ids. If Permissions 
 > / Condition check fails on the first one, return the next.

Not sure about this (as I am not sure with 4).


Dieter



More information about the Zope-CMF mailing list