Child pages
  • headlessclient

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: sub-section:description edited
Wiki Markup
{hidden}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
		THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden}
{sub-section:description|text=}h3. Starting Headless Clients from Debug clients in Servoy Developer
When starting a Headless Client from a Debug Client in Servoy Developer, there are restrictions to which solution can be started in the Headless Client.
* Prior to Servoy 6.1.1, the Headless Client would always start with the Active Solution, regardless which solution would be specified
* As of Servoy 6.1.1 the specified solution will be honored, as long as the specified solution is the Active Solution or a solution/module included in the Active Solution

By default the Headless Client which is started will be a debug-able Headless Client. As there can only one debug-able Client of a specific type at the same time (so one debug-able Web Client, one debug-able Smart Client and one debug-able Headless Client), starting a new debug-able Headless Client will close an existent debug-able Headless Client.

It's possible to start non-debug-able Headless Clients using the Headless Client plugin while in Servoy Developer by sending in the value "nodebug" as the last value in the "solutionOpenMethodArgs" array parameter

{sub-section}\\ 

{table:id=|class=servoy sReturnTypes}{tr:style=height: 30px;}{th}Return Types{th}{tr}{tr}{td}{span:class=sWordList}[JSClient]{span}{td}{tr}{table}\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[JSClient]{td}{td}[#createClient]\(solutionName, username, password, solutionOpenMethodArgs)
Creates a headless client that will open the given solution.{td}{tr}{tbody}{tbody}{tr}{td}[JSClient]{td}{td}[#getClient]\(clientID)
Gets an existing headless client for the given client uuid.{td}{tr}{tbody}{table}\\ 

{table:id=function|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=createClient|class=node}{tr:id=name}{td}h6.createClient{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSClient]{span}{span:id=iets|style=float: left; font-weight: bold;}createClient{span}{span:id=iets|style=float: left;}\(solutionName, username, password, solutionOpenMethodArgs){span}{td}{tr}{tr:id=des}{td}{sub-section:createClient_des|text=|trigger=button}{sub-section}{sub-section:createClient_des|trigger=none|class=sIndent}Creates a headless client that will open the given solution.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:createClient_snc|text=|trigger=button}{sub-section}{sub-section:createClient_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:createClient_prs|text=|trigger=button}{sub-section}{sub-section:createClient_prs|trigger=none|class=sIndent}\{[String]} solutionName
\{[String]} username
\{[String]} password
\{[Object]\[]} solutionOpenMethodArgs
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:createClient_ret|text=|trigger=button}{sub-section}{sub-section:createClient_ret|trigger=none|class=sIndent}[JSClient]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:createClient_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:createClient_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:createClient_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:createClient_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:createClient_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:createClient_sam|trigger=none}{code:language=javascript}
// Creates a headless client that will open the given solution.
var headlessClient = plugins.headlessclient.createClient("someSolution", "user", "pass", null);
if (headlessClient != null && headlessClient.isValid()) { 
	var x = new Object();
	x.name = 'remote1';
	x.number = 10;
	headlessClient.queueMethod(null, "remoteMethod", [x], callback);
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getClient|class=node}{tr:id=name}{td}h6.getClient{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSClient]{span}{span:id=iets|style=float: left; font-weight: bold;}getClient{span}{span:id=iets|style=float: left;}\(clientID){span}{td}{tr}{tr:id=des}{td}{sub-section:getClient_des|text=|trigger=button}{sub-section}{sub-section:getClient_des|trigger=none|class=sIndent}Gets an existing headless client for the given client uuid.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getClient_snc|text=|trigger=button}{sub-section}{sub-section:getClient_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getClient_prs|text=|trigger=button}{sub-section}{sub-section:getClient_prs|trigger=none|class=sIndent}\{[String]} clientID
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getClient_ret|text=|trigger=button}{sub-section}{sub-section:getClient_ret|trigger=none|class=sIndent}[JSClient]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getClient_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getClient_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getClient_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getClient_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getClient_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getClient_sam|trigger=none}{code:language=javascript}
// Gets an existing headless client for the given client uuid.
var headlessClient = plugins.headlessclient.getClient("clientID");
if (headlessClient != null && headlessClient.isValid()) {
	 headlessClient.queueMethod(null, "someRemoteMethod", null, callback);
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}