[Zope-CMF] Re: ActionProviderBase.getActionById

alan runyan runyaga at runyaga.com
Fri Oct 10 15:44:11 EDT 2003


> I guess you just forgot to send a copy to the list. I'll CC the list 
> again.

apologies.

>>> 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.
>>
>>
>> I think this isnt a problem.  The problem is you cant query Actions
>> on a Tool (I *know* Reply is on portal_discussion, but _cloneActions()
>> and all that jazz is getting painful).  I just want to walk up to a tool
>> and get the ActionById. Given a id+category is enough. If it returns
>> multiple items - fine.
>
> I don't know if it makes sense to return more than one item. The only 
> case with identical ids that comes to my mind is this in ActionsTool:

I agree with Dieter in principle about punishing people who use
duplicate id's.  But I have seen use's for it.  And I think it could
possible affect people who are using it.

>      _actions = (ActionInformation(id='folderContents'
>                                  , title='Folder contents'
>                                  , action=Expression(
>                 text='string: ${folder_url}/folder_contents')
>                                  , condition=Expression(
>                 text='python: folder is not object')
>                                  , permissions=(ListFolderContents,)
>                                  , category='object'
>                                  , visible=1
>                                   )
>                , ActionInformation(id='folderContents'
>                                  , title='Folder contents'
>                                  , action=Expression(
>                 text='string: ${folder_url}/folder_contents')
>                                  , condition=Expression(
>                 text='python: folder is object')
>                                  , permissions=(ListFolderContents,)
>                                  , category='folder'
>                                  , visible=1
>                                   )
>                 )
>
> Looking at the conditions, only one is true in any case. It might be 
> sufficient to return the first action with the given id that fulfills 
> the Condition / Permission / visibility.

I agree.  But there should be a mechanism to get more than 1 if possible.

> I don't know if people use categories to distinguish between actions 
> having the same id. If not, it would be easier to just use id.

We do.

>> Although I dont like the query/get diachotomy
>> of method names.  queryActionInfo might be fine.
>
> Isn't it like this: You *query* the Action Provider and *get* an Action 
> Info as result?

yup.  what I meant was the getActionInfo vs queryActionInfo

>>> 3.) The method should return the result of ActionInformation.getAction 
>>> .
>>
>>
>> hrmmm, I would like the opportunity to check if its visible.
>
> ok.
>
>>> 4.) The method should check Permissions and Condition.
>>
>>
>> ok.
>>
>>> 5.) It should be possible to pass a chain of action ids. If 
>>> Permissions / Condition check fails on the first one, return the next.
>>
>>
>> sounds fine with me.  +1
>>
>> ~runyaga
>
> I'd like to keep listFilteredActionsFor, getActionInfo and getAction in 
> sync. getActionInfo should return the same dict as the others.

ok

> What about flags for visibility and Permissions?
>
>      def getActionInfo(object=None, action_chain,
>                        check_visible=1, check_permissions=1):

sounds good.

I apologize for being half here.  Trying to organize Plone conference.
CMF is very great framework.  BTW: One thing I would like to see
in CMF1.5 is making portal_properties folderish so you can put
propertysheets in there.  Its not elegant but I've heard alot of
people enjoying it.

Also this has come up time and again.. but maybe the propertysheets
that CMF uses from Zope could be subsumed into CMF.  It is very
important in CMF that all properties have a description field.
(there are no othe things that are really neeed).  If you have
an idea we can put this into Plone first and then roll it back
into CMF.

cheers,
alan runyan




More information about the Zope-CMF mailing list