Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » RAP ApplicationConfiguration and automed WorkbenchApplicationConfigurator
RAP ApplicationConfiguration and automed WorkbenchApplicationConfigurator [message #1022046] Thu, 21 March 2013 07:30 Go to next message
Markus Duft is currently offline Markus Duft
Messages: 131
Registered: February 2013
Senior Member
Hey!

I was trying to add an additional ClientProvider to my RAP application for testing. For this i

1) Implemented the ClientProvider, currently just sysout's something and does not handle anything at all.
2) Added an ApplicationConfiguration which adds the ClientProvider and delegates to WorkbenchApplicationProvider to do the magic.
3) registered a ApplicationConfiguration.class service in my Activator.

At this point, the application starts, and my ApplicationConfiguration is called fine. However the ClientProvider that i register ("((ApplicationImpl) application).addClientProvider(new ThinClientProvider());") is never called at all. Now i figured, that (when setting a breakpoint at EntryPointManager) i have multiple instances of all the things (EntryPointManager, Application, ...). It now depends on the order in which entry points are found.

if the entry point from the /first/ created application is found, the application starts fine, but my ClientProvider is not on board. If (through registering the entry point in a different path) i force the second created application into place, everything starts, but i get not a single image (i bet they are bound to the first application..?). All places with image just stay empty.

If i then play a little more, and again try to launch an entry point from the first application, i even get "Resource does not exist: generated/2e1e93b7.png"

i also tried to remove the entry point from my plugin.xml and do the registration on my own (delegating all but registerEntryPoints to WorkbenchApplicationConfigurator), and ended up with only a single registration in the system for my entry points (cool!). However, the rap.osgi Activator still starts the Workbench application automatically, which seems to (still) destroy images (all stay empty Sad ).

is this known, is there a workaround? what can i do? i don't want my client to have to parse the startup page html and do other tricks with session ids, etc. /and/ i'd love to avoid to have to modify RAP plugins Wink is what i do the correct thing (i.e. register a ApplicationConfiguration service in the Activator)? is there another way to prevent the rap.osgi activator from doing those things? playing with startlevels in the launch config did not solve the problem either... Sad

Thanks!
Re: RAP ApplicationConfiguration and automed WorkbenchApplicationConfigurator [message #1022457 is a reply to message #1022046] Thu, 21 March 2013 22:56 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf Sternberg
Messages: 1291
Registered: July 2009
Senior Member

Hi Markus,

It seems that you're running into bug 386504 [1]. At the moment, you
cannot combine the workbench with an application configuration, which is
probably the cause for having two applications. I'd suggest that you get
rid of the org.eclipse.rap.ui bundles and test your thin client with a
plain RWT application.

Does that help?

Regards, Ralf

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=386504


On 03/21/2013 08:30 AM, Markus Duft wrote:
> Hey!
>
> I was trying to add an additional ClientProvider to my RAP application
> for testing. For this i
>
> 1) Implemented the ClientProvider, currently just sysout's something and
> does not handle anything at all.
> 2) Added an ApplicationConfiguration which adds the ClientProvider and
> delegates to WorkbenchApplicationProvider to do the magic.
> 3) registered a ApplicationConfiguration.class service in my Activator.
>
> At this point, the application starts, and my ApplicationConfiguration
> is called fine. However the ClientProvider that i register
> ("((ApplicationImpl) application).addClientProvider(new
> ThinClientProvider());") is never called at all. Now i figured, that
> (when setting a breakpoint at EntryPointManager) i have multiple
> instances of all the things (EntryPointManager, Application, ...). It
> now depends on the order in which entry points are found.
>
> if the entry point from the /first/ created application is found, the
> application starts fine, but my ClientProvider is not on board. If
> (through registering the entry point in a different path) i force the
> second created application into place, everything starts, but i get not
> a single image (i bet they are bound to the first application..?). All
> places with image just stay empty.
>
> If i then play a little more, and again try to launch an entry point
> from the first application, i even get "Resource does not exist:
> generated/2e1e93b7.png"
>
> i also tried to remove the entry point from my plugin.xml and do the
> registration on my own (delegating all but registerEntryPoints to
> WorkbenchApplicationConfigurator), and ended up with only a single
> registration in the system for my entry points (cool!). However, the
> rap.osgi Activator still starts the Workbench application automatically,
> which seems to (still) destroy images (all stay empty :( ).
>
> is this known, is there a workaround? what can i do? i don't want my
> client to have to parse the startup page html and do other tricks with
> session ids, etc. /and/ i'd love to avoid to have to modify RAP plugins
> ;) is what i do the correct thing (i.e. register a
> ApplicationConfiguration service in the Activator)? is there another way
> to prevent the rap.osgi activator from doing those things? playing with
> startlevels in the launch config did not solve the problem either... :(
>
> Thanks!




--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: RAP ApplicationConfiguration and automed WorkbenchApplicationConfigurator [message #1022603 is a reply to message #1022457] Fri, 22 March 2013 08:12 Go to previous messageGo to next message
Markus Duft is currently offline Markus Duft
Messages: 131
Registered: February 2013
Senior Member
Ah, thanks for pointing me to the bug. And to answer "does it help" in german: "jein". My situation is that i don't want to have multiple applications. i just want to have one application, actually, i also want to have only one entry point into it.

what i ultimately need is that the application sends me a plain json response if the thin client connects, and not the rwt-index.html. Now figuring from the code, i saw that i don't wan to use WebClient for the thin client, so i figured also, that i need a ClientProvider. Going from there i searched for a mechanism to register it - and found no clean one... any chance to get one? something like an extension point? that would /really/ help (i'll happily report a bug for it (should i?), but i think actually the change is trivial!)

Smile

Thanks for the help,
Markus
Re: RAP ApplicationConfiguration and automed WorkbenchApplicationConfigurator [message #1022610 is a reply to message #1022603] Fri, 22 March 2013 08:29 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1839
Registered: July 2009
Senior Member
Hi Markus,
in your application configure method you register a ClientProvider. The
ClientProvider#getClient() should return your ThinClient. Don't forget
to override the ClientProvider#accept as well to return true. If the
client which accepts the request is different than the WebClient a plain
json message will be return instead of HTML page.
HTH,
Ivan

On 3/22/2013 10:12 AM, Markus Duft wrote:
> Ah, thanks for pointing me to the bug. And to answer "does it help" in
> german: "jein". My situation is that i don't want to have multiple
> applications. i just want to have one application, actually, i also
> want to have only one entry point into it.
>
> what i ultimately need is that the application sends me a plain json
> response if the thin client connects, and not the rwt-index.html. Now
> figuring from the code, i saw that i don't wan to use WebClient for
> the thin client, so i figured also, that i need a ClientProvider.
> Going from there i searched for a mechanism to register it - and found
> no clean one... any chance to get one? something like an extension
> point? that would /really/ help (i'll happily report a bug for it
> (should i?), but i think actually the change is trivial!)
>
> :)
>
> Thanks for the help,
> Markus

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: RAP ApplicationConfiguration and automed WorkbenchApplicationConfigurator [message #1022625 is a reply to message #1022610] Fri, 22 March 2013 08:55 Go to previous messageGo to next message
Markus Duft is currently offline Markus Duft
Messages: 131
Registered: February 2013
Senior Member
yeah, i have all that, but i don't want to doom my Workbench application. my application is configured through WorkbenchApplicationConfigurator, and i'd like to hook in there. unfortunately thats not possible, so i created a /second/ ApplicationConfiguration which does exactly that (add a ClientProvider). The problem is that i have a second ApplicationImpl instance in that case, and the applications (though using the same code) are different. This destroys everything.

An extension point evaluated by WorkbenchApplicationConfigurator to add additional ClientProviders would really be a helpful thing.
Re: RAP ApplicationConfiguration and automed WorkbenchApplicationConfigurator [message #1022640 is a reply to message #1022625] Fri, 22 March 2013 09:20 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf Sternberg
Messages: 1291
Registered: July 2009
Senior Member

Hi Markus,

the workbench cannot be used with custom clients for the reason you just
discovered. There's currently no solution and, since the 3.x workbench
is becoming a legacy, I don't think that we should create any additional
extension points.

However, what we could think about is to
a) provide some kind of setting that prevents the workbench from
autostarting and
b) provide a hook to start the workbench from a custom application
configuration.

Does that sound reasonable?

Regards, Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: RAP ApplicationConfiguration and automed WorkbenchApplicationConfigurator [message #1022656 is a reply to message #1022640] Fri, 22 March 2013 09:47 Go to previous messageGo to next message
Markus Duft is currently offline Markus Duft
Messages: 131
Registered: February 2013
Senior Member
that'd be perfect for me! i already have the configuration, and if the workbench wouldn't autostart, my configuration would still register the entry point Smile

Thanks!
Re: RAP ApplicationConfiguration and automed WorkbenchApplicationConfigurator [message #1022660 is a reply to message #1022656] Fri, 22 March 2013 09:55 Go to previous messageGo to next message
Markus Duft is currently offline Markus Duft
Messages: 131
Registered: February 2013
Senior Member
tell me as soon as there is a nightly which i can test Very Happy i will immediately switch my target platform Wink
Re: RAP ApplicationConfiguration and automed WorkbenchApplicationConfigurator [message #1022760 is a reply to message #1022660] Fri, 22 March 2013 13:23 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf Sternberg
Messages: 1291
Registered: July 2009
Senior Member

Markus,

could you please open a new bug for this suggestion? I'm off for
EclipseCon now and will look into it when I find some time after that.
Providing a quality patch can speed up things.

Regards, Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: RAP ApplicationConfiguration and automed WorkbenchApplicationConfigurator [message #1022782 is a reply to message #1022760] Fri, 22 March 2013 14:11 Go to previous message
Markus Duft is currently offline Markus Duft
Messages: 131
Registered: February 2013
Senior Member
here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=404144

i might find time to look into it, and test a patch for it Smile
Previous Topic:RAP 2.1 M1 is available
Next Topic:GC Captcha and all toher stuff
Goto Forum:
  


Current Time: Thu Oct 23 12:40:13 GMT 2014

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

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