[Zope-CMF] Re: Serious problem with type actions

Yuppie schubbe@web.de
Sat, 03 May 2003 14:22:39 +0200


Hi!


Sidnei da Silva wrote:

> On Tue, Apr 29, 2003 at 07:16:31PM +0200, Yuppie wrote:
> | What about a small modification of _getViewFor and getActionById:
> | 
> | If we remove the absolute part (the last '/' and everything left of it) 
> | of the action string, people could use absolute URLs if they want.
> | 
> | If I don't miss a use case with a '/' in the relative URL, this would be 
> | 100% backwards compatible.
> 
> Theres one thing that I would like to see in this case.
> 
> Suppose that you have a action like:
> 
> string:$object_url/folder_contents?filter_by=portal_type&clear_filter=no
> 
> In the case where this action is *called*, I would like it to:
> 
>  * Get the last part of the url (folder_contents)
> 
>  * Parse the params (filter_by, clear_filter)
> 
>  * Call the view passing the params as **kw
> 
> Thoughts?

+0.5 (Note that the part I proposed has to be modified.)

URLs are more powerful than method calls. They might even point to 
external resources, so we can't always translate URLs into direct calls.

getActionById returns an URL, so we are just talking about _getViewFor.

_getViewFor is (in CMFDefault and Plone) used for the aliases __call__, 
view and index_html.

Your approach improves _getViewFor, but I'm not sure if that is the way 
to go. Now that we have more powerful actions for types, perhaps we 
should re-think how aliases work.


Cheers,

Yuppie