-
Installation
To use denode library you need to install a windows 32-bit version of node form https://nodejs.org/en/download/ by using the msi installer. Default path should be C:\Program Files (x86)\nodejs and let node be added to the path to make thinks simpler for your self.
The node api for DataEase Prism must at the moment be installed manually by using the given zip file. The zip file holds a folder called denode. This must be copied into the root of your node project. If this is the first use of the module, you must also copy the given $4tp$.key license file into C:\ProgramData\DataEase\nodejs if the node installation is installed in the default directory C:\Program Files (x86)\nodejs.
The api can only be used with DataEase 10 application as this is the version of prism supported.
After this you simply need to initialize and use the library like this
var denode = require('./denode') var prism = new denode.Prism(); var prismpath = __dirname + '\\denode' console.log('Path to this denode is: ' + prismpath); prism.setprismpath(prismpath); var isinit = prism.prisminit(); console.log("is init done with result " + isinit); if (isinit == true) { console.log("Prism init ok"); var repo = new denode.Repo(); repo.openrepo('The repo name', 'C:\\Path\\To\\DataEase\\Application'); console.log(repo.listtablenames()); var tname = 'MyTable'; var mv = new denode.MultiView(); mv.create(tname); mv.addmainrelation(tname,true,false); if (mv && mv.startasreadonly()) { var row = 0; while (mv.setmainrow(row)){ console.log(mv.getcolumndatabyindex(0)); row++; } mv.end(); mv.destroy(); } repo.closerepo(); } else console.log("Prism init failed"); prism.prismclose()<br>
This will first load the module and create a connection to prism. Prism need to know where the module is, so we add a prismpath and init prism. Then we create and open a repository. After this you can use multiviews and dqls in this repository using the api commands. When finish, make sure to close repo and shut down prism.