Child pages
  • Maintenance Mode

Versions Compared

Key

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

...

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="28f38d1c-3afd-4ac7-9008-fce68cd0fa0c"><ac:plain-text-body><![CDATA[[mustBeEnabled] -
]]></ac:plain-text-body></ac:structured-macro>
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="df2daa30-0a55-4b51-9ce2-a7f1b0538754"><ac:plain-text-body><![CDATA[[mustBeValid] -
]]></ac:plain-text-body></ac:structured-macro>

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="3df53907-d125-495e-ab18-c11be4c1acb0"><ac:plain-text-body><![CDATA[[mustBeEnabled] -
]]></ac:plain-text-body></ac:structured-macro>
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="70164fa8-f2cc-4f6f-80c0-304f12f5216c"><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="0d097305-170c-4f3f-bba6-7f2a62f474f1"><ac:plain-text-body><![CDATA[[sort] -
]]></ac:plain-text-body></ac:structured-macro>
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="bf6ad5d7-ed8e-444f-939e-890d75234a27"><ac:plain-text-body><![CDATA[[includeDuplicates] -
]]></ac:plain-text-body></ac:structured-macro>

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