Difficulties with Actions

Martin Aspeli optilude at gmx.net
Mon Oct 8 18:35:50 UTC 2007


Derek Richardson wrote:
> I'm attempting to write a replacement for Plone CAS Login for Plone 3.0, 
> since the product hasn't been updated.
> 
> The 2.5 product changed the login portlet and the login form to go to 
> CAS. I've decided it is more elegant to simply have the "login" link on 
> the personal bar link to the CAS server login form and get rid of the 
> portlet and login form altogether, because, since the CAS server gathers 
> the username and password, there is no need for an entire portlet or 
> form - a link is just right.

Or maybe some JS that redirects/reloads on startup?

> Unfortunately, the CAS server needs to know whether javascript and 
> cookies are enabled and this info is harvested on the linking page via 
> javascript and passed via the form parameters (the form method is GET) 
> to the CAS server.
> 
> I don't know how to do this from a GenericSetup action registration. It 
> simply takes a URL which, while it can by dynamic, can't AFAICT include 
> javascript. Does anyone see how I can produce these urls from action 
> definitions?

Why not just have it point to a view that works this out and then 
performs an immediate redirect?

> This reminds me of a post I made a few weeks ago that received no 
> replies entitled "Vertically Stacked Dynamic Links in Document Actions". 

Maybe because it had a terrible title? :-)

> It's short, so I'll include it here:
> 
> #####
> 
> I want to get an entry on the document actions line that has multiple 
> links. Example: stacked on top of each other, "Atom Feed", "RSS2 Feed", 
> and "RSS Feed", each going to a separate url. But I don't want them 
> distributed horizontally, as separate document actions would have it. 
> Also, they must be dynamic based on the context - folder A may have all 
> 3, while folder B lacks the RSS2 feed. I tried inserting another viewlet 
> into the manager, but so far haven't gotten it to work. So I'm asking 
> for advice...

This leaves me asking, "what did you try"... Did you fail to install a 
viewlet? Did you fail to make it have the layout you want? There's not 
enough information here to help you. If I ignored the post the first 
time, it was probably because of the open-ended question. ;-)

> #####

A viewlet can be made to work - as can a bunch of regular actions and 
some creative CSS. At the end of the day, this comes down to CSS.

> I am guessing that, if I hit the similar problems twice in two very 
> different contexts in a few weeks, either I have a systematic 
> misunderstanding or there's a real challenge here. It seems to me that 
> it would be nice if actions were more flexible, to be able to render a 
> nested viewlet as well as a URL. This would give product authors much 
> more flexibility. What do y'all think?

I don't think it'd be appropriate to change the actions machinery for 
this. If actions aren't flexible enough for you, you're most likely 
going to be able to register a new viewlet, order it properly, and style 
it with CSS.

Martin

-- 
Acquisition is a jealous mistress





More information about the Product-Developers mailing list