|
|
|
Re: Using images and javascripts in ServiceHandler [message #103030 is a reply to message #102888] |
Sat, 23 August 2008 09:08 |
Boris Stepanov Messages: 68 Registered: July 2009 |
Member |
|
|
Hi, Benjamin
I have tens of resources, if I will use extension point I should create
Resource class for each of them and add it to plugin.xml. I think the
best way is analize folder with resources and register each of them
using IResourceManager as Stefan suggested. I did not find a way to
unregister resources using IResourceManager, it is possible? My
application generates some images for HTML dinamicly, so I need a way to
remove them when user will be finished browsing. Now I found only one
mean to implement it - create special IServiceHandler which will manage
directory with generated images and returns image content when request
comes. It is alternative mean how my goal can be solved.
> Hi,
>
> as the resources are for a IServiceHandler it may even be possible to
> register them with the org.eclipse.equinox.http.registry.resources
> extension point.
>
> Best regards
> Benny
>
> Stefan Roeck wrote:
>> Hi Boris,
>>
>> you can first register your images, scripts, etc. at the
>> IResourceManager with a relative path and use this path in your
>> rendered HTML.
>>
>> Example:
>>
>> IResourceManager resourceManager = ResourceManager.getInstance();
>> ClassLoader classLoader = getClass().getClassLoader();
>> InputStream inputStream =
>> classLoader.getResourceAsStream("resources/styles.css");
>> resourceManager.register("resources/styles.css", inputStream);
>>
>> This can also be done declaratively via the extension point
>> org.eclipse.rap.ui.resources.
>>
>> Hope that helps,
>> Stefan.
>>
>>
>> Boris Stepanov schrieb:
>>> Hi everybody,
>>>
>>> I use Browser control connecting to IServiceHadler implementation
>>> which returns HTML text, images and scripts including in this HTML
>>> saved in directory inside plugin. What URLs I should use for images
>>> and javascripts in that HTML?
>>>
>>> Thanks.
|
|
|
Re: Using images and javascripts in ServiceHandler [message #103362 is a reply to message #103030] |
Fri, 29 August 2008 06:48 |
Eclipse User |
|
|
|
Originally posted by: fappel.innoopract.com
Hello Boris,
unregistering of resources isn't available in RAP as images are treated as
shared objects between session. This assumption is true for most of the
use cases. But there are use cases (as the one you're describing) where
this isn't true.
I've been discussing this with Stefan before because he has implemented a
solution using the servicehandler approach. Unfortunately this solution
isn't generic enough (we encountered several other use cases during that
discussion) to take this over into the RAP.
To trace this I have created an bug entry:
245635: Provide an mechanism to handle different lifetimes of resources
https://bugs.eclipse.org/bugs/show_bug.cgi?id=245635
Ciao
Frank
-----Ursprüngliche Nachricht-----
Von: Boris Stepanov [mailto:freepriman@rambler.ru]
Bereitgestellt: Samstag, 23. August 2008 11:08
Bereitgestellt in: eclipse.technology.rap
Unterhaltung: Using images and javascripts in ServiceHandler
Betreff: Re: Using images and javascripts in ServiceHandler
Hi, Benjamin
I have tens of resources, if I will use extension point I should create
Resource class for each of them and add it to plugin.xml. I think the
best way is analize folder with resources and register each of them
using IResourceManager as Stefan suggested. I did not find a way to
unregister resources using IResourceManager, it is possible? My
application generates some images for HTML dinamicly, so I need a way to
remove them when user will be finished browsing. Now I found only one
mean to implement it - create special IServiceHandler which will manage
directory with generated images and returns image content when request
comes. It is alternative mean how my goal can be solved.
> Hi,
>
> as the resources are for a IServiceHandler it may even be possible to
> register them with the org.eclipse.equinox.http.registry.resources
> extension point.
>
> Best regards
> Benny
>
> Stefan Roeck wrote:
>> Hi Boris,
>>
>> you can first register your images, scripts, etc. at the
>> IResourceManager with a relative path and use this path in your
>> rendered HTML.
>>
>> Example:
>>
>> IResourceManager resourceManager = ResourceManager.getInstance();
>> ClassLoader classLoader = getClass().getClassLoader();
>> InputStream inputStream =
>> classLoader.getResourceAsStream("resources/styles.css");
>> resourceManager.register("resources/styles.css", inputStream);
>>
>> This can also be done declaratively via the extension point
>> org.eclipse.rap.ui.resources.
>>
>> Hope that helps,
>> Stefan.
>>
>>
>> Boris Stepanov schrieb:
>>> Hi everybody,
>>>
>>> I use Browser control connecting to IServiceHadler implementation
>>> which returns HTML text, images and scripts including in this HTML
>>> saved in directory inside plugin. What URLs I should use for images
>>> and javascripts in that HTML?
>>>
>>> Thanks.
|
|
|
Powered by
FUDForum. Page generated in 0.03656 seconds