You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by ev...@canada.com on 2005/02/03 04:26:23 UTC
Dynamic Portlet loader is it possible?
Dynamic Portlet loader is it possible?
----------------------------------------
Hi:
I would like to know if the following concept would be
feasible in Jetspeed 2.
Let me explain it with an example
.I have 4 portlets
called as follow  P1, P2, P3 and P4
The PSML page only shows P1 and P2 to the user.
The user would see P1 and P2
click a link on P1 and
then in the P2 would either render P1, P2, P3 or P4.
This P2 would receive a message and with that message
it would know which Portlet to load
.by default it
could load an empty Portlet.
I am not sure if this is clear but the concept
could/would be called a dynamic Portlet loader and
thats what P2 would be.
If you need more clarification let me know.
Is it even remotely possible? I am looking for some
food for toughts/ideas/or if it is already implemented
somewhere.
Evian
PS: Thanks you all for all previous answers. That
really helped me.
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org
Re: Dynamic Portlet loader – is it possible?
Posted by Andrew Hill <an...@gridnode.com>.
Ive been doing something like this (with JSR168 portlets).
Dont have time to explain in great detail, but the way it works is that
all the portlets are actually the same portlet class, and based on an
'operation name' it delegates the actual work to another helper class
thats mapped to that operation name (its a front controller pattern
(like the one in struts with actionservlet delegating to action)). I use
an init-param to set the name of portlets initial 'operation'.
Each portlet also has its own 'message queue' (which is really just an
array list in the session (app scope)). In the action of portlet A we
can send portlet B a 'message' by adding to Bs message list that
instructs it to switch its operation. Each portlet checks its queue in
render method and changes its op if its gets a message to do so.
Additionally if we keep operation state in a stack structure we can have
an operation switch to another - and come back later to where it left
off. This is good for where in click in portlet A causes portlet A to go
do something else in portlet As box on the screen, and then later comes
back without losing input state. (ie: menus, subforms, detail screens,
drilldowns, etc...).
It took about 2k lines of code to get it working nicely (and Ive a lot
of tweaking to go) but its for a large complex app and has to support
lots of functions - you could probably have something similar based on
these principles up in a quarter of that depending on how simple you
want to make it.
sorry I cant be more detailed (right now anyhow)
hth
Andrew
evian_spring@canada.com wrote:
> Dynamic Portlet loader – is it possible?
> ----------------------------------------
>
> Hi:
>
> I would like to know if the following concept would be
> feasible in Jetspeed 2.
>
> Let me explain it with an example….I have 4 portlets
> called as follow  P1, P2, P3 and P4
>
> The PSML page only shows P1 and P2 to the user.
>
> The user would see P1 and P2…click a link on P1 and
> then in the P2 would either render P1, P2, P3 or P4.
> This P2 would receive a message and with that message
> it would know which Portlet to load….by default it
> could load an empty Portlet.
>
> I am not sure if this is clear but the concept
> could/would be called a dynamic Portlet loader and
> that’s what P2 would be.
>
> If you need more clarification let me know.
>
> Is it even remotely possible? I am looking for some
> food for toughts/ideas/or if it is already implemented
> somewhere.
>
> Evian
>
> PS: Thanks you all for all previous answers. That
> really helped me.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org