cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Cloud Platform Cloud Foundry Document Management help

johnmurray
Participant
0 Likes
5,482

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:

  1. Is there any logging available anywhere to help with the unhelpful 500 Internal server error messages?
  2. Are there any guides anywhere that contain working examples of code and not just snippets?
  3. What should the "objectId" be for the Reuse UI if I'm just working at the root level?

Thanks

John

View Entire Topic
Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert

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

johnmurray
Participant
0 Likes

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

0 Likes
ivan.mirisola are you using this nodeJs app as a destination in CF and accessing it by another sap Fiori App?

Do you have another method implemented in nodeJs for uploading a file in that repository?

Thanks in advance.
Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert
0 Likes

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

0 Likes

ivan.mirisola how do you get the content of the documents?