Changing .../servoy-webclient in the webclient url

Questions, answers, tips and ideas on Servoy Client

Changing .../servoy-webclient in the webclient url

Postby peterbliskavka » Tue Dec 10, 2013 7:31 pm

Hey,

I've been doing some searching and it seems the way people are doing this is by using an iframe and reverse proxy on a front end server.

Is there any other way of doing this? I tried changing the servlet mapping but that doesn't work since the hrefs in the CSS still point to .../servoy-webclient/... and short of doing a find/replace on every pageload, I won't be able to change those. Is Servoy team planning on letting us customize the URL at all?
peterbliskavka
 
Posts: 30
Joined: Tue May 21, 2013 3:42 pm

Re: Changing .../servoy-webclient in the webclient url

Postby jcompagner » Thu Dec 12, 2013 11:09 am

i think you should be able to change the url in the web.xml thats in the server/webapps/root/WEB-INF folder..
there /servoy-webclient mapping can be changed to another name if you want.

But having said that, the url is not really important, people are not really using that at all, just check the amazon urls:

http://www.amazon.com/gp/product/B00AWH ... d_i=507846
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Changing .../servoy-webclient in the webclient url

Postby Harjo » Thu Dec 12, 2013 12:13 pm

Johan, do NOT recommend to change the URL in the web.xml

Really everything breaks:
Servoy developer: starting webclient, will hard-force you to: http://localhost:8080/servoy-webclient.......

by manually changing it to: http://localhost:8080/webclient....... the client starts but,
Every style sheet in the source is hardcoded: ../servoy-webclient/......

really unusable
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: Changing .../servoy-webclient in the webclient url

Postby david » Thu Dec 12, 2013 5:09 pm

Having friendly URL's that are readable, bookmarkable and work with browser history was one of our most common client requests. So for Data Sutra we wrote our own router with the scheme of "workspace > nav item > record ID". At some point we may add in layout state too:

urls.png
urls.png (339.15 KiB) Viewed 7138 times


The technique itself is not complicated. But it does entail client-side code and you need to have quite a bit of knowledge about how web client works.
David Workman, Kabootit

Image
Everything you need to build great apps with Servoy
User avatar
david
 
Posts: 1727
Joined: Thu Apr 24, 2003 4:18 pm
Location: Washington, D.C.

Re: Changing .../servoy-webclient in the webclient url

Postby jcompagner » Fri Dec 13, 2013 10:57 am

Harjo wrote:Johan, do NOT recommend to change the URL in the web.xml

Really everything breaks:
Servoy developer: starting webclient, will hard-force you to: http://localhost:8080/servoy-webclient.......


that is logical yes, but this is also a server setting, not a developer setting that you should change.

Harjo wrote:by manually changing it to: http://localhost:8080/webclient....... the client starts but,
Every style sheet in the source is hardcoded: ../servoy-webclient/......

really unusable


this shouldn't really happen, thats kind of a bug, it should be relative or it should just use the servlet/filter path..
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Changing .../servoy-webclient in the webclient url

Postby sovanm » Tue Feb 24, 2015 1:51 pm

Hi,

The technique itself is not complicated. But it does entail client-side code and you need to have quite a bit of knowledge about how web client works.


I would like to implement this feature in my servoy web client only project. It is already an existing project and deployed into production.

So there are few queries :
- Is it possible to implement to an already existing solution, or we need to have to apply some specific formatting while developing?
- Can you please share some documentations, links from where I would get some knowledge regarding the technique like client side code and configuring in servoy web client. At least where to start from ?

Currently we are using Nice URL(admin setting) to show the our solution. Also planned to (not implemented) show the URL in iframe, but in that case we will have only one link. But it would be nice if it will be possible of doing it directly.

Hope I made my query clear..

Will be grateful if someone will share some ideas of doing it.

Thanks
Sovan
sovanm
 
Posts: 99
Joined: Fri Oct 28, 2011 1:55 pm
Location: Bhubaneswar, India

Re: Changing .../servoy-webclient in the webclient url

Postby david » Tue Feb 24, 2015 10:05 pm

It's all part of Data Sutra which is open source.

You can integrate the concepts with any Servoy web client solution. The basic idea is that you load web client via an iframe.

Client-side (http://community.data-sutra.com/project ... /router.js)

- catch any URLs that are hand submitted
- set the iframe source to a deeplink that you catch server-side passing in the URL as a parameter

Server-side (http://community.data-sutra.com/project ... s.js#L5252)

- parse the URL and show specified form and other state options that you have mapped to your URL scheme (current record, search criteria, etc)

From here, Servoy web client takes over. You click stuff, you change records, you change forms — but the URL will stay the same. If you want the URL to stay updated during all this, you need to keep the browser history stack up-to-date (this also enables the browser back and forward functionality). A lot of code in there that handles this part.

We're using this technique currently to unify multiple web apps served from different servers/URLs/technologies under one interface (and handling all the cross login stuff so the user doesn't have to login all the time). Thankfully we have promises now so all the setTimeouts are a thing of the past.
David Workman, Kabootit

Image
Everything you need to build great apps with Servoy
User avatar
david
 
Posts: 1727
Joined: Thu Apr 24, 2003 4:18 pm
Location: Washington, D.C.


Return to Servoy Client

Who is online

Users browsing this forum: No registered users and 17 guests