portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glenn Golden <ggol...@umich.edu>
Subject Portlet with state
Date Wed, 23 Jan 2002 20:13:27 GMT
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>


Mime
View raw message