Child pages
  • Maintenance Mode

Versions Compared

Key

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

...

Function

setMaintenanceMode

Description

Puts the server into/out of maintenance mode, depending on the boolean parameter that is specified (if the parameter is true, then the server will be put into maintenance mode; if the parameter is false, then the server will be put out of maintenance mode).

Syntax
setMaintenanceMode(maintenanceMode -
)
Parameters
maintenanceMode -

Example

No Format
nopaneltrue
%%elementName%%.setMaintenanceMode(!%%elementName%%.isInMaintenanceMode());

...

Function

sendMessageToAllClients

Description

Sends a message to all connected clients.

Syntax
sendMessageToAllClients(message -
)
Parameters
message -

Example

No Format
nopaneltrue
%%elementName%%.sendMessageToAllClients("Hello, all clients!");

Function

sendMessageToClient

Description

Sends a message to a specific client, identified by its clientId. The clientIds are retrieved by calling the getConnectedClients method.

Syntax
sendMessageToClient(clientId -
, message -
)
Parameters
clientId -
message -

Example

No Format
nopaneltrue
var clients = %%elementName%%.getConnectedClients();
for (var i=0; i<clients.length; i++)
	%%elementName%%.sendMessageToClient(clients[i].getClientId(), "Hello, client " + clients[i].getClientId() + "!");

...

Function

shutDownClient

Description

Shuts down a specific client, identified by its clientId. The clientIds are retrieved by calling the getConnectedClients method.

Syntax
shutDownClient(clientId -
)
Parameters
clientId -

Example

No Format
nopaneltrue
var clients = %%elementName%%.getConnectedClients();
for (var i=0; i<clients.length; i++)
	%%elementName%%.shutDownClient(clients[i].getClientId());

Function

getServer

Description

Retrieves an instance of JSServer corresponding to the server with the name specified through the "serverName" argument. If the optional argument "mustBeEnabled" is set to true, then the JSServer instance is returned only if the server is active. Similarly, if the "mustBeValid" optional argument is set to true, then the JSServer instance is returned only if the server is valid. If the specified server is not found, or if it does not meet the requirements imposed by the optional arguments, then null is returned. By default both optional arguments have the value false.

Syntax
Parameters
serverName -
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="a9b4cb8b0bbae08f-ef25a2b8-44b34ba1-9876876c-b9d560895e37cd25c276eb96"><ac:plain-text-body><![CDATA[getServer(serverName -
, [mustBeEnabled] -
, [mustBeValid] -
)]]></ac:plain-text-body></ac:structured-macro>
Parameters
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="d1646e5e-3814-42df-8779-9ad316513a6f"><ac:plain-text-body><![CDATA[[mustBeValid] -
]]></ac:plain-text-body></ac:structured-macro> serverName -
mustBeEnabled -
mustBeValid -

Example

No Format
nopaneltrue
var server = %%elementName%%.getServer("example_data");
if (server) {
	var tableNames = server.getTableNames();
	application.output("There are " + tableNames.length + " tables.");
	for (var i=0; i<tableNames.length; i++)
		application.output("Table " + i + ": " + tableNames[i]);
	}
else {
	plugins.dialogs.showInfoDialog("Attention","Server 'example_data' cannot be found.","OK");
}

Function

getServerNames

Description

Retrieves a list with the names of all available database servers. The returned list will contain only enabled servers if the "mustBeEnabled" optional argument is set to true. The list will contain only valid servers if the "mustBeValid" argument is set to true. If the "sort" optional argument is set to true, then the list will be sorted alphabetically. If the "includeDuplicates" optional argument is set to false, then duplicate servers will appear only once in the list. By default, the "mustBeEnabled" and the "mustBeValid" arguments have the value false, while the "sort" and "includeDuplicates" arguments have the value true.

Syntax
Parameters
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="b15ee8c98aa58f06-1f8d6769-43934942-834b9229-67c79d00f72c027f99e2002e"><ac:plain-text-body><![CDATA[getServerNames([mustBeEnabled] -
]]></ac:plain-text-body></ac:structured-macro>
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="1d99d400-6ca0-4982-be85-67c96e1e69c5"><ac:plain-text-body><![CDATA[[ , [mustBeValid] -
]]></ac:plain-text-body></ac:structured-macro>
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="f6622e8c-d74e-4029-b60a-935dd92a3041"><ac:plain-text-body><![CDATA[[sort] -
, [sort] -
, [includeDuplicates] -
)]]></ac:plain-text-body></ac:structured-macro>
Parameters
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="30ddcd26-f5c4-4041-b43b-093e4fff5373"><ac:plain-text-body><![CDATA[[includeDuplicates] -
]]></ac:plain-text-body></ac:structured-macro> mustBeEnabled -
mustBeValid -
sort -
includeDuplicates -

Example

No Format
nopaneltrue
var serverNames = %%elementName%%.getServerNames();
application.output("There are " + serverNames.length + " servers.");
for (var i=0; i<serverNames.length; i++)
	application.output("Server " + i + ": " + serverNames[i]);