[jboss-user] [JBoss Portal] - Re: Clear/reset render parameters or re-initialise all portl

Antoine_h do-not-reply at jboss.com
Mon Jan 28 11:04:36 EST 2008


Hi,

in the JSR-168, the portlets of a portal are not supposed to know what the other portlets are doing...

so, this cannot be done with the jboss portal (or any) that is compliant with jsr 168.

well, you can go further than the jsr.

looking at the api of jboss portal may be a way.
but looks to me quite tricky... as you must be sure not to disturb the whole mechanism, and it may be a problem when you upgrade etc...

you can do it with some communication between portlets of a portal : IPC (Inter Portlet Communication).
with this, you modify things only at the portlet level : you don't modify the inner engine...

IPC is planned for version 2 of the jsr.
some things have been done yet in jboss portal and in some add on libraries.

so, the way I would do that : 
 - set some IPC (Inter Portlet Communication) between the selector portlet and the portlets that need to reset their state and render the new state.
 - in the action phase of the portlet, send a message to the involved portlets, so they re-initialize their state
 - in their render phase, the catch the message, and reset the parameter (that is where you are out of the jsr : this kind of thing should be done only in the action phase of the portlet... )
 - then they will render, with the new state definition.
 - also, think to clear the cache
 - be aware that with ajax feature, the whole page rendering is not triggered, that is some portlet rendering is not triggered (with JB Portal 2.6 and pages/portlets with ajax feature...like the dashboard, etc...)

about the IPC : 
You need IPC "by message", and not by triggering an event.
You need to dispatch the signal to several portlets, so message can do that, and as far as I remember, event cannot (only one portlet for destination).

I don't know how far the JB Portal is now about IPC.
look at the samples (version 2.6 recommended...).
for what was in the very begining of it with 2.4, it was some IPC by events.

look at the Michelle Osmond feature and library :
http://mus.purplecloud.net/portlets/thesis/ipc.php
I use it... it is a very good help for IPC (both theory and library).
It is better to implement your own storage mechanism of messages, but you can still start with the things she provide... (and later make your own strong feature for production reliability).

look for the posts on this forum about that.

for the cache : 
It is necessary to keep some cache feature : would be bad for performance to get rid of it in the portlet descriptor.
so, you have to implement a way to clear the cache of all the portlets.
I have not done it yet (stand by for this feature in my portal), but I had seen how to do it... it can be done... and not so complicated.
you must override the cache management JMX service with yours, and add your feature (clear all portlet cache when asked by the selector).
may be you do that as a contribution to the jboss portal ?
ask Thomas Heute for advice for that (or may be developper forum).
I would appreciate... less to do for me...
idem : look for the posts on this forum on how to manage the cache of portlets.

ajax features : idem, the ajax features may add some complication if you want all the portlet to be re-rendered with the new state...
don't know exactly how to manage that... it will depend on your portal and portlets...



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

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



More information about the jboss-user mailing list