RAP integration into WebSphere Portal [message #118444] |
Wed, 14 January 2009 06:41  |
Eclipse User |
|
|
|
Hi all!
I'm writing a bachelor thesis about how to integrate RAP applications into
WebSphere Portal. My current task is to provide a RAP app as a single
portlet.
The biggest problem seems to be missing "refresh" functionality to render
the current (UI-)state of the application again when it comes to portal
page refreshes.
At the moment I try to discover possible ways to achieve this. One thing
should be to redraw all widgets. According to the following method in
AbstractWidgetLCA WidgetAdapter initialization (and initial state
rendering) is done exactly once.
public final void render( final Widget widget ) throws IOException {
WidgetAdapter adapter = ( WidgetAdapter )WidgetUtil.getAdapter( widget );
if( !adapter.isInitialized() ) {
renderInitialization( widget );
widget.addDisposeListener( new DisposeListener() {
public void widgetDisposed( final DisposeEvent event ) {
DisposedWidgets.add( ( Widget )event.getSource() );
widget.removeDisposeListener( this );
}
} );
}
renderChanges( widget );
UITestUtil.writeId( widget );
adapter.setInitialized( true );
}
To render the current state of a widget after a refresh I think that both
initialzing the adapter and rendering the changes should work since the
widget itself should be unchanged.
Any thoughts on this?
I know that refreshing the page is more than simple widget redrawing but
that's just the first thing I had a look at.
Further comments are greatly appreciated!
Thanks,
Marian
|
|
|
|
|
Re: RAP integration into WebSphere Portal [message #119608 is a reply to message #118466] |
Mon, 26 January 2009 04:25   |
Eclipse User |
|
|
|
Hi Stefan,
> I'm not sure if re-rendering the widget makes sense to perform something
> like a refresh. In fact, you want to refresh the model of your widgets
> (e.g. perform a DB query or whatever), don't you? However, this can
> hardly be done genericly.
Maybe I didn't clearly point out what I'd like to achieve. Consider a very
simple RAP application with just a view with a checkbox inside. Clicking
on that checkbox causes a roundtrip to inform the server that the checkbox
has been checked or unchecked, so the server-side "knows" about the
widget's state. Now if you refresh the current page it should be possible
to render that checkbox again with it's current state, because the
relevant information should be available in the session. The same should
work if a portal page gets rendered again.
> In general, you also might run into trouble if you have more than one
> portlet, each containing a separate RAP application. The framework can't
> handle this at the moment.
This is another issue ;-)
Kind regards,
Marian
|
|
|
Re: RAP integration into WebSphere Portal [message #119659 is a reply to message #119608] |
Mon, 26 January 2009 08:57   |
Eclipse User |
|
|
|
Marian,
please see my comments below.
Cheers,
Rüdiger
Marian Seitner wrote:
> Hi Stefan,
>
>> I'm not sure if re-rendering the widget makes sense to perform
>> something like a refresh. In fact, you want to refresh the model of
>> your widgets (e.g. perform a DB query or whatever), don't you?
>> However, this can hardly be done genericly.
>
> Maybe I didn't clearly point out what I'd like to achieve. Consider a
> very simple RAP application with just a view with a checkbox inside.
> Clicking on that checkbox causes a roundtrip to inform the server that
> the checkbox has been checked or unchecked, so the server-side "knows"
> about the widget's state. Now if you refresh the current page it should
> be possible to render that checkbox again with it's current state,
> because the relevant information should be available in the session.
You are right, the relevant information is available and it would be
possible to enhance RAP so that it would update the client with the
current server-side state.
> The same should work if a portal page gets rendered again.
I don't know much about portlets but I currently see two obstacles:
* qooxdoo, the client-side Javascript library used by RAP, in its
current version assumes to be alone on the client document
* refreshing is significantly slower then usual request and if it
occurs frequently will probably make for a bad user experience
>
>> In general, you also might run into trouble if you have more than one
>> portlet, each containing a separate RAP application. The framework
>> can't handle this at the moment.
>
> This is another issue ;-)
>
> Kind regards,
> Marian
>
|
|
|
|
Re: RAP integration into WebSphere Portal [message #119908 is a reply to message #119672] |
Wed, 28 January 2009 05:27  |
Eclipse User |
|
|
|
Marian Seitner schrieb:
> Very good news :-) Naturally I'd like to know what enhancements have to
> be done to make this work. At this time I know about the following:
> * Session-reuse on page refresh; As far as I see a new session gets
> started everytime you refresh the page
> * Widget re-rendering (as already said)
> * Request handling/mapping to conform with portlet request flows (I'll
> come back on this topic soon)
> * ?
>
AFAIK the session doesn't survive a page refresh and I don't see any
possibility to change this behaviour. There's little documentation about
RAP internals, the best thing would be to try it out by yourself. To
be honest, I doubt that RAP/Qooxdoo is a good framework for portlets as
it is designed to write single page applications. However, I'm still
curious what you find out during your investigations :-)
Regards,
Stefan.
|
|
|
Powered by
FUDForum. Page generated in 0.04016 seconds