-
1. Re: Share data between portlets for each user session
gavin.king Jun 16, 2006 9:30 PM (in response to endremr)No, portlet session are portlet-local. There is no standard way to do inter-portlet communication in the portlet spec, but most products provide some proprietary APIs.
It is something I need to look into more closely with Roy. -
2. Re: Share data between portlets for each user session
endremr Jun 17, 2006 4:13 PM (in response to endremr)It that true for Seam applications? I thought that Seam was a bit close to JBoss Portal. I have read different places that JBoss Portal supports interportel communication if they are build into the same portlet application.
Quote:
"Any object stored in the session using the APPLICATION_SCOPE is available to any other portlet that belongs to the same portlet application and that handles a request identified as being part of the same session."
From page:
http://jboss.org/index.html?module=bb&op=viewtopic&t=66156&view=previous
Doesn't seam support this? Then my question is how I can access the PortletSession from Seam. Is that possible?
Thanks again! :) -
3. Re: Share data between portlets for each user session
endremr Jun 19, 2006 6:11 AM (in response to endremr)Sorry for answering myself!
Now I've found a way to solve my problem. It works when I use the PortletSession and the APPLICATION_SCOPE. Now I have also found the way to get the PortletSession from Seam:
((javax.portlet.PortletRequest) getFacesContext().getExternalContext().getRequest()).getPortletSession(); -
4. Re: Share data between portlets for each user session
gavin.king Jun 20, 2006 7:17 AM (in response to endremr)I have a roadmap item to look at integrating JBoss Portal's IPC stuff with Seam. But I have not done any of the research I need to do to understand this stuff properly yet.
-
5. Re: Share data between portlets for each user session
theute Jun 20, 2006 7:27 AM (in response to endremr)Yes in Portal per the spec there are 2 scopes of session, portlet and application scope.
Currently in Seam we only support Portlet scope.
IPC is different, it doesn't have any context, it just trigger events that other portlets are listening to. -
6. Re: Share data between portlets for each user session
gavin.king Jun 20, 2006 7:52 AM (in response to endremr)Originally, I had actually planned a PORTLET_SESSION scope distinct from the SESSION scope. But then from Roy I got the impression that use of the global session scope was considered a Bad Thing. Perhaps we need to revisit that discussion.
On the IPC stuff, it is an event architecture, and so it is ripe for abstraction by Seam. -
7. Re: Share data between portlets for each user session
theute Jun 20, 2006 8:14 AM (in response to endremr)SESSION scope is misused to do IPC in a standard way (It's the only way that would work on any JSR168 portlet container).
There is no real logic for application session scope. -
8. Re: Share data between portlets for each user session
gavin.king Jun 20, 2006 12:53 PM (in response to endremr)Well, I guess I'm just not quite convinced that this is always a misuse...
-
9. Re: Share data between portlets for each user session
tuomas_kiviaho Jun 21, 2006 6:45 AM (in response to endremr)I thought I'd seen a portlet scope, that is PortletSession.APPLICATION_SCOPE reservation in earlier seam documentations and wondered what has happened when the time came for it to be used.
I'd rather be "misusing" session with Seam annotations than doing it "by-the-book" without Seam support. IPC of JBoss Portal is quite compact solution - one of the best in my opinion - in it's simplicity but not a solution that can be used with other portal containers. Also there is that one-to-one relationship between portlets restriction.
I hope that this scope will come as part of Seam although it's directly supported by JSF and causes tight coupling with portlet api since I don't think new contexts below conversation can plugged in just like that allowing them to be truly optional.
Mimicking IPC with Seams remote JMS capability seems to be an option, but I see that it may change radically in the future.
One hack that came into my mind is to make ExternalContext session dynamically selectable. This only shifts problems to other areas even when not needing instance spesific sessions, since somehow JSF needs to transfer the state over portlet's processAction to renderRequest. This may even be against JSF spec and it doesn't concern the Seam implementation. Note that it requires access to the JSF binaries. I wouldn't go this way myself all the way, but this could propably be used to some sort of prototyping due to the benefit gained from Seam annotations that avoid completely the use of
((javax.portlet.PortletRequest) getFacesContext().getExternalContext().getRequest()).getPortletSession(). Knowledge of how MyFaces PortletExternalContext works is needed.