Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » BrowserFunction in custom widget
BrowserFunction in custom widget [message #542894] Sun, 27 June 2010 09:20 Go to next message
Philipp Leusmann is currently offline Philipp LeusmannFriend
Messages: 36
Registered: July 2009
Member
Hi all,

is there any way to expose a BrowserFunction in a custom widget?

Regrads,
Philipp
Re: BrowserFunction in custom widget [message #543455 is a reply to message #542894] Tue, 29 June 2010 13:21 Go to previous messageGo to next message
Benjamin Muskalla is currently offline Benjamin MuskallaFriend
Messages: 338
Registered: July 2009
Senior Member
Hi Philipp,

I'm not sure what you expect from exposing a BrowserFunction in a custom
widget. Could you please explain your usecase?

Regards,
Ben

Philipp Leusmann wrote:
> Hi all,
>
> is there any way to expose a BrowserFunction in a custom widget?
>
> Regrads,
> Philipp


--
Benjamin Muskalla | EclipseSource Karlsruhe
http://www.eclipsesource.com | http://twitter.com/eclipsesource
Re: BrowserFunction in custom widget [message #543497 is a reply to message #543455] Tue, 29 June 2010 15:07 Go to previous messageGo to next message
Philipp Leusmann is currently offline Philipp LeusmannFriend
Messages: 36
Registered: July 2009
Member
Hi Benjamin,

we are using a graphical js-editor based on mxGraph
(http://www.jgraph.com/mxgraph.html) which currently uses a webservice
to perform CRUD operations and runs in an org.eclipse.swt.browser.Browser.
Because a) we experience massive XSS-related issue in our development
environment and b) need to connect to the RAP-Lifecycle chain to receive
events generated by a PhaseListener, we decided to wrap it into a custom
widget.
Since we also want to remove the direct access to the webservice, we
want to proxy all CRUD operations through the RAP application. To
simplify these proxy operations, it would be great to reuse the
BrowserFunction-Infrastructure.

For now, I came up with a Copy&Paste-Solution, which seems to work ok
(widget is a Browser-subclass, the LCA is mainly
org.eclipse.swt.internal.browser.browserkit.BrowserLCA but with some
altered static Strings, the JS-resource is a copied Browser.js with some
modifications.)
Since I don not like such hacks, maybe in the future an infrastructure
may be provided, to simplify use-cases like this. Maybe by Mixins and a
non-final BrowserLCA.

I hope you got my use-case and my approach. Hope there was no one-liner
solution which I didn't see to solve my task ;)

Regards,
Philipp


Am 29.06.2010 15:21, schrieb Benjamin Muskalla:
> Hi Philipp,
>
> I'm not sure what you expect from exposing a BrowserFunction in a custom
> widget. Could you please explain your usecase?
>
> Regards,
> Ben
>
> Philipp Leusmann wrote:
>> Hi all,
>>
>> is there any way to expose a BrowserFunction in a custom widget?
>>
>> Regrads,
>> Philipp
>
>
Re: BrowserFunction in custom widget [message #544001 is a reply to message #543497] Thu, 01 July 2010 09:54 Go to previous messageGo to next message
Benjamin Muskalla is currently offline Benjamin MuskallaFriend
Messages: 338
Registered: July 2009
Senior Member
Hi Philipp,

I think I understood your usecase. But what strikes me: Why do you need
to modify the BrowserWidget? Is it not possible to use the browser
widget as is? I don't really get why you need to touch the BrowserLCA in
this case.

Regards,
Ben

Philipp Leusmann wrote:
> Hi Benjamin,
>
> we are using a graphical js-editor based on mxGraph
> (http://www.jgraph.com/mxgraph.html) which currently uses a webservice
> to perform CRUD operations and runs in an org.eclipse.swt.browser.Browser.
> Because a) we experience massive XSS-related issue in our development
> environment and b) need to connect to the RAP-Lifecycle chain to receive
> events generated by a PhaseListener, we decided to wrap it into a custom
> widget.
> Since we also want to remove the direct access to the webservice, we
> want to proxy all CRUD operations through the RAP application. To
> simplify these proxy operations, it would be great to reuse the
> BrowserFunction-Infrastructure.
>
> For now, I came up with a Copy&Paste-Solution, which seems to work ok
> (widget is a Browser-subclass, the LCA is mainly
> org.eclipse.swt.internal.browser.browserkit.BrowserLCA but with some
> altered static Strings, the JS-resource is a copied Browser.js with some
> modifications.)
> Since I don not like such hacks, maybe in the future an infrastructure
> may be provided, to simplify use-cases like this. Maybe by Mixins and a
> non-final BrowserLCA.
>
> I hope you got my use-case and my approach. Hope there was no one-liner
> solution which I didn't see to solve my task ;)
>
> Regards,
> Philipp
>
>
> Am 29.06.2010 15:21, schrieb Benjamin Muskalla:
>> Hi Philipp,
>>
>> I'm not sure what you expect from exposing a BrowserFunction in a custom
>> widget. Could you please explain your usecase?
>>
>> Regards,
>> Ben
>>
>> Philipp Leusmann wrote:
>>> Hi all,
>>>
>>> is there any way to expose a BrowserFunction in a custom widget?
>>>
>>> Regrads,
>>> Philipp
>>
>>
>


--
Benjamin Muskalla | EclipseSource Karlsruhe
http://www.eclipsesource.com | http://twitter.com/eclipsesource
Re: BrowserFunction in custom widget [message #544956 is a reply to message #544001] Tue, 06 July 2010 08:30 Go to previous message
Philipp Leusmann is currently offline Philipp LeusmannFriend
Messages: 36
Registered: July 2009
Member
Hi Ben,

since I needed to do some custom stuff on the JS-side, I decided to use
a Copy&Past version of Browser.js, but I changed the class-name.
This change clashed with the QX_TYPE, EXECUTED_FUNCTION_NAME,
EXECUTED_FUNCTION_RESULT and EXECUTED_FUNCTION_ERROR static strings in
the BrowserLCA, so I also needed a copy of it.

I hope, it's clear now. Maybe this is a not so uncommon use-case, so
propably there should be a way to simplify things like this.

Regards,
Philipp

Am 01.07.2010 11:54, schrieb Benjamin Muskalla:
> Hi Philipp,
>
> I think I understood your usecase. But what strikes me: Why do you need
> to modify the BrowserWidget? Is it not possible to use the browser
> widget as is? I don't really get why you need to touch the BrowserLCA in
> this case.
>
> Regards,
> Ben
>
> Philipp Leusmann wrote:
>> Hi Benjamin,
>>
>> we are using a graphical js-editor based on mxGraph
>> (http://www.jgraph.com/mxgraph.html) which currently uses a webservice
>> to perform CRUD operations and runs in an
>> org.eclipse.swt.browser.Browser.
>> Because a) we experience massive XSS-related issue in our development
>> environment and b) need to connect to the RAP-Lifecycle chain to
>> receive events generated by a PhaseListener, we decided to wrap it
>> into a custom widget.
>> Since we also want to remove the direct access to the webservice, we
>> want to proxy all CRUD operations through the RAP application. To
>> simplify these proxy operations, it would be great to reuse the
>> BrowserFunction-Infrastructure.
>>
>> For now, I came up with a Copy&Paste-Solution, which seems to work ok
>> (widget is a Browser-subclass, the LCA is mainly
>> org.eclipse.swt.internal.browser.browserkit.BrowserLCA but with some
>> altered static Strings, the JS-resource is a copied Browser.js with
>> some modifications.)
>> Since I don not like such hacks, maybe in the future an infrastructure
>> may be provided, to simplify use-cases like this. Maybe by Mixins and
>> a non-final BrowserLCA.
>>
>> I hope you got my use-case and my approach. Hope there was no
>> one-liner solution which I didn't see to solve my task ;)
>>
>> Regards,
>> Philipp
>>
>>
>> Am 29.06.2010 15:21, schrieb Benjamin Muskalla:
>>> Hi Philipp,
>>>
>>> I'm not sure what you expect from exposing a BrowserFunction in a custom
>>> widget. Could you please explain your usecase?
>>>
>>> Regards,
>>> Ben
>>>
>>> Philipp Leusmann wrote:
>>>> Hi all,
>>>>
>>>> is there any way to expose a BrowserFunction in a custom widget?
>>>>
>>>> Regrads,
>>>> Philipp
>>>
>>>
>>
>
>
Previous Topic:JavaScript documentation
Next Topic:Get menu activated by JS
Goto Forum:
  


Current Time: Fri Apr 19 23:06:35 GMT 2024

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

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

Back to the top