Child pages
  • headlessclient

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Rev: 1381948887907

...

HTML Table
id
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
tbody
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSClient
Table Cell (td)
#createClientcreateClient(solutionName, username, password, solutionOpenMethodArgs)
Creates a headless client on the server that will open the given solution.
tbody
Table Row (tr)
Table Cell (td)
JSClient
Table Cell (td)
#getClientgetClient(clientID)
Gets an existing headless client for the given client uuid.
Table Row (tr)
Table Cell (td)
JSClient
Table Cell (td)
#getOrCreateClientgetOrCreateClient(clientId, solutionname, username, password, solutionOpenMethodArgs)
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.

HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Method Details
Table Body (tbody)
idcreateClient-String_String_String_ObjectArray
Table Row (tr)
idname
Table Cell (td)
createClient
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSClient
Span
stylefont-weight: bold;
createClient
Span
(solutionName, username, password, solutionOpenMethodArgs)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

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 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.

Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} solutionName
{String} username
{String} password
{Object[]} solutionOpenMethodArgs
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
JSClient
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

// 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);
}

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetClient-String
Table Row (tr)
idname
Table Cell (td)
getClient
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSClient
Span
stylefont-weight: bold;
getClient
Span
(clientID)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Gets an existing headless client for the given client uuid.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} clientID
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
JSClient
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

// 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);
}

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetOrCreateClient-String_String_String_String_ObjectArray
Table Row (tr)
idname
Table Cell (td)
getOrCreateClient
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSClient
Span
stylefont-weight: bold;
getOrCreateClient
Span
(clientId, solutionname, username, password, solutionOpenMethodArgs)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

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.

Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{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.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
JSClient

...

- An existing JSClient or the JSClient that is created.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

// 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);
}

...

Table Row (tr)
classlastDetailRow
Table Cell (td)