Page History
...
padding | 0px |
---|---|
width | 80px |
...
Table Row (tr) | |||||
---|---|---|---|---|---|
| |||||
|
...
Table Cell (td) |
---|
JSCalculation |
...
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) |
---|
JSCalculation[] |
...
...
Table Cell (td) |
---|
String |
...
...
...
Table Cell (td) |
---|
JSMethod |
...
Table Cell (td) |
---|
JSMethod[] |
...
...
Table Cell (td) |
---|
JSCalculation |
...
...
...
Table Cell (td) |
---|
JSCalculation |
...
Table Cell (td) |
---|
JSMethod |
...
...
...
Table Cell (td) |
---|
Boolean |
...
...
...
Table Cell (td) |
---|
Boolean |
...
...
...
padding | 0px |
---|---|
width | 100% |
...
...
Table Head (th) | ||
---|---|---|
| ||
Method Details |
...
id | getCalculation-String |
---|
Table Row (tr) | ||
---|---|---|
| ||
|
Table Row (tr) | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
|
...
class | lastDetailRow |
---|
...
id | getCalculations |
---|
Table Row (tr) | ||
---|---|---|
| ||
|
Table Row (tr) | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
|
...
class | lastDetailRow |
---|
...
id | getDataSource |
---|
Table Row (tr) | ||
---|---|---|
| ||
|
Table Row (tr) | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
|
...
class | lastDetailRow |
---|
...
id | getMethod-String |
---|
Table Row (tr) | ||
---|---|---|
| ||
|
Table Row (tr) | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
|
...
class | lastDetailRow |
---|
...
id | getMethods |
---|
Table Row (tr) | ||
---|---|---|
| ||
|
Table Row (tr) | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
|
...
class | lastDetailRow |
---|
...
id | newCalculation-String |
---|
Table Row (tr) | ||
---|---|---|
| ||
|
Table Row (tr) | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
...
id | prs |
---|
...
class | sIndent |
---|
...
getCalculation(name)Get an existing calculation for the datasource node. Parameters Returns Supported Clients Sample getCalculations()Gets all the calculations for the datasource node. Returns Supported Clients Sample getDataSource()Get the data source for this node. Returns Supported Clients Sample getMethod(name)Get an existing foundset method for the datasource node. Parameters Returns Supported Clients Sample getMethods()Gets all the foundset methods for the datasource node. Returns Supported Clients Sample newCalculation(code)Creates a new calculation for the given code, the type will be the column where it could be build on (if name is a column name),
else it will default to JSVariable.TEXT; Parameters |
...
...
Returns |
...
...
Supported Clients |
...
id | sam |
---|
...
class | lastDetailRow |
---|
...
id | newCalculation-String_Number |
---|
Table Row (tr) | ||
---|---|---|
| ||
|
...
id | sig |
---|
...
Span | ||
---|---|---|
| ||
JSCalculation |
Span | ||
---|---|---|
| ||
newCalculation |
...
Sample |
...
class | sIndent |
---|
...
Code Block | ||
---|---|---|
| ||
var calc = solutionModel.getDataSourceNode("db:/example_data/customers").newCalculation("function myCalculation() { return 123; }", JSVariable.INTEGER);
var calc2 = solutionModel.getDataSourceNode("db:/example_data/customers").newCalculation("function myCalculation2() { return '20'; }");
var calc3 = solutionModel.getDataSourceNode("db:/example_data/employees").newCalculation("function myCalculation3() { return 'Hello World!'; }", JSVariable.TEXT);
var c = solutionModel.getDataSourceNode("db:/example_data/customers").getCalculation("myCalculation");
application.output("Name: " + c.getName() + ", Stored: " + c.isStored());
var allCalcs = solutionModel.getDataSourceNode("db:/example_data/customers").getCalculations();
for (var i = 0; i < allCalcs.length; i++) {
application.output(allCalcs[i]);
} |
newCalculation(code, type) |
...
...
...
Creates a new calculation for the given code and the type, if it builds on a column (name is a column name) then type will be ignored. |
...
...
Parameters |
...
...
...
...
...
...
...
...
Returns |
...
...
Supported Clients |
...
id | sam |
---|
...
class | lastDetailRow |
---|
...
id | newMethod-String |
---|
Table Row (tr) | ||
---|---|---|
| ||
|
Table Row (tr) | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
...
id | prs |
---|
...
class | sIndent |
---|
...
Sample |
...
class | sIndent |
---|
...
Code Block | ||
---|---|---|
| ||
var calc = solutionModel.getDataSourceNode("db:/example_data/customers").newCalculation("function myCalculation() { return 123; }", JSVariable.INTEGER);
var calc2 = solutionModel.getDataSourceNode("db:/example_data/customers").newCalculation("function myCalculation2() { return '20'; }");
var calc3 = solutionModel.getDataSourceNode("db:/example_data/employees").newCalculation("function myCalculation3() { return 'Hello World!'; }", JSVariable.TEXT);
var c = solutionModel.getDataSourceNode("db:/example_data/customers").getCalculation("myCalculation");
application.output("Name: " + c.getName() + ", Stored: " + c.isStored());
var allCalcs = solutionModel.getDataSourceNode("db:/example_data/customers").getCalculations();
for (var i = 0; i < allCalcs.length; i++) {
application.output(allCalcs[i]);
} |
...
newMethod(code)Creates a new foundset method with the specified code. Parameters |
...
...
Returns |
...
...
...
...
Supported Clients |
...
class | lastDetailRow |
---|
...
id | removeCalculation-String |
---|
Table Row (tr) | ||
---|---|---|
| ||
|
Table Row (tr) | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
...
id | prs |
---|
...
class | sIndent |
---|
...
Sample |
...
class | sIndent |
---|
...
Code Block | ||
---|---|---|
| ||
var method = solutionModel.getDataSourceNode("db:/example_data/orders").newMethod("function doubleSize() { return 2*getSize(); }");
application.output('Doubled orders for this customer: '+customers_to_orders.doubleSize()) |
...
removeCalculation(name)Removes the calculation specified by name. Parameters |
...
...
Returns |
...
...
Table Row (tr) | ||
---|---|---|
| ||
|
Table Row (tr) | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
...
id | prs |
---|
...
class | sIndent |
---|
...
Table Row (tr) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
|
...
class | lastDetailRow |
---|
...
id | removeMethod-String |
---|
...
Supported Clients Sample removeMethod(name)Removes the foundset method specified by name. Parameters |
...
...
Returns |
...
...
...
Supported Clients |
...
class | lastDetailRow |
---|
...
Sample |
...
class | sIndent |
---|
...
Code Block | ||
---|---|---|
| ||
var method1 = solutionModel.getDataSourceNode("db:/example_data/customers").newMethod("function myFoundsetMethod1() { return 123; }");
var method2 = solutionModel.getDataSourceNode("db:/example_data/customers").newCalculation("function myFoundsetMethod2() { return '20'; }");
var m = solutionModel.getDataSourceNode("db:/example_data/customers").getMethod("myFoundsetMethod1");
application.output("Name: " + m.getName());
solutionModel.getDataSourceNode("db:/example_data/customers").removeMethod("myFoundsetMethod1");
m = solutionModel.getDataSourceNode("db:/example_data/customers").getCalculation("myFoundsetMethod1");
if (m != null) { application.output("myFoundsetMethod1 could not be removed."); }
var allMethods = solutionModel.getDataSourceNode("db:/example_data/customers").getMethod();
for (var i = 0; i < allMethods; i++)
{
application.output(allMethods[i]);
} |