Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
{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=}The Maintenance plugin can be used in combination with the solution import hooks to control the workflow when importing solutions into the Servoy Application Server. The pre-import and post-import hooks
Wiki Markup
Div
styledisplay:none

DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR.

Div
iddescription

The Maintenance plugin can be used in combination with the solution import hooks to control the workflow when importing solutions into the Servoy Application Server.

The pre-import and post-import hooks i.c.w.

the

Maintenance

plugin

allow

the

automatic

execution

of

administrative

tasks

on

the

Servoy

Application

Server

while

importing

solutions,

like:

*

  • Send
  • messages
  • to
  • connected
  • clients,
  • or
  • even
  • kill
  • connected
  • clients.
*
  • Put
  • the
  • server
  • into
  • maintenance
  • mode
  • for
  • the
  • duration
  • of
  • the
  • solution
  • import.
*
  • Perform
  • operations
  • on
  • databases.
*

Solution

Import

Hooks

*


During

solution

import

from

the

Servoy

Admin

Page,

modules

with

solution

import

hook

types

are

handled

in

a

special

way.


Their

[

onOpen

|Solution#onOpen]

event

handlers

are

executed

before

the

solution

is

actually

imported.

Similarly,

modules

whose

names

start

with

"after_import"

are

handled

as

post-import

hooks.

Their

[

onOpen

|Solution#onOpen]

event

handlers

are

executed

after

the

solution

is

actually

imported.


If

multiple

import

hook

modules

exists,

they

will

be

all

handled

in

this

way,

but

no

handling

order

is

guaranteed.

Pre

&

post

import

hook

modules

are

to

be

self

contained,

meaning

that

they

are

not

to

rely

on

included

modules.

During

the

execution

of

the

[

onOpen

|Solution#onOpen]

event

handlers

from

the

pre

&

post

import

hooks,

any

output

printed

with

[

application.output(...)

|application#output]

will

be

redirected

to

the

import

log,

which

you

can

see

in

the

Servoy

Admin

page.

*

Typical

usage

scenario* * Before importing the

scenario

  • Before importing the solution,
  • connected
  • clients
  • are
  • notified
  • that
  • an
  • import
  • will
  • take
  • place,
  • then
  • they
  • are
  • disconnected
  • and
  • then
  • the
  • server
  • is
  • put
  • into
  • maintenance
  • mode,
  • so
  • that
  • no
  • new
  • clients
  • can
  • connect
  • during
  • the
  • import.
*
  • The
  • import
  • is
  • performed
  • as
  • usual.
*
  • After
  • the
  • import
  • is
  • over,
  • the
  • server
  • is
  • taken
  • out
  • of
  • maintenance
  • mode,
  • so
  • that
  • clients
  • can
  • connect
  • again.

All

these

steps

can

be

automated

by

creating

a

pre-import

and

a

post-import

hook

module.

The

pre-import

hook

module

can

have

the

following

function

set

as

its

[

onOpen

|Solution#onOpen]

event

handler:

{code:JavaScript}

Code Block
JavaScript
JavaScript
function onBeforeImportSolutionOpen()
{
	application.output("Putting server into maintenance mode...");
	plugins.maintenance.setMaintenanceMode(true);
	application.output("Notifying and disconnecting connected clients...");
	plugins.maintenance.sendMessageToAllClients("A solution upgrade will take place on the server. You will be disconnected in 2 minutes.");
	application.sleep(2 * 60 * 1000);
	plugins.maintenance.sendMessageToAllClients("A solution upgrade will take place on the server. You will be disconnected NOW.");
	plugins.maintenance.shutDownAllClients();
	application.output("Proceeding to import...");
}
{code}

This

function

puts

the

servoy

Application

Server

into

maintenance

mode

and

sends

a

notification

to

all

connected

clients,

telling

them

that

in

two

minutes

they

will

be

disconnected.

The

function

waits

for

two

minutes,

then

it

sends

another

message

to

the

clients,

telling

them

that

they

will

be

immediately

disconnected.

Then

all

connected

clients

are

killed.

From

this

moment

on,

no

new

client

will

be

able

to

connect

to

the

Server.

The

post-import

hook

module

can

have

the

following

function

as

its

{{

onOpen

}}

event

handler:

{code:JavaScript}

Code Block
JavaScript
JavaScript
function onAfterImportSolutionOpen()
{
	application.output("Taking server out of maintenance mode.");
	plugins.maintenance.setMaintenanceMode(false);
	application.output("Clients can now connect to the server.");
}
{code}

This

function

takes

the

Server

out

of

maintenance

mode,

so

that

clients

can

again

connect

to

it.

*

Modifying

Database

Structure

and

Content

*


Using

the

Maintenance

plugin,

it

is

possible

to

programmatically

modify

the

database

structure.

It

allows

for

tables

to

be

created

and

dropped

or

modify

existing

tables

by

creating

and

deleting

columns.

On

solution

import,

Servoy

will

automatically

create

all

missing

tables

and

columns,

based

on

the

metadata

confined

in

the

solution

export

file.

When

more

control

is

required

on

how

the

columns

are

created

and/or

columns

need

to

be

removed

or

altered,

the

pre

import

hook

i.c.w.

the

Maintenance

plugin

allows

the

developer

full

control.

For

example

the

following

function,

set

as

handler

for

the

onOpen

even

of

a

pre-import

hook,

will

delete

a

no

longer

needed

column

from

a

table.

{code:JavaScript}

Code Block
JavaScript
JavaScript
function onSolutionOpenBeforeImport()
{
	var server = plugins.maintenance.getServer("example_data")
	if (server) {
		var table = server.getTable("todo_list")
		if (table) {
			table.deleteColumn("todo_list_suggested_by")
			var result = server.synchronizeWithDB(table)
			if (result)
				application.output("'Suggested By' column removed.")
			else
				application.output("Something went wrong while deleting column.")
		}
		else {
			application.output("Table 'todo_list' cannot be found.")
		}
	}
	else {
		application.output("Server 'example_data' cannot be found.")
	}
}
{code} The function tries to obtain a reference to the server where the table is stored. If successful, then it tries to obtain a reference to the table which holds the obsolete column. If this step is also successful, then it deletes the column. In order to make the change permanent, the table must be synchronized with the underlying database. In pre-import and post-import hooks, besides changing the database structure, you can also change the database content. This is done in the classical way, by using the foundset API. It's also possible to use the [rawSQL plugin| rawSQL] to modify both data and the datamodel in the database. If changes are made to the datamodel this way, after completing the changes, the function [

The function tries to obtain a reference to the server where the table is stored. If successful, then it tries to obtain a reference to the table which holds the obsolete column. If this step is also successful, then it deletes the column. In order to make the change permanent, the table must be synchronized with the underlying database.

In pre-import and post-import hooks, besides changing the database structure, you can also change the database content. This is done in the classical way, by using the foundset API.

It's also possible to use the rawSQL plugin to modify both data and the datamodel in the database. If changes are made to the datamodel this way, after completing the changes, the function JSServer.reloadDataModel(...)

|JSServer#reloadDataModel]

needs

to

be

called,

to

make

the

Servoy

Application

Server

aware

of

the

changes

made.

{

Note
:
title
=
Multi
database
SaaS
}

When

deploying

in

a

multi

database

SaaS

model,

any

operation

done

on

the

Database

Servers

needs

to

be

performed

on

each

clone

of

the

master

Database

Server.

The

[

getDataModelClonesFrom(serverName)

|#getDataModelClonesFrom]

function

can

be

used

to

retrieve

a

list

of

all

Database

Servers

marked

as

clone

of

a

master

Database

Server

(using

the

"

[

Data

model cloned from|Database Servers#Data

model

cloned

from

]

"

property

{note} {note:title=Maintenance plugin & [Servoy Cluster]}All operations performed by the Maintenance plugin when executed on a Servoy Application Server that is part of a Servoy Cluster will operate on the entire cluster.{note} *Maintenance plugin availablility* The Maintenance plugin is only available to the code being executed inside the pre and post import hooks. The plugin can not be used in normal clients *Debugging* While the maintanance plugins is only available during import on the Servoy Application Server, it works like a normal plugin in Servoy Developer as long the solution type is an import hook. Such an import hook solution can be started and debugged in any client type within Servoy Developer. {warning:title=Modifing datamodel and data} It is good practise to have separate phases for doing changes to datamodel and data and not to mix these. {warning} {sub-section}\\ {table:id=|class=servoy sReturnTypes}{tr:style=height: 30px;}{th}Return Types{th}{tr}{tr}{td}{span:class=sWordList}[JSClientInformation]{span}{span:class=sWordList}[JSColumnObject]{span}{span:class=sWordList}[JSServer]{span}{span:class=sWordList}[JSTableObject]{span}{td}{tr}{table}\\ {table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[JSClientInformation]\[]{td}{td}[#getConnectedClients]\() Returns an array of JSClientInformation elements describing the clients connected to the server.{td}{tr}{tbody}{tbody}{tr}{td}[JSServer]{td}{td}[#getServer]\(serverName) Retrieves an instance of JSServer corresponding to the server with the name specified through the "serverName" argument.{td}{tr}{tbody}{tbody}{tr}{td}[JSServer]{td}{td}[#getServer]\(serverName, mustBeEnabled) Retrieves an instance of JSServer corresponding to the server with the name specified through the "serverName" argument.{td}{tr}{tbody}{tbody}{tr}{td}[JSServer]{td}{td}[#getServer]\(serverName, mustBeEnabled, mustBeValid) Retrieves an instance of JSServer corresponding to the server with the name specified through the "serverName" argument.{td}{tr}{tbody}{tbody}{tr}{td}[String]\[]{td}{td}[#getServerNames]\() Retrieves a list with the names of all available database servers.{td}{tr}{tbody}{tbody}{tr}{td}[String]\[]{td}{td}[#getServerNames]\(mustBeEnabled) Retrieves a list with the names of all available database servers.{td}{tr}{tbody}{tbody}{tr}{td}[String]\[]{td}{td}[#getServerNames]\(mustBeEnabled, mustBeValid) Retrieves a list with the names of all available database servers.{td}{tr}{tbody}{tbody}{tr}{td}[String]\[]{td}{td}[#getServerNames]\(mustBeEnabled, mustBeValid, sort) Retrieves a list with the names of all available database servers.{td}{tr}{tbody}{tbody}{tr}{td}[String]\[]{td}{td}[#getServerNames]\(mustBeEnabled, mustBeValid, sort, includeDuplicates) Retrieves a list with the names of all available database servers.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#isInMaintenanceMode]\() Returns true if the server is in maintenance mode, false otherwise.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#sendMessageToAllClients]\(message) Sends a message to all connected clients.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#sendMessageToClient]\(clientId, message) Sends a message to a specific client, identified by its clientId.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#setMaintenanceMode]\(maintenanceMode) 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).{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#shutDownAllClients]\() Shuts down all connected clients.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#shutDownClient]\(clientId) Shuts down a specific client, identified by its clientId.{td}{tr}{tbody}{table}\\ {table:id=function|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=getConnectedClients|class=node}{tr:id=name}{td}h6.getConnectedClients{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSClientInformation]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getConnectedClients{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getConnectedClients_des|trigger=button|text=}{sub-section}{sub-section:getConnectedClients_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getConnectedClients_snc|trigger=button|text=}{sub-section}{sub-section:getConnectedClients_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getConnectedClients_prs|trigger=button|text=}{sub-section}{sub-section:getConnectedClients_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getConnectedClients_ret|trigger=button|text=}{sub-section}{sub-section:getConnectedClients_ret|trigger=none|class=sIndent}[JSClientInformation]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getConnectedClients_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getConnectedClients_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getConnectedClients_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getConnectedClients_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getConnectedClients_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getConnectedClients_sam|trigger=none}{code:language=javascript} // WARNING: maintenance plugin is only meant to run during solution import

Note
titleMaintenance plugin & [Servoy Cluster]

All operations performed by the Maintenance plugin when executed on a Servoy Application Server that is part of a Servoy Cluster will operate on the entire cluster.

Maintenance plugin availablility
The Maintenance plugin is only available to the code being executed inside the pre and post import hooks. The plugin can not be used in normal clients

Debugging
While the maintanance plugins is only available during import on the Servoy Application Server, it works like a normal plugin in Servoy Developer as long the solution type is an import hook. Such an import hook solution can be started and debugged in any client type within Servoy Developer.

Warning
titleModifing datamodel and data

It is good practise to have separate phases for doing changes to datamodel and data and not to mix these.



HTML Table
id
classservoy sReturnTypes
Colgroup Tag
Col
colspan2
width100%
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Return Types
Table Row (tr)
Table Cell (td)
Span
classsWordList
JSClientInformation
Span
classsWordList
JSColumnObject
Span
classsWordList
JSServer
Span
classsWordList
JSTableObject



HTML Table
id
classservoy sSummary
Colgroup Tag
Col
width80px
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Row (tr)
Table Cell (td)
JSClientInformation[]
Table Cell (td)
getConnectedClients()
Returns an array of JSClientInformation elements describing the clients connected to the server.
Table Row (tr)
Table Cell (td)
JSServer
Table Cell (td)
getServer(serverName)
Retrieves an instance of JSServer corresponding to the server with the name specified through the "serverName" argument.
Table Row (tr)
Table Cell (td)
JSServer
Table Cell (td)
getServer(serverName, mustBeEnabled)
Retrieves an instance of JSServer corresponding to the server with the name specified through the "serverName" argument.
Table Row (tr)
Table Cell (td)
JSServer
Table Cell (td)
getServer(serverName, mustBeEnabled, mustBeValid)
Retrieves an instance of JSServer corresponding to the server with the name specified through the "serverName" argument.
Table Row (tr)
Table Cell (td)
String[]
Table Cell (td)
getServerNames()
Retrieves a list with the names of all available database servers.
Table Row (tr)
Table Cell (td)
String[]
Table Cell (td)
getServerNames(mustBeEnabled)
Retrieves a list with the names of all available database servers.
Table Row (tr)
Table Cell (td)
String[]
Table Cell (td)
getServerNames(mustBeEnabled, mustBeValid)
Retrieves a list with the names of all available database servers.
Table Row (tr)
Table Cell (td)
String[]
Table Cell (td)
getServerNames(mustBeEnabled, mustBeValid, sort)
Retrieves a list with the names of all available database servers.
Table Row (tr)
Table Cell (td)
String[]
Table Cell (td)
getServerNames(mustBeEnabled, mustBeValid, sort, includeDuplicates)
Retrieves a list with the names of all available database servers.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
isInMaintenanceMode()
Returns true if the server is in maintenance mode, false otherwise.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
sendMessageToAllClients(message)
Sends a message to all connected clients.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
sendMessageToClient(clientId, message)
Sends a message to a specific client, identified by its clientId.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
setMaintenanceMode(maintenanceMode)
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).
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
shutDownAllClients()
Shuts down all connected clients.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
shutDownClient(clientId)
Shuts down a specific client, identified by its clientId.



HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Col
colspan2
width100%
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Details
Table Body (tbody)
idgetConnectedClients
Table Row (tr)
idname
Table Cell (td)

getConnectedClients

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSClientInformation[]
Span
stylefont-weight: bold;
getConnectedClients
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns an array of JSClientInformation elements describing the clients connected to the server.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
JSClientInformation[]
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client)
//Returns an array of JSClientInformation elements describing the clients connected to the server.
var clients = plugins.maintenance.getConnectedClients();
application.output("There are " + clients.length + " connected clients.");
for (var i = 0; i < clients.length; i++)
	application.output("Client has clientId '" + clients[i].getClientId() + "' and has connected from host '" + clients[i].getHostAddress() + "'.");
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetServer-String
Table Row (tr)
idname
Table Cell (td)

getServer

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSServer
Span
stylefont-weight: bold;
getServer
Span
(serverName)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
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.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} serverName
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
JSServer
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client)
//
Returns
Retrieves an 
array
instance of 
JSClientInformation
JSServer 
elements
corresponding 
describing
to the 
clients
server 
connected to
with the 
server.
name 
var
specified 
clients
through 
= plugins.maintenance.getConnectedClients(); application.output("There are " + clients.length + " connected clients."); for (var i = 0; i < clients.length; i++) application.output("Client has clientId '" + clients[i].getClientId() + "' and has connected from host '" + clients[i].getHostAddress() + "'."); {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getServer-String|class=node}{tr:id=name}{td}h6.getServer{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSServer]{span}{span:id=iets|style=float: left; font-weight: bold;}getServer{span}{span:id=iets|style=float: left;}\(serverName){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getServer-String_des|trigger=button|text=}{sub-section}{sub-section:getServer-String_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getServer-String_snc|trigger=button|text=}{sub-section}{sub-section:getServer-String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getServer-String_prs|trigger=button|text=}{sub-section}{sub-section:getServer-String_prs|trigger=none|class=sIndent}\{[String]} serverName {sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getServer-String_ret|trigger=button|text=}{sub-section}{sub-section:getServer-String_ret|trigger=none|class=sIndent}[JSServer]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getServer-String_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getServer-String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getServer-String_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getServer-String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getServer-String_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getServer-String_sam|trigger=none}{code:language=javascript} // WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client) //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. var server = plugins.maintenance.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"); } {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getServer-String_Boolean|class=node}{tr:id=name}{td}h6.getServer{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSServer]{span}{span:id=iets|style=float: left; font-weight: bold;}getServer{span}{span:id=iets|style=float: left;}\(serverName, mustBeEnabled){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getServer-String_Boolean_des|trigger=button|text=}{sub-section}{sub-section:getServer-String_Boolean_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getServer-String_Boolean_snc|trigger=button|text=}{sub-section}{sub-section:getServer-String_Boolean_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getServer-String_Boolean_prs|trigger=button|text=}{sub-section}{sub-section:getServer-String_Boolean_prs|trigger=none|class=sIndent}\{[String]} serverName \{[Boolean]} mustBeEnabled {sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getServer-String_Boolean_ret|trigger=button|text=}{sub-section}{sub-section:getServer-String_Boolean_ret|trigger=none|class=sIndent}[JSServer]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getServer-String_Boolean_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getServer-String_Boolean_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getServer-String_Boolean_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getServer-String_Boolean_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getServer-String_Boolean_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getServer-String_Boolean_sam|trigger=none}{code:language=javascript} // WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client) //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. var server = plugins.maintenance.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"); } {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getServer-String_Boolean_Boolean|class=node}{tr:id=name}{td}h6.getServer{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSServer]{span}{span:id=iets|style=float: left; font-weight: bold;}getServer{span}{span:id=iets|style=float: left;}\(serverName, mustBeEnabled, mustBeValid){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getServer-String_Boolean_Boolean_des|trigger=button|text=}{sub-section}{sub-section:getServer-String_Boolean_Boolean_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getServer-String_Boolean_Boolean_snc|trigger=button|text=}{sub-section}{sub-section:getServer-String_Boolean_Boolean_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getServer-String_Boolean_Boolean_prs|trigger=button|text=}{sub-section}{sub-section:getServer-String_Boolean_Boolean_prs|trigger=none|class=sIndent}\{[String]} serverName \{[Boolean]} mustBeEnabled \{[Boolean]} mustBeValid {sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getServer-String_Boolean_Boolean_ret|trigger=button|text=}{sub-section}{sub-section:getServer-String_Boolean_Boolean_ret|trigger=none|class=sIndent}[JSServer]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getServer-String_Boolean_Boolean_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getServer-String_Boolean_Boolean_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getServer-String_Boolean_Boolean_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getServer-String_Boolean_Boolean_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getServer-String_Boolean_Boolean_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getServer-String_Boolean_Boolean_sam|trigger=none}{code:language=javascript} // WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client) //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. var server = plugins.maintenance.getServer("example_data"); if (server) { var tableNames = server.getTableNames();
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.
var server = plugins.maintenance.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");
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetServer-String_Boolean
Table Row (tr)
idname
Table Cell (td)

getServer

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSServer
Span
stylefont-weight: bold;
getServer
Span
(serverName, mustBeEnabled)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
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.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} serverName
{Boolean} mustBeEnabled
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
JSServer
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client)
//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.
var server = plugins.maintenance.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");
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetServer-String_Boolean_Boolean
Table Row (tr)
idname
Table Cell (td)

getServer

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSServer
Span
stylefont-weight: bold;
getServer
Span
(serverName, mustBeEnabled, mustBeValid)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
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.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} serverName
{Boolean} mustBeEnabled
{Boolean} mustBeValid
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
JSServer
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client)
//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.
var server = plugins.maintenance.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");
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetServerNames
Table Row (tr)
idname
Table Cell (td)

getServerNames

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String[]
Span
stylefont-weight: bold;
getServerNames
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
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.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String[]
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client)
//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.
var serverNames = plugins.maintenance.getServerNames();
application.output("There are " + serverNames.length + " servers.");
for (var i=0; i<serverNames.length; i++)
	application.output("Server " + i + ": " + serverNames[i]);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetServerNames-Boolean
Table Row (tr)
idname
Table Cell (td)

getServerNames

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String[]
Span
stylefont-weight: bold;
getServerNames
Span
(mustBeEnabled)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
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.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Boolean} mustBeEnabled
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String[]
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client)
//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.
var serverNames = plugins.maintenance.getServerNames();
application.output("There are " + 
tableNames
serverNames.length + " 
tables
servers.");
for (var i=0; 
i<tableNames
i<serverNames.length; i++)
	application.output("
Table
Server " + i + ": " + 
tableNames
serverNames[i]);
} else { plugins.dialogs.showInfoDialog("Attention","Server 'example_data' cannot be found.","OK"); } {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getServerNames|class=node}{tr:id=name}{td}h6.getServerNames{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getServerNames{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getServerNames_des|trigger=button|text=}{sub-section}{sub-section:getServerNames_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getServerNames_snc|trigger=button|text=}{sub-section}{sub-section:getServerNames_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getServerNames_prs|trigger=button|text=}{sub-section}{sub-section:getServerNames_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getServerNames_ret|trigger=button|text=}{sub-section}{sub-section:getServerNames_ret|trigger=none|class=sIndent}[String]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getServerNames_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getServerNames_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getServerNames_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getServerNames_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getServerNames_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getServerNames_sam|trigger=none}{code:language=javascript} // WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client) //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. var serverNames = plugins.maintenance.getServerNames(); application.output("There are " + serverNames.length + " servers."); for (var i=0; i<serverNames.length; i++) application.output("Server " + i + ": " + serverNames[i]); {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getServerNames-Boolean|class=node}{tr:id=name}{td}h6.getServerNames{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getServerNames{span}{span:id=iets|style=float: left;}\(mustBeEnabled){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getServerNames-Boolean_des|trigger=button|text=}{sub-section}{sub-section:getServerNames-Boolean_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getServerNames-Boolean_snc|trigger=button|text=}{sub-section}{sub-section:getServerNames-Boolean_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getServerNames-Boolean_prs|trigger=button|text=}{sub-section}{sub-section:getServerNames-Boolean_prs|trigger=none|class=sIndent}\{[Boolean]} mustBeEnabled {sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getServerNames-Boolean_ret|trigger=button|text=}{sub-section}{sub-section:getServerNames-Boolean_ret|trigger=none|class=sIndent}[String]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getServerNames-Boolean_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getServerNames-Boolean_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getServerNames-Boolean_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getServerNames-Boolean_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getServerNames-Boolean_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getServerNames-Boolean_sam|trigger=none}{code:language=javascript} // WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client) //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. var serverNames = plugins.maintenance.getServerNames(); application.output("There are " + serverNames.length + " servers."); for (var i=0; i<serverNames.length; i++) application.output("Server " + i + ": " + serverNames[i]); {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getServerNames-Boolean_Boolean|class=node}{tr:id=name}{td}h6.getServerNames{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getServerNames{span}{span:id=iets|style=float: left;}\(mustBeEnabled, mustBeValid){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getServerNames-Boolean_Boolean_des|trigger=button|text=}{sub-section}{sub-section:getServerNames-Boolean_Boolean_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getServerNames-Boolean_Boolean_snc|trigger=button|text=}{sub-section}{sub-section:getServerNames-Boolean_Boolean_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getServerNames-Boolean_Boolean_prs|trigger=button|text=}{sub-section}{sub-section:getServerNames-Boolean_Boolean_prs|trigger=none|class=sIndent}\{[Boolean]} mustBeEnabled \{[Boolean]} mustBeValid {sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getServerNames-Boolean_Boolean_ret|trigger=button|text=}{sub-section}{sub-section:getServerNames-Boolean_Boolean_ret|trigger=none|class=sIndent}[String]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getServerNames-Boolean_Boolean_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getServerNames-Boolean_Boolean_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getServerNames-Boolean_Boolean_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getServerNames-Boolean_Boolean_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getServerNames-Boolean_Boolean_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getServerNames-Boolean_Boolean_sam|trigger=none}{code:language=javascript} // WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client) //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. var serverNames = plugins.maintenance.getServerNames(); application.output("There are " + serverNames.length + " servers."); for (var i=0; i<serverNames.length; i++) application.output("Server " + i + ": " + serverNames[i]); {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getServerNames-Boolean_Boolean_Boolean|class=node}{tr:id=name}{td}h6.getServerNames{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getServerNames{span}{span:id=iets|style=float: left;}\(mustBeEnabled, mustBeValid, sort){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getServerNames-Boolean_Boolean_Boolean_des|trigger=button|text=}{sub-section}{sub-section:getServerNames-Boolean_Boolean_Boolean_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getServerNames-Boolean_Boolean_Boolean_snc|trigger=button|text=}{sub-section}{sub-section:getServerNames-Boolean_Boolean_Boolean_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getServerNames-Boolean_Boolean_Boolean_prs|trigger=button|text=}{sub-section}{sub-section:getServerNames-Boolean_Boolean_Boolean_prs|trigger=none|class=sIndent}\{[Boolean]} mustBeEnabled \{[Boolean]} mustBeValid \{[Boolean]} sort {sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getServerNames-Boolean_Boolean_Boolean_ret|trigger=button|text=}{sub-section}{sub-section:getServerNames-Boolean_Boolean_Boolean_ret|trigger=none|class=sIndent}[String]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getServerNames-Boolean_Boolean_Boolean_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getServerNames-Boolean_Boolean_Boolean_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getServerNames-Boolean_Boolean_Boolean_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getServerNames-Boolean_Boolean_Boolean_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getServerNames-Boolean_Boolean_Boolean_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getServerNames-Boolean_Boolean_Boolean_sam|trigger=none}{code:language=javascript} // WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client) //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. var serverNames = plugins.maintenance.getServerNames(); application.output("There are " + serverNames.length + " servers."); for (var i=0; i<serverNames.length; i++) application.output("Server " + i + ": " + serverNames[i]); {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getServerNames-Boolean_Boolean_Boolean_Boolean|class=node}{tr:id=name}{td}h6.getServerNames{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getServerNames{span}{span:id=iets|style=float: left;}\(mustBeEnabled, mustBeValid, sort, includeDuplicates){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getServerNames-Boolean_Boolean_Boolean_Boolean_des|trigger=button|text=}{sub-section}{sub-section:getServerNames-Boolean_Boolean_Boolean_Boolean_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getServerNames-Boolean_Boolean_Boolean_Boolean_snc|trigger=button|text=}{sub-section}{sub-section:getServerNames-Boolean_Boolean_Boolean_Boolean_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getServerNames-Boolean_Boolean_Boolean_Boolean_prs|trigger=button|text=}{sub-section}{sub-section:getServerNames-Boolean_Boolean_Boolean_Boolean_prs|trigger=none|class=sIndent}\{[Boolean]} mustBeEnabled \{[Boolean]} mustBeValid \{[Boolean]} sort \{[Boolean]} includeDuplicates {sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getServerNames-Boolean_Boolean_Boolean_Boolean_ret|trigger=button|text=}{sub-section}{sub-section:getServerNames-Boolean_Boolean_Boolean_Boolean_ret|trigger=none|class=sIndent}[String]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getServerNames-Boolean_Boolean_Boolean_Boolean_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getServerNames-Boolean_Boolean_Boolean_Boolean_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getServerNames-Boolean_Boolean_Boolean_Boolean_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getServerNames-Boolean_Boolean_Boolean_Boolean_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getServerNames-Boolean_Boolean_Boolean_Boolean_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getServerNames-Boolean_Boolean_Boolean_Boolean_sam|trigger=none}{code:language=javascript} // WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client) //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. var serverNames = plugins.maintenance.getServerNames(); application.output("There are " + serverNames.length + " servers."); for (var i=0; i<serverNames.length; i++) application.output("Server " + i + ": " + serverNames[i]); {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=isInMaintenanceMode|class=node}{tr:id=name}{td}h6.isInMaintenanceMode{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}isInMaintenanceMode{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:isInMaintenanceMode_des|trigger=button|text=}{sub-section}{sub-section:isInMaintenanceMode_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:isInMaintenanceMode_snc|trigger=button|text=}{sub-section}{sub-section:isInMaintenanceMode_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:isInMaintenanceMode_prs|trigger=button|text=}{sub-section}{sub-section:isInMaintenanceMode_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:isInMaintenanceMode_ret|trigger=button|text=}{sub-section}{sub-section:isInMaintenanceMode_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:isInMaintenanceMode_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:isInMaintenanceMode_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:isInMaintenanceMode_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:isInMaintenanceMode_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:isInMaintenanceMode_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:isInMaintenanceMode_sam|trigger=none}{code:language=javascript} // WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client) //Returns true if the server is in maintenance mode, false otherwise. if (plugins.maintenance.isInMaintenanceMode()) application.output("Server is in maintenance mode."); else application.output("Server is not in maintenance mode."); {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=sendMessageToAllClients|class=node}{tr:id=name}{td}h6.sendMessageToAllClients{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}sendMessageToAllClients{span}{span:id=iets|style=float: left;}\(message){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:sendMessageToAllClients_des|trigger=button|text=}{sub-section}{sub-section:sendMessageToAllClients_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:sendMessageToAllClients_snc|trigger=button|text=}{sub-section}{sub-section:sendMessageToAllClients_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:sendMessageToAllClients_prs|trigger=button|text=}{sub-section}{sub-section:sendMessageToAllClients_prs|trigger=none|class=sIndent}\{[String]} message {sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:sendMessageToAllClients_ret|trigger=button|text=}{sub-section}{sub-section:sendMessageToAllClients_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:sendMessageToAllClients_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:sendMessageToAllClients_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:sendMessageToAllClients_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:sendMessageToAllClients_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:sendMessageToAllClients_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:sendMessageToAllClients_sam|trigger=none}{code:language=javascript} // WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client) //Sends a message to all connected clients. plugins.maintenance.sendMessageToAllClients("Hello, all clients!"); {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=sendMessageToClient|class=node}{tr:id=name}{td}h6.sendMessageToClient{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}sendMessageToClient{span}{span:id=iets|style=float: left;}\(clientId, message){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:sendMessageToClient_des|trigger=button|text=}{sub-section}{sub-section:sendMessageToClient_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:sendMessageToClient_snc|trigger=button|text=}{sub-section}{sub-section:sendMessageToClient_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:sendMessageToClient_prs|trigger=button|text=}{sub-section}{sub-section:sendMessageToClient_prs|trigger=none|class=sIndent}\{[String]} clientId \{[String]} message {sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:sendMessageToClient_ret|trigger=button|text=}{sub-section}{sub-section:sendMessageToClient_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:sendMessageToClient_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:sendMessageToClient_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:sendMessageToClient_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:sendMessageToClient_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:sendMessageToClient_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:sendMessageToClient_sam|trigger=none}{code:language=javascript} // WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client) //Sends a message to a specific client, identified by its clientId. The clientIds are retrieved by calling the getConnectedClients method. var clients = plugins.maintenance.getConnectedClients(
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetServerNames-Boolean_Boolean
Table Row (tr)
idname
Table Cell (td)

getServerNames

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String[]
Span
stylefont-weight: bold;
getServerNames
Span
(mustBeEnabled, mustBeValid)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
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.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Boolean} mustBeEnabled
{Boolean} mustBeValid
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String[]
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client)
//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.
var serverNames = plugins.maintenance.getServerNames();
application.output("There are " + serverNames.length + " servers.");
for (var i=0; i<serverNames.length; i++)
	application.output("Server " + i + ": " + serverNames[i]);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetServerNames-Boolean_Boolean_Boolean
Table Row (tr)
idname
Table Cell (td)

getServerNames

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String[]
Span
stylefont-weight: bold;
getServerNames
Span
(mustBeEnabled, mustBeValid, sort)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
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.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Boolean} mustBeEnabled
{Boolean} mustBeValid
{Boolean} sort
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String[]
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client)
//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.
var serverNames = plugins.maintenance.getServerNames();
application.output("There are " + serverNames.length + " servers.");
for (var i=0; i<serverNames.length; i++)
	application.output("Server " + i + ": " + serverNames[i]);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetServerNames-Boolean_Boolean_Boolean_Boolean
Table Row (tr)
idname
Table Cell (td)

getServerNames

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String[]
Span
stylefont-weight: bold;
getServerNames
Span
(mustBeEnabled, mustBeValid, sort, includeDuplicates)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
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.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Boolean} mustBeEnabled
{Boolean} mustBeValid
{Boolean} sort
{Boolean} includeDuplicates
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String[]
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client)
//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.
var serverNames = plugins.maintenance.getServerNames();
application.output("There are " + serverNames.length + " servers.");
for (var i=0; 
i<clients
i<serverNames.length
; i++) plugins.maintenance.sendMessageToClient(clients[i].getClientId(), "Hello, client
; i++)
	application.output("Server " + 
clients[
i
].getClientId()
 + "
!"); {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=setMaintenanceMode|class=node}{tr:id=name}{td}h6.setMaintenanceMode{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}setMaintenanceMode{span}{span:id=iets|style=float: left;}\(maintenanceMode){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:setMaintenanceMode_des|trigger=button|text=}{sub-section}{sub-section:setMaintenanceMode_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:setMaintenanceMode_snc|trigger=button|text=}{sub-section}{sub-section:setMaintenanceMode_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:setMaintenanceMode_prs|trigger=button|text=}{sub-section}{sub-section:setMaintenanceMode_prs|trigger=none|class=sIndent}\{[Boolean]} maintenanceMode {sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:setMaintenanceMode_ret|trigger=button|text=}{sub-section}{sub-section:setMaintenanceMode_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:setMaintenanceMode_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:setMaintenanceMode_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:setMaintenanceMode_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:setMaintenanceMode_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:setMaintenanceMode_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:setMaintenanceMode_sam|trigger=none}{code:language=javascript}
: " + serverNames[i]);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idisInMaintenanceMode
Table Row (tr)
idname
Table Cell (td)

isInMaintenanceMode

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
isInMaintenanceMode
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns true if the server is in maintenance mode, false otherwise.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client)
//Returns true if the server is in maintenance mode, false otherwise.
if (plugins.maintenance.isInMaintenanceMode())
	application.output("Server is in maintenance mode.");
else
	application.output("Server is not in maintenance mode.");
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsendMessageToAllClients-String
Table Row (tr)
idname
Table Cell (td)

sendMessageToAllClients

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
sendMessageToAllClients
Span
(message)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Sends a message to all connected clients.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} message
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// WARNING: maintenance plugin is only meant to run during
solution import using before or after import hook(so not from Smart/Web client) //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)
 solution import using before or after import hook(so not from Smart/Web client)
//Sends a message to all connected clients.
plugins.maintenance.
setMaintenanceMode(!plugins.maintenance.isInMaintenanceMode()); {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=shutDownAllClients|class=node}{tr:id=name}{td}h6.shutDownAllClients{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}shutDownAllClients{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:shutDownAllClients_des|trigger=button|text=}{sub-section}{sub-section:shutDownAllClients_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:shutDownAllClients_snc|trigger=button|text=}{sub-section}{sub-section:shutDownAllClients_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:shutDownAllClients_prs|trigger=button|text=}{sub-section}{sub-section:shutDownAllClients_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:shutDownAllClients_ret|trigger=button|text=}{sub-section}{sub-section:shutDownAllClients_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:shutDownAllClients_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:shutDownAllClients_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:shutDownAllClients_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:shutDownAllClients_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:shutDownAllClients_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:shutDownAllClients_sam|trigger=none}{code:language=javascript}
sendMessageToAllClients("Hello, all clients!");
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsendMessageToClient-String_String
Table Row (tr)
idname
Table Cell (td)

sendMessageToClient

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
sendMessageToClient
Span
(clientId, message)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Sends a message to a specific client, identified by its clientId. The clientIds are retrieved by calling the getConnectedClients method.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} clientId
{String} message
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client)
//Sends a message to a specific client, identified by its clientId. The clientIds are retrieved by calling the getConnectedClients method.
var clients = plugins.maintenance.getConnectedClients();
for (var i=0; i<clients.length; i++)
	plugins.maintenance.sendMessageToClient(clients[i].getClientId(), "Hello, client " + clients[i].getClientId() + "!");
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsetMaintenanceMode-Boolean
Table Row (tr)
idname
Table Cell (td)

setMaintenanceMode

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
setMaintenanceMode
Span
(maintenanceMode)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
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).
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Boolean} maintenanceMode
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// WARNING: maintenance plugin is only meant to run during solution
import using before or after import hook(so not from Smart/Web client) //Shuts down all connected clients. This method returns immediately, it does not wait until the client shuts down. plugins.maintenance.shutDownAllClients(); {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=shutDownClient|class=node}{tr:id=name}{td}h6.shutDownClient{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}shutDownClient{span}{span:id=iets|style=float: left;}\(clientId){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:shutDownClient_des|trigger=button|text=}{sub-section}{sub-section:shutDownClient_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:shutDownClient_snc|trigger=button|text=}{sub-section}{sub-section:shutDownClient_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:shutDownClient_prs|trigger=button|text=}{sub-section}{sub-section:shutDownClient_prs|trigger=none|class=sIndent}\{[String]} clientId {sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:shutDownClient_ret|trigger=button|text=}{sub-section}{sub-section:shutDownClient_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:shutDownClient_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:shutDownClient_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:shutDownClient_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:shutDownClient_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:shutDownClient_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:shutDownClient_sam|trigger=none}{code:language=javascript}
 import using before or after import hook(so not from Smart/Web client)
//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).
plugins.maintenance.setMaintenanceMode(!plugins.maintenance.isInMaintenanceMode());
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idshutDownAllClients
Table Row (tr)
idname
Table Cell (td)

shutDownAllClients

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
shutDownAllClients
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Shuts down all connected clients. This method returns immediately, it does not wait until the client shuts down.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client)
//Shuts down all connected clients. This method returns immediately, it does not wait until the client shuts down.
plugins.maintenance.shutDownAllClients();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idshutDownClient-String
Table Row (tr)
idname
Table Cell (td)

shutDownClient

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
shutDownClient
Span
(clientId)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Shuts down a specific client, identified by its clientId. The clientIds are retrieved by calling the getConnectedClients method. This method returns immediately, it does not wait until the client shuts down.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} clientId
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client)
//Shuts down a specific client, identified by its clientId. The clientIds are retrieved by calling the getConnectedClients method. This method returns immediately, it does not wait until the client shuts down.
var clients = plugins.maintenance.getConnectedClients();
for (var i=0; i<clients.length; i++)
	plugins.maintenance.shutDownClient(clients[i].getClientId());
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
Table Row (tr)
classlastDetailRow
Table Cell (td)