Child pages
  • headlessclient

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

styledisplay:none

...

iddescription

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 of 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 be 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. In this case it is also possible to start the Headless Client with a solution/module that isn't the Active Solution or one of it's modules, as long as the specified solution is available in the workspace and uses the same Resources project as the Active Solution.

...

Cache

...

index

...

true

...

refresh

...

100d

...

styleheight: 30px;

...

Table Head (th)
Return Types
Table Row (tr)
Table Cell (td)
Span
classsWordList
JSClient

...

padding0px
width80px

...

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary

...

Table Cell (td)
JSClient

...

Table Cell (td)
JSClient

...

iddoc
showRefreshtrue
titleRefresh page
showDatetrue
retryEnable



servoy sReturnTypes


2100%



height: 30px;


2Supported Clients






sWordListINLINESmartClient


sWordListINLINEWebClient


sWordListINLINENGClient






servoy sSummary


12%30%58%



height: 30px;


3Methods Summary







Creates a headless client on the server that will open the given solution.

...

...






Gets an existing headless client for the given client uuid.

...

Table Cell (td)
JSClient

...






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.

...





function

...

servoy sDetail

...


2100%

...



...

idsig

...

Span
stylemargin-right: 5px;
JSClient
Span
stylefont-weight: bold;
createClient

...

height:30px

...

Table Head (th)
colspan1
Method Details

...

idcreateClient-String_String_String_ObjectArray
Table Row (tr)
idname
Table Cell (td)
createClient

...


2Methods Details




createClient


name


createClient(solutionName, username, password, solutionOpenMethodArgs)

...



...

des

...



sIndent
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

...

 one solution in debug mode when it is the current active solution or a module of the active

...

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

...

classlastDetailRow

...

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

...

classlastDetailRow

...

idgetOrCreateClient-String_String_String_String_ObjectArray
Table Row (tr)
idname
Table Cell (td)
getOrCreateClient

...

idsig

...

Span
stylemargin-right: 5px;
JSClient
Span
stylefont-weight: bold;
getOrCreateClient

...

 solution.
So calling createClient with the same or another solution/module will replace the existig debug client.
You can load any solution (and have multily  JSClient instances) 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.




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.




prs


Parameters

sIndent




clientID


;






ret


Returns

sIndent




clients


Supported Clients

sIndentSmartClient,WebClient,NGClient




sam


Sample

sIdent


javascript





lastDetailRow






getOrCreateClient


name


getOrCreateClient(clientId, solutionname, username, password, solutionOpenMethodArgs)

...



des

...



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.

...




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.

...






ret

...


Returns

...

sIndent

...




clients


Supported Clients

sIndentSmartClient,WebClient,NGClient




sam

...

classlastDetailRow

...


Sample

...

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


javascript





lastDetailRow