deeplink with arguments

I have a solution “sampledeeplink”
{serverUrl}/servoy-client/{mySolutionName}.jnlp?m={myMethodName}&a={value}&{name1}={value1}&{name2}={value2}

http://x.x.x.x:x/servoy-client/sampledeeplink.jnlp?m=doActionBackup&a=xyz&param1=abc&param2=123
function doActionBackup(param1, param2) {
var x = param1 //should get abc
var y = param2 //should get 123
var z = ?? //should get xyz
}

Is this the right way to do it? How will I get xyz?

Furthermore, the deeplink method should be global?

the method from the deeplink will be called with 2 params,
the first one will be the value of ‘a’ and the second will be
a map containing all the name-value pairs for the other params of the deeplink

Gabi Boros:
the method from the deeplink will be called with 2 params,
the first one will be the value of ‘a’ and the second will be
a map containing all the name-value pairs for the other params of the deeplink

How would you retrieve the map?

function doActionBackup(param1, param2) {
var x = param1 //should get abc
var y = param2 //should get 123
var z = arguments[0] //should get xyz
}

rogel:

Gabi Boros:
the method from the deeplink will be called with 2 params,
the first one will be the value of ‘a’ and the second will be
a map containing all the name-value pairs for the other params of the deeplink

How would you retrieve the map?

function doActionBackup(param1, param2) {
var x = param1 //should get abc
var y = param2 //should get 123
var z = arguments[0] //should get xyz
}

tried this one as well…
http://x.x.x.x:50020/servoy-client/back … Backup&a=c:\dbbackup&a=11

function onAction_doAutoBackup() {
application.output(argument[0]);
application.output(argument[1]);
}

both output was undefined.

for this link :
x.x.x.x:x/servoy-client/sampledeeplink.jnlp?m=doActionBackup&a=xyz&param1=abc&param2=123

you will have in the doActionBackup method :
arguments[0] = xyz
arguments[1][‘param1’] = abc
arguments[1][‘param2’] = 123

Gabi Boros:
for this link :
x.x.x.x:x/servoy-client/sampledeeplink.jnlp?m=doActionBackup&a=xyz&param1=abc&param2=123

you will have in the doActionBackup method :
arguments[0] = xyz
arguments[1][‘param1’] = abc
arguments[1][‘param2’] = 123

Thanks Gabi! I will try it out.

rogel:

function onAction_doAutoBackup() {

application.output(argument[0]);
application.output(argument[1]);
}




both output was undefined.

If you had done your original code with function parameters application.output() would have worked:

function onAction_doAutoBackup(param1, param2) {
application.output(argument[0]);
application.output(argument[1]);
}

Another way to inspect values is to put a break point in and then use the expressions pane. Would have shown the input structures right away.

rogel:
Furthermore, the deeplink method should be global?

Yes, as far as I’ve been able to figure out. Deep linking seems to only call global methods.

Hi Rogel,

rogel:

function onAction_doAutoBackup() {

application.output(argument[0]);
application.output(argument[1]);
}




both output was undefined.

The reason for being undefined is because you are missing an ‘s’ after argument.
It’s arguments[0] and arguments[1].
But yes, as David already explained function parameters will make your life easier and you can name them the way you want.

Hope this helps.

ROCLASI:
Hi Rogel,

rogel:

function onAction_doAutoBackup() {

application.output(argument[0]);
application.output(argument[1]);
}




both output was undefined.

The reason for being undefined is because you are missing an ‘s’ after argument.
It’s arguments[0] and arguments[1].
But yes, as David already explained function parameters will make your life easier and you can name them the way you want.

Hope this helps.

my mistake. thanks!

david:
Another way to inspect values is to put a break point in and then use the expressions pane. Would have shown the input structures right away.

How will I be able to do test the deeplink in developer if the solution is not yet in the application server?

rogel:

david:
Another way to inspect values is to put a break point in and then use the expressions pane. Would have shown the input structures right away.

How will I be able to do test the deeplink in developer if the solution is not yet in the application server?

The “server” URL when developer is running is localhost:8080.

deeplinking to a smart client with a jnlp url does not work for the debug smart client in de developer.
thats currently not supported.

jcompagner:
deeplinking to a smart client with a jnlp url does not work for the debug smart client in de developer.
thats currently not supported.

Would there be a way to test deeplink in developer?

currently only for a webclient

i’m trying this on the NG client:

When I open the url with my arguement a=XYZ I can use in onSolutionOpen

var dlink = application.output(argument[0])

then I can see in the debug window that the value of argument[0] is “XYZ” but I can’t store this into any variable.
The value of variable dlink is alway undefined…

Do I have to convert the array before storing it?

Storing the result of application.output function won’t do much.

var dlink = argument[0]

This should do the job

Thanks, that was to easy :oops: