Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » directing the rap application with normal HTTP calls
directing the rap application with normal HTTP calls [message #127064] Fri, 03 April 2009 12:19 Go to next message
Henzler Peter is currently offline Henzler PeterFriend
Messages: 19
Registered: July 2009
Junior Member
Hi

I would like to direct the running rap application with normal http calls.

The use case:
The user opens a rap application with http://www.xyz.com/myrapapp.
This brings up the rap application in the browser window. After some
clicks a editor is displayed with a browser widget showing a html document.
Hyperlinks in the document are not directly to the linked document but
should make a normal (not rap specific) http-call like:
http://www.xyz.com/myrappapp/openDocumentInNewEditor?url=url ofthedocument
As a result of this call the rap application should open a new editor with
a browser widget showing the requested document.

A call of the rap application with a new entrypoint is not acceptable
because the whole rap application would be loaded new.
The rap application should keep his current state and doing some UI
actions as result of the http call.

How can this be done?
I have a vage idea of a servlet that is running in the same context as the
rap application and is able to call methods of the rap application. In
this case the method call would tell the rap application to open a new
editor to display the document with the specified URL.

Thank you for your suggestions.

Kind regards
Peter Henzler
Re: directing the rap application with normal HTTP calls [message #127135 is a reply to message #127064] Fri, 03 April 2009 15:16 Go to previous messageGo to next message
Stefan   is currently offline Stefan Friend
Messages: 316
Registered: July 2009
Senior Member
Hi Peter,

I think this can't be done as described. RAP currently doesn't support
running multiple instances within the same browser.

Maybe you can use a button, link widget or similar to open the documents
within the running app? If you *must* have standard http-links you could
let point them to a custom ServiceHandler that opens the documents in
the running app and uses UICallbacks to refresh the browser content.
However, this requires some additional work...

Regards,
Stefan.

Henzler Peter schrieb:
> Hi
>
> I would like to direct the running rap application with normal http calls.
>
> The use case:
> The user opens a rap application with http://www.xyz.com/myrapapp.
> This brings up the rap application in the browser window. After some
> clicks a editor is displayed with a browser widget showing a html document.
> Hyperlinks in the document are not directly to the linked document but
> should make a normal (not rap specific) http-call like:
> http://www.xyz.com/myrappapp/openDocumentInNewEditor?url=url ofthedocument
> As a result of this call the rap application should open a new editor
> with a browser widget showing the requested document.
>
> A call of the rap application with a new entrypoint is not acceptable
> because the whole rap application would be loaded new.
> The rap application should keep his current state and doing some UI
> actions as result of the http call.
>
> How can this be done?
> I have a vage idea of a servlet that is running in the same context as
> the rap application and is able to call methods of the rap application.
> In this case the method call would tell the rap application to open a
> new editor to display the document with the specified URL.
>
> Thank you for your suggestions.
>
> Kind regards
> Peter Henzler
>
>
>
>
>
Re: directing the rap application with normal HTTP calls [message #127274 is a reply to message #127135] Mon, 06 April 2009 07:00 Go to previous messageGo to next message
p-lex is currently offline p-lexFriend
Messages: 18
Registered: July 2009
Junior Member
> Henzler Peter schrieb:

> The user opens a rap application with http://www.xyz.com/myrapapp.
> This brings up the rap application in the browser window. After some
> clicks a editor is displayed with a browser widget showing a html document.
> Hyperlinks in the document are not directly to the linked document but
> should make a normal (not rap specific) http-call like:
> http://www.xyz.com/myrappapp/openDocumentInNewEditor?url=url ofthedocument
> As a result of this call the rap application should open a new editor
> with a browser widget showing the requested document.

Do you want to use the http-call just for starting the application in a
special state(start of a rap-session) or do you want to use such
http-links during a rap-session more then one time?

If you want to use such a link just to start a rap-session you can use
your own parameters to tell the application what to do. To open a document
you could define a parameter "openDocumentID" and look inside your
entry-point for it to open the editor if a value is given.

So you call e.g.
http://127.0.0.1:10080/rap?startup=myEntryPoint&openDocu mentID=myDocument_xyz

In the createUI method of your EntryPoint you have to check for this
Property e.g. like this:

String docID = RWT.getRequest().getParameter("openDocumentID");
if(docID != null)
{
// do open docID
}
Re: directing the rap application with normal HTTP calls [message #127326 is a reply to message #127135] Mon, 06 April 2009 11:42 Go to previous messageGo to next message
Henzler Peter is currently offline Henzler PeterFriend
Messages: 19
Registered: July 2009
Junior Member
Yes, I think what you discribe is what I need:
A handler that can be invoked by http call that invokes actions as a
result of the call inside the running rap application (open an new rap
editor view and show the desired content in it) the same way as if the
user had liked on a button or link in the rap UI.

Can you point me to some documentation or example how such an
ServiceHandler can be programmed?
Re: directing the rap application with normal HTTP calls [message #127334 is a reply to message #127274] Mon, 06 April 2009 11:48 Go to previous messageGo to next message
Henzler Peter is currently offline Henzler PeterFriend
Messages: 19
Registered: July 2009
Junior Member
No I don't want to leave my running rap instance. So calling an entry
point is not desired because I would lose the whole application state.
I just want the running rap application to perform actions as a result of
a http call the same way as if the action is invoked in the rap UI.
Re: directing the rap application with normal HTTP calls [message #127429 is a reply to message #127326] Tue, 07 April 2009 08:18 Go to previous message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
To et started, have a look at the IServiceHandler JavaDoc

Henzler Peter wrote:
> Yes, I think what you discribe is what I need:
> A handler that can be invoked by http call that invokes actions as a
> result of the call inside the running rap application (open an new rap
> editor view and show the desired content in it) the same way as if the
> user had liked on a button or link in the rap UI.
>
> Can you point me to some documentation or example how such an
> ServiceHandler can be programmed?
>
Previous Topic:Using DOJO in custom widgets + AJAX
Next Topic:Multi-column TreeViewer Rendering Problems (possibly a bug?)
Goto Forum:
  


Current Time: Thu Apr 25 04:47:45 GMT 2024

Powered by FUDForum. Page generated in 0.03466 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top