getBrowserVersion

Forum to discuss the Web client version of Servoy.

getBrowserVersion

Postby Westy » Tue Nov 21, 2006 10:34 pm

Is there a way to get the web browser name and version that the client is using?
Westy
 
Posts: 852
Joined: Fri Feb 13, 2004 5:27 am
Location: Lynnfield, Massachusetts USA

Postby kazar » Tue Nov 28, 2006 2:11 am

Might it work to code custom html incorporating a javascript in an html area field, such as can be found at http://www.echoecho.com/jsbrowserdetection01.htm ... this tutorial may well be way beneath your skill level, Westy -- no insult intended, it actually represents my own continuing self-education on js and the possiblities of interplay between custom js code and the web client. Concept untested!

kazar
User avatar
kazar
 
Posts: 367
Joined: Sat Sep 13, 2003 9:59 pm
Location: New York City

Postby Westy » Tue Nov 28, 2006 4:39 pm

Yes, it appears that their browser detection code along with their if-statement examples will allow redirection to alternative urls based on the browser that is being used. The url can then open webclient and execute a method that places the appropriate browser information into a login table. That should work as long as the user does not have script blocking turned on. Thank you for bringing this example to my attention.

Dean
Westy
 
Posts: 852
Joined: Fri Feb 13, 2004 5:27 am
Location: Lynnfield, Massachusetts USA

Postby kazar » Tue Nov 28, 2006 5:07 pm

A problem you might run into, Westy, is that - at least in the limited understanding of js I've gained thus far - a browser-detection script must be in the <head>.

After taking an only semi-educated peek at the html generated by web client, it looks to me like anything in the head is purely Servoy-generated and anything you put on the Servoy form is in the <body>. So you may need to manually add an include tag in the <head> and do the browser-detection code as a text doc in the web directory ... or simply paste the whole script manually into the <head>, and you'll have to do this (again, as I understand it) each time you might revise the form in question in Servoy (since Servoy will then overwrite the html page with the new version, thereby removing any of your custom mods), rather than inside an html area field.

Perhaps a very nice addition to Web Client Future would be the ability to add custom code to all the DOM objects.

kazar
User avatar
kazar
 
Posts: 367
Joined: Sat Sep 13, 2003 9:59 pm
Location: New York City

Postby Westy » Wed Nov 29, 2006 2:17 am

In our situation I do not think what you describe will be a problem because we can just create a regular html page that gathers the needed information and then calls webclient via a url.
Westy
 
Posts: 852
Joined: Fri Feb 13, 2004 5:27 am
Location: Lynnfield, Massachusetts USA

Postby kazar » Thu Nov 30, 2006 4:28 pm

I'm really curious to know how the values that are gathered in a non-WebClient html window are then passed to Servoy? I'm attempting to get up to speed on what the possibilities are for integrating Web Client with larger sites (i.e., involving pages not generated by WC). If you set a cookie can a WC form/page read it? Or do you use php to send a value to the back end, then have Servoy read it?

I'm having trouble (obviously!) envisioning how this would be accomplished.

kazar
User avatar
kazar
 
Posts: 367
Joined: Sat Sep 13, 2003 9:59 pm
Location: New York City

Postby Westy » Thu Nov 30, 2006 11:01 pm

Using the conditional statement from the example from the URL that you provided above, you could redirect to URL A if Internet Explorer or URL B if Firefox.

URLs A and B would each be a link to webclient that includes a call that executes a method. So if the conditional redirects to URL A, then the method executed by that URL would place some words like "Internet Explorer" into a login table column (or where ever you want it). If it redirects to URL B, then the method executed by calling that URL would place a word like "Firefox" into the appropriate login table column.

The following is an example of a webclient URL that executes a method named 'do_it':
Code: Select all
http://ipaddress:8080/servoy-webclient/solutions/solution/solutionnamehere/method/do_it


There are probably also other ways to do this.

Dean
Westy
 
Posts: 852
Joined: Fri Feb 13, 2004 5:27 am
Location: Lynnfield, Massachusetts USA

Postby kazar » Thu Nov 30, 2006 11:26 pm

Thanks, Dean, I understand the theory of it now. The piece that's still missing in my brain is how you would execute a method via code submitted from an html page, in a Servoy solution that requires log-in, before the user is logged in. If there is no Servoy session yet for that user I'm surprised that a method could be executed (seems like a security hole if it can). Well, I'm sure there is some complexity in the set-up that is just beyond my current level of deployment experience.

thanks again,

kazar
User avatar
kazar
 
Posts: 367
Joined: Sat Sep 13, 2003 9:59 pm
Location: New York City

Postby Westy » Fri Dec 01, 2006 12:01 am

Depends on whether Servoy's security is being used or if you are rolling your own security.
Westy
 
Posts: 852
Joined: Fri Feb 13, 2004 5:27 am
Location: Lynnfield, Massachusetts USA

Postby kazar » Fri Dec 01, 2006 12:17 am

Ahhh. Well, I guess this scenario, then, is one instance in which the ability to specify a log-in form which a user cannot "get past" until properly logged in would NOT be usable. Unless we could add code to the <head> object. Maybe I'll stop jabbering and just post the suggestion in the right place!

kazar
User avatar
kazar
 
Posts: 367
Joined: Sat Sep 13, 2003 9:59 pm
Location: New York City

Postby kazar » Thu Dec 07, 2006 11:09 pm

There is a pretty thorough article on browser detection, including how to get all kinds of specs about the user's machine (screen res, cookies enabled, is Java enabled) at http://www-128.ibm.com/developerworks/w ... index.html
User avatar
kazar
 
Posts: 367
Joined: Sat Sep 13, 2003 9:59 pm
Location: New York City


Return to Servoy Web Client

Who is online

Users browsing this forum: No registered users and 14 guests