Last active
January 31, 2022 09:32
-
-
Save saurav28/3f8e073946d7f3482ce1258264ec717c to your computer and use it in GitHub Desktop.
Revisions
-
saurav-sarkar-1 renamed this gist
Jan 7, 2021 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
saurav-sarkar-1 created this gist
Jan 7, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ //sample script to connect to SAP Document Managment using cmisjs // https://github.com/agea/CmisJS var cmis = require('cmis'); //Pre-requisite is to create a service instance of SDM and onboard a repository. // SDM api endpoint will be provided in VCAP var session = new cmis.CmisSession('<server url>'); //fetch the token progmatically using the UAA token endpoint session.setToken('< access token>').loadRepositories() .then(function(){ return session.query("select * from cmis:document", false) }) .then(function(data) {console.log(data); //change the default repository such that the subsequent APIs execute against the changed repository var keys = Object.keys(session.repositories); session.defaultRepository = session.repositories[keys[1]]; var result = session.query("select * from cmis:document", false); result.then((data => console.log(data))) }) .catch(err => console.log(err));