[Zope-CMF] actions tool and categories

J Cameron Cooper jccooper@jcameroncooper.com
Thu, 05 Jun 2003 12:18:53 -0500


I'm confused by the Actions tool. While you can put actions into it with 
great variety, there's really only one way to get actions out, that 
being the listFilteredActions methods, which filter based on a 
hard-coded set of categories. Which makes the categories less useful 
than they could be.

Is there a good reason for

 1. only allowing filtered actions, and/or

 2. making the categories by which actions are filtered non-configurable?

Seems to me like it would be desirable to be able to add actions to a 
type with a custom category, like 'mystupidtypebutton', and then in a 
page template skin say something like::

<span tal:define="actions python:here.portal_actions.listAllActions()"
           tal:repeat="button actions/mystupidtypebutton | nothing">
  <input type="button" tal:attributes="value button" />
</span>

to get an action-driven list of buttons for that type.

To do this (and improve the tool in general) I think it needs the 
following changes:

 * a non-category-filtering method

 * method(s) for configuring what categories to allow + ZMI interface in 
tool to set this

Either one of these additions could stand alone and be useful. Both, I 
think, would be better.

Unless someone can convince me otherwise, I'm going to do this for 
in-house use, and will happily contribute the patch if desired.

I will also entertain suggestions for API. The first method, for 
instance, could be called listAllActions, listActions, 
listPermissibleActions, etc. (I think the methods for setting filter 
categories are more obvious.)

          --jcc