Creates a headless client on the server that will open the given solution.
Gets an existing headless client for the given client uuid.
This will try to get a existing client by the given id if that client is already created for that specific solution; it will create a headless client on the server that will open the given solution if it didn't exists yet.
Creates a headless client on the server that will open the given solution.
The clientId of this client can be stored in the database to be shared between clients so that that specific client can be used
over multiply clients later on or picked up later on by this client. (Even after restart of this client)
NOTE: in the developer this will only load
the
one solution in debug mode when it is the current active solution or a module of the active solution
;
you
.
So calling createClient with the same or another solution/module will replace the existig debug client.
You can load any solution (and have multily JSClientinstances) from the workspace when you pass "nodebug" as last argument in the arguments list (it should still use the same resources project).
But then you won't be able to debug it, breakpoints won't hit.
{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:createClient_snc|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{sub-section}{sub-section:getClient_des|trigger=none|class=sIndent}
prs
Parameters
sIndent
solutionName
;
username
;
password
;
solutionOpenMethodArgs
;
ret
Returns
sIndent
clients
Supported Clients
sIndentSmartClient,WebClient,NGClient
sam
Sample
sIdent
javascript
lastDetailRow
getClient
name
getClient(clientID)
des
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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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}{tbody:id=getOrCreateClient|class=node}{tr:id=name}{td}h6.getOrCreateClient{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSClient]{span}{span:id=iets|style=float: left; font-weight: bold;}getOrCreateClient{span}{span:id=iets|style=float: left;}\(clientId, solutionname, username, password, solutionOpenMethodArgs){span}{td}{tr}{tr:id=des}{td}{sub-section:getOrCreateClient_des|trigger=button|text=}{sub-section}{sub-section:getOrCreateClient_des|trigger=none|class=sIndent}
This will try to get a existing client by the given id if that client is already created for that specific solution;
it will create a headless client on the server that will open the given solution if it didn't exists yet.
If the client does exist but it is not loaded with that solution an exception will be thrown.
NOTE: in the developer this will only load the solution in debug mode when it is the current active solution or a module of the active solution;
you can load any solution from the workspace when you pass "nodebug" as last argument in the arguments list (it should still use the same resources project).
But then you won't be able to debug it, breakpoints won't hit.
{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getOrCreateClient_snc|trigger=button|text=}{sub-section}{sub-section:getOrCreateClient_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getOrCreateClient_prs|trigger=button|text=}{sub-section}{sub-section:getOrCreateClient_prs|trigger=none|class=sIndent}\{[String]} clientId -- The id of the client if it already exists, or it will be the id of the client if it will be created.
\{[String]} solutionname -- The solution to load
\{[String]} username -- The user name that is used to login to the solution
\{[String]} password -- The password for the user
\{[Object]\[]} solutionOpenMethodArgs -- The arguments that will be passed to the solution open method.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getOrCreateClient_ret|trigger=button|text=}{sub-section}{sub-section:getOrCreateClient_ret|trigger=none|class=sIndent}[JSClient] -- An existing JSClient or the JSClient that is created.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getOrCreateClient_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getOrCreateClient_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getOrCreateClient_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getOrCreateClient_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getOrCreateClient_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getOrCreateClient_sam|trigger=none}{code:language=javascript}
// Creates a headless client that will open the given solution.
var storedSolutionSpecificID = "aaaabbbbccccc1111";
var headlessClient = plugins.headlessclient.getOrCreateClient(storedSolutionSpecificID, "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}{table}
prs
Parameters
sIndent
clientId
The client to lookup by id, if not found a new headless client is created with this id.
solutionname
The solution to load
username
The user name that is used to login to the solution
password
The password for the user
solutionOpenMethodArgs
The arguments that will be passed to the solution open method.