portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Sean Taylor" <da...@bluesunrise.com>
Subject Re: Portlet with state
Date Wed, 23 Jan 2002 22:04:15 GMT
You can keep state-per-portlet instance with the service:
org.apache.jetspeed.portal.servicePersistence

The easist way to use the Persistence service is with your portlet's
getAttribute()/setAttribute methods.

Of course you can come up with your own scheme using a hashmap or Turbine's
getTemp.

The current persistence service 'fails' if you have the same portlet twice
on the same page.
Perhaps you can extend the service to key the portlet on portletname +
position....


----- Original Message -----
From: "Glenn Golden" <ggolden@umich.edu>
To: "Jetspeed-Dev (E-mail)" <jetspeed-dev@jakarta.apache.org>
Sent: Wednesday, January 23, 2002 12:13 PM
Subject: Portlet with state


> I'm looking for the best way to acomplish a portlet with state.
>
> Imagine a portlet that has three different "views", or displays a user
might
> see: v1, v2 and v3.
>
> vI presents a "next" button, which when pressed, causes the portal page to
> redisplay with the portlet showing v2.
> v2 presents a "next" button which leads in the same way to v3, and a
"back"
> button which leads back to v1.
> v3 presents a "back" button which leads to v2.
>
> Lets say we want this portlet to keep some sort of state, so that it known
> which of the views to display when asked for content.
>
> Consider that:
> - the portlet may be on more than on user's portal page
> - that any user may have the portlet more than once on her portlet page,
and
> - that any user may have his portlet page opened in multiple browser
> windows, in the same "session", at once.
> In each of the cases, the portlet state is independent.
>
> The question is, where does the Portlet keep state?  It cannot keep state
in
> instance variables of the class, as the same portlet class instance may be
> used to service the requests from all users.
>
> The session seems to be the place to store a "state object" that the
portlet
> can use. If so, we need to make a key for this object so the portlet can
> find which state to use for each request.  The key needs to distinguish
the
> states for the above possibilities, so must identify the portlet class,
the
> position of the portlet in the portal page, and which portal page it is.
The
> session already separates out different users.
>
> The only thing left for this key is to distinguish between the same
portlet
> page opened more than once in the same session. Is this a feature that we
> want a portal engine to support? I'm not sure how to do this.
>
> This might work. But is it the best solution? Is it this the intention of
> the portlet api designers? Or is there some portlet feature I'm
overlooking
> here that takes care of this?
>
> Thanks.
>
> - Glenn R. Golden
>
>
> --
> To unsubscribe, e-mail:
<mailto:jetspeed-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:jetspeed-dev-help@jakarta.apache.org>
>
>



--
To unsubscribe, e-mail:   <mailto:jetspeed-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:jetspeed-dev-help@jakarta.apache.org>


Mime
View raw message