Page History
...
padding | 0px |
---|---|
width | 80px |
...
Table Row (tr) | |||||
---|---|---|---|---|---|
| |||||
|
...
Table Cell (td) |
---|
JSTableObject |
...
Divcache | ||
---|---|---|
| DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
...
id | description |
---|
...
| |||||||||||||
...
Table Cell (td) |
---|
Boolean |
...
Table Cell (td) |
---|
JSTableObject |
...
...
...
Table Cell (td) |
---|
String[] |
...
...
Table Cell (td) |
---|
Boolean |
...
...
...
...
Table Cell (td) |
---|
Boolean |
...
...
...
...
...
padding | 0px |
---|---|
width | 100% |
...
...
Table Head (th) | ||
---|---|---|
| ||
Method Details |
...
id | createNewTable-String |
---|
Table Row (tr) | ||
---|---|---|
| ||
|
...
id | sig |
---|
...
Span | ||
---|---|---|
| ||
JSTableObject |
Span | ||
---|---|---|
| ||
createNewTable |
...
createNewTable(tableName) |
...
...
Creates in this server a new table with the specified name. |
...
...
Parameters |
...
...
...
...
...
Returns |
...
...
...
id | prs |
---|
...
class | sIndent |
---|
...
Table Row (tr) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
|
...
class | lastDetailRow |
---|
...
id | dropTable-String |
---|
Table Row (tr) | ||
---|---|---|
| ||
|
Table Row (tr) | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Supported Clients Sample dropTable(tableName)Drops the table with the specified name from this server. Parameters |
...
...
Returns |
...
...
...
...
Supported Clients |
...
class | lastDetailRow |
---|
...
id | getTable-String |
---|
Table Row (tr) | ||
---|---|---|
| ||
|
Table Row (tr) | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
...
id | prs |
---|
...
class | sIndent |
---|
...
Sample |
...
class | sIndent |
---|
...
Code Block | ||
---|---|---|
| ||
var server = plugins.maintenance.getServer("example_data");
if (server) {
var result = server.dropTable("new_table");
if (result)
application.output("Table dropped.");
else
application.output("Table not dropped.");
} |
...
getTable(tableName)Returns a JSTable instance corresponding to the table with the specified name from this server. Parameters |
...
...
Returns |
...
...
...
...
...
Supported Clients |
...
class | lastDetailRow |
---|
...
id | getTableNames |
---|
Table Row (tr) | ||
---|---|---|
| ||
|
Table Row (tr) | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
...
id | ret |
---|
...
class | sIndent |
---|
...
Sample |
...
class | sIndent |
---|
...
Code Block | ||
---|---|---|
| ||
var server = plugins.maintenance.getServer("example_data");
if (server) {
var table = server.getTable("employees");
if (table) {
var colNames = table.getColumnNames()
application.output("Table has " + colNames.length + " columns.");
for (var i=0; i<colNames.length; i++)
application.output("Column " + i + ": " + colNames[i]);
}
} |
Table Row (tr) | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
|
...
class | lastDetailRow |
---|
...
id | reloadDataModel |
---|
Table Row (tr) | ||
---|---|---|
| ||
|
Table Row (tr) | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
|
...
class | lastDetailRow |
---|
...
id | synchronizeWithDB-JSTableObject |
---|
Table Row (tr) | ||
---|---|---|
| ||
|
Table Row (tr) | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
...
id | prs |
---|
...
class | sIndent |
---|
...
getTableNames()Returns an array with the names of all tables in this server. Returns |
Table Row (tr) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
|
...
class | lastDetailRow |
---|
...
id | isValid |
---|
Table Row (tr) | ||
---|---|---|
| ||
|
...
Supported Clients Sample isValid()Get valid state for the server. Returns Supported Clients Sample reloadDataModel()Reloads the datamodel from the database, if changed externally or via rawSQL plugin.
This call is not needed after a call to synchronizeWithDB(). Supported Clients Sample synchronizeWithDB(table)Synchronizes a JSTable instance with the database. If columns were added to or removed from the JSTable instance, all these changes will now be persisted to the database. Parameters |
...
...
Returns |
...
...
...
...
Supported Clients |
...
class | lastDetailRow |
---|
...
Sample |
...
class | sIndent |
---|
...
Code Block | ||
---|---|---|
| ||
var server = plugins.maintenance.getServer("example_data");
if (server)
{
var table = server.createNewTable("new_table");
if (table) {
var pk = table.createNewColumn("new_table_id", JSColumn.INTEGER, 0);
pk.rowIdentifierType = JSColumn.PK_COLUMN;
if (server.synchronizeWithDB(table))
application.output("New table created in the database.");
else
application.output("New table not created in database.");
}
else application.output("New table not created at all.");
} |