[Zope-CMF] How do I get the action for 'folderContents'?

Grégoire Weber gregoire.weber@switzerland.org
Thu, 04 Apr 2002 00:19:59 +0200

Hi Tres,
hi all,

tanks for your snippet and your prompt answer, it guided me to the working 
solution below.

> There isn't any API for fetching a single action information object
> from the tool;  we should perhaps add one.  As a workaround, try::
>     actions = context.portal_actions.listFilteredActionsFor( context )
>     fc_actions = map( lambda x: x['id'] == 'folderContents', actions=
>     if fc_actions:
>        fc_action = fc_actions[0]

The follwing snippet works for CVS-Versions of march 2002 (post CMF 1.2):

# workaround: get the absolute action path of an action not registered by an 
# object in the portal_types tool like the 'folderContents' action:
actions_list = []
for actions in
action_path = filter(lambda x:x['id'] == 'folderContents',

# just for information (normal way): get an action of an object registered 
# with the object:
action_path = context.getTypeInfo().getActionbyId('edit')


Grégoire Weber