[Zope-CMF] Re: getActionById replacement
Chris Withers
chris at simplistix.co.uk
Thu Oct 20 12:15:16 EDT 2005
Hi Yuppie!
yuppie wrote:
>> getActionInfo()[\'url\']
>>
>> ...will net you a TypeError explaining that getActionInfo takes a
>> argument that isn't supplied. Looking at the docs, an action_chain,
>> but I have no idea what one of them is...
>
> 'action_chain' is a sequence of 'action paths'.
Does supplying a chain return the first action info that matches or the
first or all of the ones that match?
> 'action paths' are the
> unique identifiers of Actions. 'view' doesn't identify an Action because
> there might be 'object/view' and 'foo/view'. 'action paths' have the
> format <category>/<id>.
Ah, okay, so what does getActionById('view'), in its deprecated form,
actually do?
My current guess is to what SHOULD be used is:
>>>ti.getActionInfo('object/view')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File
"Products/CMFCore/ActionProviderBase.py", line 128, in getActionInfo
raise AccessControl_Unauthorized('You are not allowed to access any '
AccessControl.unauthorized.Unauthorized: You are not allowed to access any
of the specified Actions.
...but as you can see, that's not too successful :-(
The above was from a 'zopectl debug' prompt, what am I doing wrong?
> But please note: The whole PloneGenerator class is nasty code and I'm in
> the process of removing its base class PortalGenerator from the CMF
> trunk. PloneGenerator will no longer work with the trunk / CMF 2.0.
Yeah, I know, but don't care, I just want this garbage to STFU until we
can replace it with something better ;-)
cheers,
Chris
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
More information about the Zope-CMF
mailing list