Table Row (tr) |
---|
| Table Head (th) |
---|
| Method Details |
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getCalculation |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get an existing calculation for the datasource node. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters
Div |
---|
| {String} name – The name of the calculation |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| 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]);
}
|
|
|
|
| {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getCalculations}{tr:id=name}{td}h6.getCalculations{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[JSCalculation]\[]{span}{span:style=font-weight: bold;}getCalculations{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Gets all the calculations for the datasource node.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[JSCalculation]\[]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getCalculations |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Gets all the calculations for the datasource node. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| 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]);
}
|
|
|
|
| {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getDataSource}{tr:id=name}{td}h6.getDataSource{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[String]{span}{span:style=font-weight: bold;}getDataSource{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get the data source for this node.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String] -- the dataSource{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getDataSource |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the data source for this node. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var nodeDataSource = solutionModel.getDataSourceNode("db:/example_data/customers").getDataSource();
|
|
|
|
| {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getMethod-String}{tr:id=name}{td}h6.getMethod{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[JSMethod]{span}{span:style=font-weight: bold;}getMethod{span}{span}\(name){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get an existing foundset method for the datasource node.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} name -- The name of the method
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[JSMethod]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get an existing foundset method for the datasource node. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters
Div |
---|
| {String} name – The name of the method |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| 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())
|
|
|
|
| {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getMethods}{tr:id=name}{td}h6.getMethods{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[JSMethod]\[]{span}{span:style=font-weight: bold;}getMethods{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Gets all the foundset methods for the datasource node.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[JSMethod]\[]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getMethods |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Gets all the foundset methods for the datasource node. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| 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())
|
|
|
|
| {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=newCalculation-String}{tr:id=name}{td}h6.newCalculation{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[JSCalculation]{span}{span:style=font-weight: bold;}newCalculation{span}{span}\(code){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}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;{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} code -- The code of the calculation, this must be a full function declaration.
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[JSCalculation]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
newCalculation |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| 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; |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters
Div |
---|
| {String} code – The code of the calculation, this must be a full function declaration. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| 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]);
}
|
|
|
|
| {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id= Table Body (tbody) |
---|
id | newCalculation-String_Number |
---|
| }{:=}{td}h6.newCalculation{td}{tr}{tr:id=sig}{td}{span:style= | Table Cell (td) |
---|
newCalculation |
|
| }[]{span}{span:style= }{span}{span}\(code, type){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}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.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} code -- The code of the calculation, this must be a full function declaration.
\{[Number]} type -- The type of the calculation, one of the JSVariable types.
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[JSCalculation]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| 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. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters
Div |
---|
| {String} code – The code of the calculation, this must be a full function declaration. {Number} type – The type of the calculation, one of the JSVariable types. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| 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 |
|
|
|
| ]);
}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=newMethod-String}{tr:id=name}{td}h6.newMethod{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[JSMethod]{span}{span:style=font-weight: bold;}newMethod{span}{span}\(code){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Creates a new foundset method with the specified code.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} code -- the specified code for the foundset method
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[JSMethod] -- a JSMethod object{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Creates a new foundset method with the specified code. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters
Div |
---|
| {String} code – the specified code for the foundset method |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| 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())
|
|
|
|
| {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=removeCalculation-String}{tr:id=name}{td}h6.removeCalculation{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}removeCalculation{span}{span}\(name){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Removes the calculation specified by name.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} name -- the name of the calculation to be removed
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean] -- true if the removal was successful, false otherwise{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} Table Body (tbody) |
---|
id | removeCalculation-String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
removeCalculation |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Removes the calculation specified by name. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters
Div |
---|
| {String} name – the name of the calculation to be removed |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns
Div |
---|
| Boolean – true if the removal was successful, false otherwise |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var calc1 = solutionModel.getDataSourceNode("db:/example_data/customers").newCalculation("function myCalculation1() { return 123; }", JSVariable.INTEGER);
var calc2 = solutionModel.getDataSourceNode("db:/example_data/customers").newCalculation("function myCalculation2() { return '20'; }");
var c = solutionModel.getDataSourceNode("db:/example_data/customers").getCalculation("myCalculation1");
application.output("Name: " + c.getName() + ", Stored: " + c.isStored());
solutionModel.getDataSourceNode("db:/example_data/customers").removeCalculation("myCalculation1");
c = solutionModel.getDataSourceNode("db:/example_data/customers").getCalculation("myCalculation1");
if (c != null) {
application.output("myCalculation could not be removed.");
}
var allCalcs = solutionModel.getDataSourceNode("db:/example_data/customers").getCalculations();
for (var i = 0; i < allCalcs.length; i++) {
application.output(allCalcs[i]);
}
|
|
|
|
| {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=removeMethod-String}{tr:id=name}{td}h6.removeMethod{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}removeMethod{span}{span}\(name){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Removes the foundset method specified by name.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} name -- the name of the method to be removed
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean] -- true if the removal was successful, false otherwise{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
removeMethod |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Removes the foundset method specified by name. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters
Div |
---|
| {String} name – the name of the method to be removed |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns
Div |
---|
| Boolean – true if the removal was successful, false otherwise |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| 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]);
}
|
|
|
|
| {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table} |