Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Registered resources are not loaded when installing bundles manualy?
icon5.gif  Registered resources are not loaded when installing bundles manualy? [message #489889] Tue, 06 October 2009 12:43 Go to next message
Eduard  is currently offline Eduard Friend
Messages: 29
Registered: September 2009
Junior Member
Hello Rich Ajax Community! Smile

I have a problem with registered resources to the extension point 'org.eclipse.rap.ui.resources'.

I followed the tutorial to create a custom google maps widget. When I start my run configuration with the widget bundle right from the beginning, the registered resources like the GMap.js is going to be registered by the ResourceManager (the getLocation method is invoked). Everything is ok.

But when I don't include my widget bundle in the run configuration and install and start that bundle manualy through the equinox console, no resource is going to be registered (getLocation method is not invoked). The widget can't find the java script class and throughs an error.

Why is the resource manager not able to register resource extensions on the fly while bundles are coming and going? I asume that the RM is scanning the extension registry once only at the beginning when equinox ist starting.

Is it possible to register ressources through the resource manager manualy in my code or is there any other trick that could solve this problem?

Best regards
Eduard
Re: Registered resources are not loaded when installing bundles manualy? [message #489924 is a reply to message #489889] Tue, 06 October 2009 14:02 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
Eduard,

the resources extension (org.eclipse.rap.ui.resources) is read only
once when the first session is started.
To ResourceManager programmatically, call:
RWT#getResourceManager()
However, Javascript resources that are registered after the first
session was created will not be included in the index.html page.

HTH
Rüdiger

Eduard wrote:
> Hello Rich Ajax Community! :)
>
> I have a problem with registered resources to the extension point
> 'org.eclipse.rap.ui.resources'.
>
> I followed the tutorial to create a custom google maps widget. When I
> start my run configuration with the widget bundle right from the
> beginning, the registered resources like the GMap.js is going to be
> registered by the ResourceManager (the getLocation method is invoked).
> Everything is ok.
>
> But when I don't include my widget bundle in the run configuration and
> install and start that bundle manualy through the equinox console, no
> resource is going to be registered (getLocation method is not invoked).
> The widget can't find the java script class and throughs an error.
>
> Why is the resource manager not able to register resource extensions on
> the fly while bundles are coming and going? I asume that the RM is
> scanning the extension registry once only at the beginning when equinox
> ist starting.
>
> Is it possible to register ressources through the resource manager
> manualy in my code or is there any other trick that could solve this
> problem?
>
> Best regards
> Eduard
>
Re: Registered resources are not loaded when installing bundles manualy? [message #489954 is a reply to message #489889] Tue, 06 October 2009 15:17 Go to previous messageGo to next message
Eduard  is currently offline Eduard Friend
Messages: 29
Registered: September 2009
Junior Member
Thank you for the fast reply Rüdiger.

And there is no way to solve this problem? RWT.getResourceManager().register("path") actually registers new ressources, but don't sends js files to the broweser?

Could I, theoreticaly, write some own java script in the widget renderInitialazation() method and load the js file that way instead using the helper methods from the JSWriter (writer.newWidget( "org.eclipse.rap.gmaps.GMap" ))?

Hmm, there is no description of the JSWriter in the API-Reference. Did somebody forgot that class? Smile

regards
Eduard
Re: Registered resources are not loaded when installing bundles manualy? [message #490441 is a reply to message #489954] Thu, 08 October 2009 16:14 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
Eduard wrote:
> Thank you for the fast reply Rüdiger.
>
> And there is no way to solve this problem?
> RWT.getResourceManager().register("path") actually registers new
> ressources, but don't sends js files to the broweser?
>
> Could I, theoreticaly, write some own java script in the widget
> renderInitialazation() method and load the js file that way instead
> using the helper methods from the JSWriter (writer.newWidget(
> "org.eclipse.rap.gmaps.GMap" ))?
This is the way to go if you can't activate your bundle before
session startup.

>
> Hmm, there is no description of the JSWriter in the API-Reference. Did
> somebody forgot that class? :)
Ups, looks like we forgot to include them in the reference. We'll
fix that.

>
> regards
> Eduard
Re: Registered resources are not loaded when installing bundles manualy? [message #490552 is a reply to message #489889] Fri, 09 October 2009 06:53 Go to previous message
Onno  is currently offline Onno Friend
Messages: 7
Registered: September 2009
Junior Member
Hi Eduard,
i had the same problem and wrote my own ResourceManager to solve this.
I read in the javascript files manually with a streamreader, put all resources together in one big byte array and serve this to the browser using a servicehandler. This byte array is updated everytime a bundle comes or goes and makes a contribution to the ResourceManager

Additonally, I wrote a small static method in a qooxdoo class which is able to load and eval the js code from the service handler during runtime. (see qx.io.remote.Request(url))

Now you can invoke this method using a HtmlResponseWriter passing an url to it. I invoke the method every time a display is rendered using a PhaseListener.

Greetings
Onno

Previous Topic:Looking 4 Eclipselink/DataBinding Best Practice
Next Topic:Headless RAP application build example
Goto Forum:
  


Current Time: Thu Apr 25 04:02:36 GMT 2024

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

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

Back to the top