-
Notifications
You must be signed in to change notification settings - Fork 27
Using the JSDO and DataSource components in a Node.js app
edselg edited this page May 18, 2018
·
1 revision
JSDO Version: 5.0.0 (Tech Preview for Node.js)
- mkdir nodetest
- cd nodetest
- npm init -f
- npm install @progress/jsdo-node
- node index.js
var jsdo_core_1 = require("@progress/jsdo-core");
var progress = jsdo_core_1.progress;
var jsdo_node_1 = require("@progress/jsdo-node");
var DataSource = jsdo_node_1.DataSource;
var serviceURI = "https://oemobiledemo.progress.com/OEMobileDemoServices";
var catalogURI = "https://oemobiledemo.progress.com/OEMobileDemoServices/static/SportsService.json";
progress.data.getSession({
serviceURI: serviceURI,
catalogURI: catalogURI,
authenticationModel: "anonymous"
}).then((object) => {
console.log("DEBUG: getSession: result: ", object.result);
var jsdo = new progress.data.JSDO({ name: 'Customer' });
var dataSource = new DataSource({
jsdo: jsdo,
tableRef: "ttCustomer",
// filter: "CustNum < 11"
filter: {
field: "CustNum",
operator: "lte",
value: 11
}
});
dataSource.read()
.subscribe((mydata) => {
mydata.data.forEach((element) => {
console.log(element.Name);
});
}, () => {
console.log("Error while reading records.");
});
}, (object) => {
console.log("Error while creating session: ");
console.log("DEBUG: object: result: ", object.result, "info: ", object.info);
});
- DataSource API
- Starter Template Tutorial
- Using the JSDO component with plain HTML and JavaScript
- Using the JSDO and DataSource components with an existing NativeScript app
- Using the JSDO and DataSource components in an Angular web app (Angular-5.x)
- Using the JSDO and DataSource components in an Angular web app (Angular-6.x)
- Using the JSDO and DataSource components in a Node.js app