Hi Carlo,
Yes, your emulation would be the general idea, albeit to be really useful from the context of the Struts Bridge I think
it would need to be expanded somewhat further:
- possibility to maintain preferences per user (with fallback to defaults)
- preferences tied to a specific Action
- "transparent" way of accessing these using Struts like api, both from Portlet
and Web contexts
- abstraction to allow different ways of persisting these (using the real Portlet Preferences in a Portlet context of
course)
Anyway, you'll get what I mean :)
If someone could come up with such a generalization, I'd be happy to add these to the Struts Bridge because I think it
really would be a great addition.
Regards,
Ate
Carlo Cavallieri wrote:
ah, and i've forgot to mention that in the meantime i've written a
little class to emulate the PortletPreferences stuff;
with the help of a littlte wrapper (that check if
PortletServlet./isPortletRequest/(request) ) i use the real preferences
or the "emuleted" one so my still remain compatible whenever i0m in a
portlet or in a web application;
attached you can find the class that i'm using to simulate the preferences.
----- Original Message -----
From: "Carlo Cavallieri" <[EMAIL PROTECTED]>
To: [email protected]
Sent: Monday, June 9, 2008 7:52:32 AM GMT +01:00 Amsterdam / Berlin /
Bern / Rome / Stockholm / Vienna
Subject: Re: PortletPreferences
ok, thanks
----- Original Message -----
From: "Ate Douma" <[EMAIL PROTECTED]>
To: [email protected]
Sent: Sunday, June 8, 2008 1:43:59 AM GMT +01:00 Amsterdam / Berlin /
Bern / Rome / Stockholm / Vienna
Subject: Re: PortletPreferences
Carlo Cavallieri wrote:
>
> Hi all,
>
>
>
> how can i access the PortletPreferences from an action with the bridge?
I guess you're talking about the Struts Bridge?
For the Struts Bridge, it currently provides only "transparent" Struts
features, meaning those that will work both
inside a standard web container and a portlet container.
Portlet specific features are easily accessible but will require to make
use of the portlet api itself as described in
Chapter PLT.16 of the Portlet API specification, see:
http://www.jcp.org/en/jsr/detail?id=168
Within an Struts Action, you can retrieve the PortletRequest as request
attribute with name: "javax.portlet.request"
And once you have the PortletRequest your can simple invoke
PortletRequest.getPreferences().
>
> Is there a standard way or an alternative solution to have something
similar to the PortletPreferences?
Well, having a similar/parallel feature available (for Struts) in a
standard web container would be very interesting,
something I've been thinking of myself before providing (and thereby
having a transparent solution for the Struts
Bridge), but never found time (nor actual demand) doing so.
FYI: the same "issue" is coming up for the Wicket framework for which I
wrote the Portlet support as well.
Chances are, we'll add something like the PortletPreferences for Wicket
soon, and maybe that'll be transferable to the
Struts Bridge too. But so far nothing has been written yet so time will
tell...
Regards,
Ate
>
>
>
> thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
------------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]