Home » Eclipse Projects » Remote Application Platform (RAP) » Branding and images
|
Re: Branding and images [message #83209 is a reply to message #83176] |
Wed, 16 April 2008 04:13 |
Eclipse User |
|
|
|
Originally posted by: fappel.innoopract.com
Hi,
did you try the org.eclipse.rap.ui.resources extension point?
Ciao
Frank
-----Ursprüngliche Nachricht-----
Von: Patrick Turcotte [mailto:patrek@gmail.com]
Bereitgestellt: Dienstag, 15. April 2008 23:09
Bereitgestellt in: eclipse.technology.rap
Unterhaltung: Branding and images
Betreff: Branding and images
Hi,
We are trying to work with branding within our rap application.
We are able to use the branding extension (org.eclipse.rap.ui.branding)
with success to set Title, favicon, exitConfirmation, etc.
As for the "body", we create and link to an html fragment file without
any problems.
within this html fragment, we want to be able to call a splash image
(<img src="[relative url]/images/splash.jpg"/>).
Unfortunatly, we don't seem to be able to "export" an image resource.
The frustrating part is that our favicon file reside right beside our
splash file and is visible. It must obviously be registred somehow with
the branding extension.
Any pointers?
Thanks
Patrick
|
|
|
Re: Branding and images [message #83277 is a reply to message #83209] |
Wed, 16 April 2008 18:56 |
Patrick Turcotte Messages: 23 Registered: July 2009 |
Junior Member |
|
|
Hi,
Yes, after your suggestion. But without success.
There seems to be something we don't grasp in the mechanism. So, basically, it boils down to some questions.
Let's say we add the following extension:
<extension point="org.eclipse.rap.ui.resources">
<resource class="ui.rap.SplashImage" />
</extension>
1) In ui.rap.SplashImage, what should we return in the method getLocation() ?
2) Accordingly, where should we put the image file, under eclipse, in the plugin project ?
3) In body.html (branding) what url should we use to be able to display the image (<img src="[url]"/>)
Or is there another mechanism?
Thanks,
Patrick
> Hi,
>
> did you try the org.eclipse.rap.ui.resources extension point?
>
>
> Ciao
> Frank
>
> -----Ursprüngliche Nachricht-----
> Von: Patrick Turcotte [mailto:patrek@gmail.com]
> Bereitgestellt: Dienstag, 15. April 2008 23:09
> Bereitgestellt in: eclipse.technology.rap
> Unterhaltung: Branding and images
> Betreff: Branding and images
>
>
> Hi,
>
> We are trying to work with branding within our rap application.
>
> We are able to use the branding extension (org.eclipse.rap.ui.branding)
> with success to set Title, favicon, exitConfirmation, etc.
>
> As for the "body", we create and link to an html fragment file without
> any problems.
>
> within this html fragment, we want to be able to call a splash image
> (<img src="[relative url]/images/splash.jpg"/>).
>
> Unfortunatly, we don't seem to be able to "export" an image resource.
>
> The frustrating part is that our favicon file reside right beside our
> splash file and is visible. It must obviously be registred somehow with
> the branding extension.
>
> Any pointers?
>
> Thanks
>
> Patrick
>
|
|
|
Re: Branding and images [message #83370 is a reply to message #83277] |
Thu, 17 April 2008 07:39 |
Eclipse User |
|
|
|
Originally posted by: fappel.innoopract.com
Hi,
I think the problem is that the location where the file is stored,
differs from the URL you use in the body.html snippet. The reason for
this is that the location name you specify in the resource is prefixed
by the system with the given runtime bundle id, which you can't know by
creation time of the body.html. Sorry, I didn't think about that.
You can check this by looking up your image somewhere under the context
root of the rap application:
<path to eclipse
installation>\workspace\.metadata\.plugins\org.eclipse.rap.ui\context
(Note that this is the default under MS Windows without changing the
launch-config settings for the workspace)
But you can use a different approach to register the image without
bundle prefix:
- create an Activator for your bundle (skip this if you already have
one...)
- register the image in the activator's start method like this:
ClassLoader loader = Activator.class.getClassLoader();
IResourceManager manager = ResourceManager.getInstance();
ClassLoader bufferedLoader = manager.getContextLoader();
manager.setContextLoader( loader );
try {
String path = "path/to/image.jpg";
manager.register( path, loader, getResourceAsStream( path );
} finally {
manager.setContextLoader( bufferedLoader );
}
Note that for this solution the image has to be available at the given
path in the bundles classpath.
Hope that helps.
Ciao
Frank
-----Ursprüngliche Nachricht-----
Von: Patrick Turcotte [mailto:patrek@gmail.com]
Bereitgestellt: Mittwoch, 16. April 2008 20:56
Bereitgestellt in: eclipse.technology.rap
Unterhaltung: Branding and images
Betreff: Re: Branding and images
Hi,
Yes, after your suggestion. But without success.
There seems to be something we don't grasp in the mechanism. So,
basically, it boils down to some questions.
Let's say we add the following extension:
<extension point="org.eclipse.rap.ui.resources">
<resource class="ui.rap.SplashImage" />
</extension>
1) In ui.rap.SplashImage, what should we return in the method
getLocation() ?
2) Accordingly, where should we put the image file, under eclipse, in
the plugin project ?
3) In body.html (branding) what url should we use to be able to display
the image (<img src="[url]"/>)
Or is there another mechanism?
Thanks,
Patrick
> Hi,
>
> did you try the org.eclipse.rap.ui.resources extension point?
>
>
> Ciao
> Frank
>
> -----Ursprüngliche Nachricht-----
> Von: Patrick Turcotte [mailto:patrek@gmail.com]
> Bereitgestellt: Dienstag, 15. April 2008 23:09 Bereitgestellt in:
> eclipse.technology.rap
> Unterhaltung: Branding and images
> Betreff: Branding and images
>
>
> Hi,
>
> We are trying to work with branding within our rap application.
>
> We are able to use the branding extension
> (org.eclipse.rap.ui.branding) with success to set Title, favicon,
exitConfirmation, etc.
>
> As for the "body", we create and link to an html fragment file without
> any problems.
>
> within this html fragment, we want to be able to call a splash image
> (<img src="[relative url]/images/splash.jpg"/>).
>
> Unfortunatly, we don't seem to be able to "export" an image resource.
>
> The frustrating part is that our favicon file reside right beside our
> splash file and is visible. It must obviously be registred somehow
> with the branding extension.
>
> Any pointers?
>
> Thanks
>
> Patrick
>
|
|
|
Re: Branding and images [message #83469 is a reply to message #83370] |
Thu, 17 April 2008 16:31 |
Eclipse User |
|
|
|
Originally posted by: jkrause.innoopract.com
You can also use the
<extension
point="org.eclipse.equinox.http.registry.resources">
That makes it easier if you access the image only on the html page.
Jochen
Frank Appel wrote:
> Hi,
>
> I think the problem is that the location where the file is stored,
> differs from the URL you use in the body.html snippet. The reason for
> this is that the location name you specify in the resource is prefixed
> by the system with the given runtime bundle id, which you can't know by
> creation time of the body.html. Sorry, I didn't think about that.
>
> You can check this by looking up your image somewhere under the context
> root of the rap application:
> <path to eclipse
> installation>\workspace\.metadata\.plugins\org.eclipse.rap.ui\context
> (Note that this is the default under MS Windows without changing the
> launch-config settings for the workspace)
>
> But you can use a different approach to register the image without
> bundle prefix:
> - create an Activator for your bundle (skip this if you already have
> one...)
> - register the image in the activator's start method like this:
>
> ClassLoader loader = Activator.class.getClassLoader();
> IResourceManager manager = ResourceManager.getInstance();
> ClassLoader bufferedLoader = manager.getContextLoader();
> manager.setContextLoader( loader );
> try {
> String path = "path/to/image.jpg";
> manager.register( path, loader, getResourceAsStream( path );
> } finally {
> manager.setContextLoader( bufferedLoader );
> }
>
> Note that for this solution the image has to be available at the given
> path in the bundles classpath.
>
> Hope that helps.
>
>
> Ciao
> Frank
>
> -----Ursprüngliche Nachricht-----
> Von: Patrick Turcotte [mailto:patrek@gmail.com]
> Bereitgestellt: Mittwoch, 16. April 2008 20:56
> Bereitgestellt in: eclipse.technology.rap
> Unterhaltung: Branding and images
> Betreff: Re: Branding and images
>
>
> Hi,
>
> Yes, after your suggestion. But without success.
>
> There seems to be something we don't grasp in the mechanism. So,
> basically, it boils down to some questions.
>
> Let's say we add the following extension:
> <extension point="org.eclipse.rap.ui.resources">
> <resource class="ui.rap.SplashImage" />
> </extension>
>
> 1) In ui.rap.SplashImage, what should we return in the method
> getLocation() ?
>
> 2) Accordingly, where should we put the image file, under eclipse, in
> the plugin project ?
>
> 3) In body.html (branding) what url should we use to be able to display
> the image (<img src="[url]"/>)
>
> Or is there another mechanism?
>
> Thanks,
>
> Patrick
>
>> Hi,
>>
>> did you try the org.eclipse.rap.ui.resources extension point?
>>
>>
>> Ciao
>> Frank
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Patrick Turcotte [mailto:patrek@gmail.com]
>> Bereitgestellt: Dienstag, 15. April 2008 23:09 Bereitgestellt in:
>> eclipse.technology.rap
>> Unterhaltung: Branding and images
>> Betreff: Branding and images
>>
>>
>> Hi,
>>
>> We are trying to work with branding within our rap application.
>>
>> We are able to use the branding extension
>> (org.eclipse.rap.ui.branding) with success to set Title, favicon,
> exitConfirmation, etc.
>> As for the "body", we create and link to an html fragment file without
>
>> any problems.
>>
>> within this html fragment, we want to be able to call a splash image
>> (<img src="[relative url]/images/splash.jpg"/>).
>>
>> Unfortunatly, we don't seem to be able to "export" an image resource.
>>
>> The frustrating part is that our favicon file reside right beside our
>> splash file and is visible. It must obviously be registred somehow
>> with the branding extension.
>>
>> Any pointers?
>>
>> Thanks
>>
>> Patrick
>>
>
|
|
|
Re: Branding and images [message #83581 is a reply to message #83370] |
Fri, 18 April 2008 16:29 |
Patrick Turcotte Messages: 23 Registered: July 2009 |
Junior Member |
|
|
Thanks. That worked perfectly.
There was one typo:
manager.register( path, loader.getResourceAsStream( path );
should be used instead of
manager.register( path, loader, getResourceAsStream( path );
Patrick
Frank Appel wrote:
> Hi,
>
> I think the problem is that the location where the file is stored,
> differs from the URL you use in the body.html snippet. The reason for
> this is that the location name you specify in the resource is prefixed
> by the system with the given runtime bundle id, which you can't know by
> creation time of the body.html. Sorry, I didn't think about that.
>
> You can check this by looking up your image somewhere under the context
> root of the rap application:
> <path to eclipse
> installation>\workspace\.metadata\.plugins\org.eclipse.rap.ui\context
> (Note that this is the default under MS Windows without changing the
> launch-config settings for the workspace)
>
> But you can use a different approach to register the image without
> bundle prefix:
> - create an Activator for your bundle (skip this if you already have
> one...)
> - register the image in the activator's start method like this:
>
> ClassLoader loader = Activator.class.getClassLoader();
> IResourceManager manager = ResourceManager.getInstance();
> ClassLoader bufferedLoader = manager.getContextLoader();
> manager.setContextLoader( loader );
> try {
> String path = "path/to/image.jpg";
> manager.register( path, loader, getResourceAsStream( path );
> } finally {
> manager.setContextLoader( bufferedLoader );
> }
>
> Note that for this solution the image has to be available at the given
> path in the bundles classpath.
>
> Hope that helps.
>
>
> Ciao
> Frank
>
|
|
|
Goto Forum:
Current Time: Tue Apr 23 14:16:19 GMT 2024
Powered by FUDForum. Page generated in 0.03598 seconds
|