Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » How to integrate custom javascript
How to integrate custom javascript [message #824604] Mon, 19 March 2012 21:34 Go to next message
Karsten Voigt is currently offline Karsten VoigtFriend
Messages: 19
Registered: July 2011
Junior Member
Hi,

currently I try to add web analytics tracking to my RAP application, but up-to-know I found no proper approach to add the custom javascript to various views and editors.

I tried to use the Browser widget and everything works fine, but the browser widget always consumes some space that destroys the layout.

Is there a way to add the javascript tagging in browser widget that has no size (using the browser widgets setSize method has no effect)?
Do you know any alternative approach for adding the javascript tags?

Thanks for your support.

Regards
Karsten
Re: How to integrate custom javascript [message #824991 is a reply to message #824604] Tue, 20 March 2012 10:23 Go to previous messageGo to next message
Tim Buschtoens is currently offline Tim BuschtoensFriend
Messages: 396
Registered: July 2009
Senior Member
Hi.

> currently I try to add web analytics tracking to my RAP application, but
> up-to-know I found no proper approach to add the custom javascript to
> various views and editors.

So you want to add JavaScript not once to your entire application
(executed at startup), but to specific views (executed when created)?

> Is there a way to add the javascript tagging in browser widget that has
> no size (using the browser widgets setSize method has no effect)?

You probably need to set the size not on the widget directly but on its
layout data.

Greetings,
Tim


--
Tim Buschtöns

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: How to integrate custom javascript [message #825024 is a reply to message #824991] Tue, 20 March 2012 11:10 Go to previous messageGo to next message
Karsten Voigt is currently offline Karsten VoigtFriend
Messages: 19
Registered: July 2011
Junior Member
> So you want to add JavaScript not once to your entire application
> (executed at startup), but to specific views (executed when created)?

Correct; I need to track specific views, editors, dialogs, etc. The tracking on startup is quite easy, I used the body from custom branding to achieve that.


> You probably need to set the size not on the widget directly but on its
> layout data.

I will try to do that, but maybe there is a better approach Smile

Regards
Karsten

[Updated on: Tue, 20 March 2012 11:10]

Report message to a moderator

Re: How to integrate custom javascript [message #825114 is a reply to message #825024] Tue, 20 March 2012 13:37 Go to previous messageGo to next message
Tim Buschtoens is currently offline Tim BuschtoensFriend
Messages: 396
Registered: July 2009
Senior Member
> I will try to do that, but maybe there is a better approach :)

Maybe, maybe not. The entire approach of using JS seems very tricky to
me. Can't you collect the data you need on the server?

Anyway, if you dont need your JS to run in an iFrame, you can also use
the JSExecuter class.

Greetings,
Tim

>
> Regards
> Karsten

--
Tim Buschtöns

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: How to integrate custom javascript [message #825764 is a reply to message #825114] Wed, 21 March 2012 08:32 Go to previous messageGo to next message
Karsten Voigt is currently offline Karsten VoigtFriend
Messages: 19
Registered: July 2011
Junior Member
Hi,

I changed my implementation approach and now I'm using the REST API for analytics tracking. The usage of JSExecutor is not really useful, since that is a RAP internal component.

> The entire approach of using JS seems very tricky to
> me. Can't you collect the data you need on the server?

No :-); I'm using PIWIK to collect the data, create dashboards, etc.; just like Google analytics (but with more data security for the user). If I start to track everything on my own I will be lost in creating the required reports. Using the REST API requires more coding than the javascript tacking, but thats OK.
Re: How to integrate custom javascript [message #825767 is a reply to message #825114] Wed, 21 March 2012 08:32 Go to previous message
Karsten Voigt is currently offline Karsten VoigtFriend
Messages: 19
Registered: July 2011
Junior Member
Hi,

I changed my implementation approach and now I'm using the REST API for analytics tracking. The usage of JSExecutor is not really useful, since that is a RAP internal component.

> The entire approach of using JS seems very tricky to
> me. Can't you collect the data you need on the server?

No :-); I'm using PIWIK to collect the data, create dashboards, etc.; just like Google analytics (but with more data security for the user). If I start to track everything on my own I will be lost in creating the required reports. Using the REST API requires more coding than the javascript tacking, but thats OK.
Previous Topic:Extraneous mouseout event when mouseover fires for custom widget
Next Topic:In Rap environment, about MessageBox
Goto Forum:
  


Current Time: Thu Apr 25 07:11:36 GMT 2024

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

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

Back to the top