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 |
|
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!
|
|
|
Re: RAP ApplicationConfiguration and automed WorkbenchApplicationConfigurator [message #1022457 is a reply to message #1022046] |
Thu, 21 March 2013 22:56 |
|
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 |
|
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
|
|
|
Re: RAP ApplicationConfiguration and automed WorkbenchApplicationConfigurator [message #1022610 is a reply to message #1022603] |
Fri, 22 March 2013 08:29 |
Ivan Furnadjiev Messages: 2427 Registered: July 2009 Location: Sofia, Bulgaria |
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 |
|
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.
|
|
| | | | | |
Goto Forum:
Current Time: Tue Sep 24 12:25:45 GMT 2024
Powered by FUDForum. Page generated in 0.09426 seconds
|