[Zope-CMF] ActionInformation objects that are not accessible through ZMI

Phil Glaser StillSmallVoice@DirectvInternet.com
Wed, 4 Sep 2002 19:14:38 -0400


Hi,

I've been reading through the Plone "header" template and have taken
particular interest in the personalBar macro. I'd like to be able to control
which user and global actions are displayed in the personalBar. My initial
thinking was that I would be able to turn these actions on and off as you
can with the portal_tab actions, by using the ZMI to the portal_actions
tool. But I never found any "user" actions displayed in ZMI.

Digging into the directory tree, I found that MembershipTool defines user
actions as a list of ActionInformation objects in the _actions class
variable, which is made accessible through the listActions() method. I
gather that at some point in the initialization process, the various tools
go through an initialization process by which the listAction() method is
called for each so as to assign the ActionInformation objects to the
portal_actions tool. So, most of the most of the juicy action objects that
drive the display (e.g., the user actions in the personalBar) are defined in
the code, but do not show up in the ZMI to portal_actions.

Here, then, are my questions:

1. Am I on the right track in understanding how this process works?

2. Do the membership tool's actions not show up in the ZMI to portal_actions
because the actions are defined within the MembershipTool class, and hence
modifications to the actions through ZMI could not be made persistent in a
clean way? (I'm assuming that portal_actions was developed after the
MembershipTool was and that MembershipTool would need to be made compatiable
with portal_actions)

3. Is there any other way for me to modify the ActionInformation objects in
MembershipTool (and other tool classes, for that matter) independently of
the MembershipTool's class definition. For example, is there some kind of
initialization hook where I could intervene? Or is the cleanest thing for me
to modify the MembershipTool's source code?

Many thanks for your help!

--Phil





Philip Glaser
Principal and Software Architect
Sustainable Software Solutions, LLC
StillSmallVoice@DirectvInternet.com
www.sustainsoft.com
973-951-9522