Defined URL Methods
From ZKDesktop
Overview
URL Methods allow you to call the ZK Desktop from another web application and pass arguments and commands to it. This allows external sites to execute applications on the desktop. For example, a web site could present a link that opens up a reporting web application and have it automatically generate a specific report.
Any web application can define it's own methods. Any arguments passed to the desktop as part of the URL will be stored as session attributes. The name of the parameter will be prefixed with "parameter_". For example:
http://localhost/index.zul?launch=browser&launchparams=somepage.html
Will store "browser" in the attribute "parameter_launch". You can test for and retrieve these attributes like this (taken from winMainMenu.zul):
String launch = "";
String launchParams = "";
Object oLaunch = Sessions.getCurrent().getAttribute("parameter_launch");
Object oParams = Sessions.getCurrent().getAttribute("parameter_launchparams");
if (oLaunch != null) {
launch = oLaunch.toString();
Sessions.getCurrent().removeAttribute("parameter_launch");
if (oParams != null) {
launchParams = oParams.toString();
Sessions.getCurrent().removeAttribute("parameter_launchparams");
}
startWebAppByName(launch, launchParams);
}
(Note that in the above example, the attributes are removed from the session after they have been processed. You may or may not wish to do this.)
Defined URL Methods
The ZK Desktop provides the following methods:
-
launch
As shown above, the launch method can be used to automatically launch a web application when the desktop is started. Provide the name of the application you wish to launch (without the ".webapp" suffix). You may pass the application parameters by specifying them with launchparams.

