How to access a record directly via url or other method?

Using Servoy to administrate the content of your website? Discuss all webrelated Servoy topics on this forum!

How to access a record directly via url or other method?

Postby gcaplan » Thu Dec 02, 2010 7:29 pm

Hi folks

I was hoping to store a url in another application which, when clicked, would take the user directly to a specific form and record in the Servoy web client.

I'm running the trial, and it seems that the URL specifies the form but not the record id. So I guess I'd have to write some code.

As I'm so new to Servoy, I'd appreciate any pointers on the best way to do this.
gcaplan
 
Posts: 18
Joined: Tue Sep 01, 2009 5:22 pm

Re: How to access a record directly via url or other method?

Postby mboegem » Thu Dec 02, 2010 9:05 pm

This can be done by so called "deeplinking":
http://wiki.servoy.com/display/public/DOCS/Web+Client

This way you'll be able to directly call a method and pass arguments.
The method can bring your user where you want him to go based on the arguments.
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1748
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: How to access a record directly via url or other method?

Postby gcaplan » Fri Dec 03, 2010 4:32 pm

Marc

Thanks for the heads-up on deeplinking - looks like we're in the right area here. I found one or two examples in the forums, so I'll play around with it.

But I do have one question: so far as I can see, each deeplink request starts a new web client session.

This isn't too much of a problem usability-wise, as users can simply close browser tabs from old requests from time to time.

But I'm concerned about the licensing issue. Does Servoy regard more than one session in the same browser as a single or multiple concurrent user?
gcaplan
 
Posts: 18
Joined: Tue Sep 01, 2009 5:22 pm

Re: How to access a record directly via url or other method?

Postby martinh » Fri Dec 03, 2010 5:23 pm

gcaplan wrote:But I do have one question: so far as I can see, each deeplink request starts a new web client session.


That is not always true.

You can start a webclient session.

When you recall the original URL with another argument , then you can refresh the data without a new client.
I recently tested this, because I needed this.

So

First call: http://192.168.xxx.xxx:8080/servoy-webc ... sh/a/11115

This opens a webclient session and shows me the customer info for customer 11115

Second call: http://192.168.xxx.xxx:8080/servoy-webc ... sh/a/11183

Now within your current browser, you refresh the data and can get customer info for customer 11183

Martin
Martin
------------------------------------------------
Servoy Developer
Version 5.2.10/5.2.13
Java version 1.6 update 31
Database SQL Server 2008 R2
martinh
 
Posts: 857
Joined: Wed May 09, 2007 5:34 pm
Location: Belgium

Re: How to access a record directly via url or other method?

Postby gcaplan » Fri Dec 03, 2010 5:52 pm

Martin

Just what I need - many thanks!
gcaplan
 
Posts: 18
Joined: Tue Sep 01, 2009 5:22 pm

Re: How to access a record directly via url or other method?

Postby mboegem » Fri Dec 03, 2010 6:08 pm

martinh wrote:First call: http://192.168.xxx.xxx:8080/servoy-webc ... sh/a/11115

This opens a webclient session and shows me the customer info for customer 11115

Second call: http://192.168.xxx.xxx:8080/servoy-webc ... sh/a/11183

Now within your current browser, you refresh the data and can get customer info for customer 11183


Careful, you have to read the arguments from within the specified method using the normal way to request the arguments.
DON'T USE the getStartupArguments() function to retrieve this as it only works at initial startup of the webclient.
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1748
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: How to access a record directly via url or other method?

Postby martinh » Fri Dec 03, 2010 6:22 pm

mboegem wrote:Careful, you have to read the arguments from within the specified method using the normal way to request the arguments.


Yes that is right.

You see in my URL that I use the method refresh

Code: Select all
function refresh()
{
   var id = arguments[0]

   //
   // Use this argument to retrieve your data
   //
}
Martin
------------------------------------------------
Servoy Developer
Version 5.2.10/5.2.13
Java version 1.6 update 31
Database SQL Server 2008 R2
martinh
 
Posts: 857
Joined: Wed May 09, 2007 5:34 pm
Location: Belgium


Return to Web Development

Who is online

Users browsing this forum: No registered users and 2 guests