on 2020 Oct 05 5:33 PM
Hi,
I've started using the Cloud Foundry Document Management (repository and integration options) and I can't work out what I'm doing wrong. Any help at all would be really appreciated.
I've created and onboarded a repository as per the instructions at help.sap.com, and I've also hooked the Reuse UI into my application for testing purposes. When using the API in Postman or my own code, even just trying to create a folder returns me with a "500 Internal Server Error". When using the Reuse UI all of the buttons are disabled so I cannot add anything there either. In the network panel for the Reuse UI I can see it is reaching my endpoint and finding my repository so it's not an error with my app router or destinations.
My main questions are:
Thanks
John
Request clarification before answering.
Hi jmurray91
I usually use CMIS Workbench to troubleshoot CMIS API calls. It also makes your life easier when dealing with the payload you need to send via CMIS protocol. You can download it via the following URL:
https://chemistry.apache.org/java/download.html
Once you have it up and running, connect to the browser service like this:

Click on the Expert tab and past the bearer token like so:

Click on the load Repositories, select the one you want to work on and click on the login button.
You should see a window like this:

Here you can use Groovy Script to test the code you want to use on your CMIS Client Application.
Officially, Apache open CMIS project supports a JQuery JavaScript library:
https://chemistry.apache.org/javascript/parts.html
However, I was able to use the cmis NodeJs Object with the following code:
const express = require('express')
const app = express()
const port = 3000
var cmis = require('cmis');
const { json } = require('express');
app.get('/', (req, res) => {
var session = new cmis.CmisSession('https://api-sdm-di.cfapps.eu10.hana.ondemand.com/browser');
session.setToken('eyJhbGci........................................................71YjfA')
.loadRepositories().then(function(){
return session.query('SELECT cmis:objectId, cmis:name, cmis:contentStreamLength FROM cmis:document');
}).then(function(data) {
console.log(data);
res.send(data);
});
})
app.listen(port, () => {
console.log(`Example app listening at http://localhost:${port}`)
})
This is the result set I get when I run this application:

Which is pretty much the same as I get on the CMIS Workbench:

Best regards,
Ivan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's brilliant, thank you for responding. Very useful information! I did eventually manage to get my Reuse UI to work, but then got an error about my quotas (but I have unlimited quota) so I have raised an OSS message.
The workbench looks extremely useful so thank you for letting me know about that. It's also great that you've found the cmis nodejs library to work as that's the one I'm attempting to use.
Thanks
John
Hi pcostantini_bbt,
I didn't test this JS library on CF at all. But you may find createDocument method available at:
https://svn.apache.org/repos/asf/chemistry/parts/trunk/cmis-js/lib/cmis.js
And same samples using it at:
https://svn.apache.org/repos/asf/chemistry/parts/trunk/cmis-js/components/library/template.html
Best regards,
Ivan
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.