cancel
Showing results for 
Search instead for 
Did you mean: 

CRUD operations for SAP document service repository via proxy bridge(java app)

Former Member
0 Kudos

Hello experts,

I have created an UI application where user can upload and download the documents to sap document service repository via proxy bridge(java app deployed on the cloud).

Same way I tried update/delete operations for uploaded documents but I'm facing method not allowed error.

I'm looking if anyone implemented CRUD operation for SAP document service repository if yes could please assist me to achieve update/delete methods on the same.

thanks in advance.

0 Kudos

Hello!

"I have created an UI application where user can upload and download the documents to sap document service repository via proxy bridge(java app deployed on the cloud)."

How did you achieve this? Did you use a tutorial?

Regards,

Karla.

Accepted Solutions (0)

Answers (1)

Answers (1)

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

I get method not allowed when I do not specify the repository id and folder id where I want to upload the document.

Are you trying this with postman or by using the example provided in the documentation (web form hidden fields)?

For instance, if you do a get on the /cmis/atom endpoint, you will get the root folder link:

        <app:collection href="https://cmisproxy<account>.<landscape>.ondemand.com/proxybridge/cmis/1.1/atom/<repo_id>/children?id=<root_folder_id>">
            <cmisra:collectionType>root</cmisra:collectionType>
            <atom:title type="text">Root Collection</atom:title>
            <app:accept>application/atom+xml;type=entry</app:accept>
            <app:accept>application/cmisatom+xml</app:accept>
        </app:collection>

Therefore, the URL to post to the root folder should be:

https://cmisproxy<account>.<landscape>.ondemand.com/proxybridge/cmis/1.1/atom/<repo_id>/children?id=...;

Once you have it, copy the link as a POST request, and use the atom xml below to send the file:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<atom:entry 
xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" 
xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/" 
xmlns:atom="http://www.w3.org/2005/Atom" 
xmlns:app="http://www.w3.org/2007/app" 
xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/">
    <atom:title>CarBooking.pdf</atom:title>
    <cmisra:content>
            <cmisra:mediatype>application/pdf</cmisra:mediatype>
<cmisra:base64>

--------> Paste the base64 converted file here

</cmisra:base64>
    </cmisra:content>
    <cmisra:object>
        <cmis:properties>
            <cmis:propertyId propertyDefinitionId="cmis:objectTypeId">
                <cmis:value>cmis:document</cmis:value>
            </cmis:propertyId>
            <cmis:propertyId propertyDefinitionId="cmis:name">
                <cmis:value>PDF Document Upload</cmis:value>
            </cmis:propertyId>
        </cmis:properties>
    </cmisra:object>
</atom:entry>

As you can see, it is not as easy as using the CMIS Java Library or the form in an HTML5 application, since most operations are taken care by the UI. You still need to know the root folder collection URI to be used in the destination. If you want it to manage uploads to different folders your need to create the UI to retrieve the folder list.

Best regards,
Ivan