[jboss-user] [JBoss Portal] - Re: Page-level parameters for requests: how to create bookma

Antoine_h do-not-reply at jboss.com
Mon Aug 7 19:46:28 EDT 2006


Hello,

I am thinking of another way, that does not deal do much with servlet and deep mechanism.

if I understand well your will, you want to get some parameters before the rendering process has started, and share them with all the portlets.

For "intercepting" these parameters, you can build your own CommandFactories, derived from the one provided with jbp.
They filters the parameters that you want to share and send them, through a message store, to all the portlets that will need it.

as a message store and sharing parameter implementation, you can use the M. Osmond implementation.
see this post : http://jboss.org/index.html?module=bb&op=viewtopic&t=87442
(this feature of sharing parameters seems also to be in preparation for JSR-168 2.0 and in jbp 2.4 with the access to the portal objects nodes).

The thing is to use the messaging implementation from inside a command factory, to send messages from there instead of from the portlets.
The message must be stored with a reference to a "Session ID".

In a Portlet, it uses the PortletSessionID to send the message.
In the CommandFactory, the message may be sent in the same way, but with providing the session id (coming from the httpSessionId). 
There's some work to do to adapt the messaging class, so it can do a send, with other parameters than the PortletRequest.
In the commandFactory, it seem you can retrieve the SessionID from the Invocation => Request => HttpRequest (to check really, I have just had a quick look at it).

To check : the portlet session Id must be the same as the http session id (which should be, but I am not sure the JSR ask for this... and quite sure not...)

To put your command factories in place of the one provided by jbp, you can use the service methods to unregister the ones and register yours in place off, or, more simple, replace the jboss-service.xml with yours, that say to use your classes instead of the one defined.

a lot of work, but it seems ok to work. 
I would set first the Messaging Portlet implementation, and check that the session identification for messages can be the same from the one that you get from the command factory, so you can send the message from there.
then see the command factory side. 
after, it should be easy. lot of setting, testing and tuning.

the advantage is not to deal with servlet stuff that much, but more "after", when the portal processes the request".
and by using the Messaging implementation, you can use it for other needs. It provide by itself a good way to manage this sharing of parameters issue, and good ideas on how to do it (multiple same portlet on one page, etc...).

hope it may help.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963681#3963681

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963681



More information about the jboss-user mailing list