Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
AditiArora
Advisor
Advisor
0 Kudos
1,319


Simplifying Collaboration with SAP BTP Document Management Service (DMS)


In our previous blog post, we emphasized the importance of efficient collaboration in asset maintenance. Today, we delve deeper into the topic, focusing on how to simplify access to updated Excel sheets using public link sharing and using the power of SAP BTP Document Management Service (DMS) explore a unique approach to document sharing. Say goodbye to complex role assignments and access restrictions. Instead, we introduce a simple and efficient method to create shared folders and generate public links for seamless collaboration beyond organizational boundaries.

If you're new to SAP DMS or need a quick recap, we recommend referring to these earlier posts. They offer comprehensive insights into essential concepts like document uploading and downloading.

I would like to thank jayadnure for exploring the SAP DMS with me and gunteralbrecht for reviewing this blog post.

Systematic Approach


Presented below is a comprehensive outline of the key steps involved prior to invoking the APIs for creating a shared folder and a public share link.


Figure-1: Process Flow


Obtaining the repository ID and OAuth token can be accomplished by referring to the instructions outlined in the previous blog post.

Once these initial steps are completed, we can proceed with preparing the payload and invoking the respective APIs, which will be the focal point of this blog post. It's important to note that the following steps are common to both creating a shared folder and creating a public share link:

  1. Payload Preparation: Gather the necessary data and parameters required to construct the payload for the API request.

  2. API Invocation: Utilize the appropriate API endpoint to trigger the desired action. This will involve making the HTTP request with the prepared payload, incorporating the repository ID and OAuth token obtained earlier.

  3. Handling Responses: Capture and interpret the API response to determine the outcome of the action. Validate the response status, identify any error messages, and handle them accordingly.


Creating a Shared Folder


To create a shared folder, follow the structure outlined below:

  1. URL:

    • Use the following URL format: <ecmservice-url>/browser/<repository-id>/root.

    • Replace <ecmservice-url> with the URL of the ECMService, which provides document management capabilities.

    • Replace <repository-id> with the specific ID of the repository where the shared folder will be created.



  2. HTTP Method:

    • Use the HTTP POST method to initiate the creation of the shared folder.



  3. UAA URL:

    • The UAA URL refers to the URL of the User Account and Authentication (UAA) service.

    • Replace <uaa-url> with the appropriate UAA URL to obtain the OAuth token required for authentication.



  4. UAA clientid:

    • Use the specific client ID (<uaa-clientid>) assigned to your application within the UAA service.



  5. UAA clientsecret:

    • Utilize the corresponding client secret (<uaa-clientsecret>) associated with the assigned client ID for authentication purposes.



  6. Body:

    • Use the following in a multipart-form.








































cmisaction createFolder
propertyId[0] cmis:name
propertyValue[0] folderName_To_be_Replaced
propertyId[1] cmis:objectTypeId
propertyValue[1] sap:share
propertyId[2] cmis:secondaryObjectTypeIds
propertyValue[2] sap:sharedObject
succinct true

By following this structure and incorporating the correct values for each component, you will be able to create a shared folder successfully.This will give the objectId of the folder created in response.

Creating a Public Share Link


To create a public share link, you can follow the structure provided below:

  1. URL:

    • Use the following URL format: <ecmservice-url>/browser/<repository-id>/root/<folder-path>.

    • Replace <ecmservice-url> with the URL of the ECMService, which provides document management capabilities.

    • Replace <repository-id> with the specific ID of the repository where the folder containing the file resides.

    • Replace <folder-path> with the path to the folder that contains the file you want to generate a public share link for.



  2. HTTP Method:

    • Use the HTTP POST method to initiate the process of creating a public share link.



  3. UAA URL:

    • The UAA URL refers to the URL of the User Account and Authentication (UAA) service.

    • Replace <uaa-url> with the appropriate UAA URL to obtain the OAuth token required for authentication.



  4. UAA clientid:

    • Use the specific client ID (<uaa-clientid>) assigned to your application within the UAA service.



  5. UAA clientsecret:

    • Utilize the corresponding client secret (<uaa-clientsecret>) associated with the assigned client ID for authentication purposes.



  6. Body:

    • Use the following in a multipart-form.



































cmisaction update
propertyId[0] cmis:secondaryObjectTypeIds
propertyValue[0][0] sap:sharedObject
propertyValue[0][1] sap:publicLink
objectId From_Previous_Response
filter *
succinct true

By incorporating these components into your implementation and replacing the placeholders with the actual values specific to your environment, you will be able to get the publicLinkId in the response.

To access the public share link generated from the previous requests, you can use the following URL format:
<ecmservice-url>/public.html/#public/v1/open/pubLinkId=<publicLinkId-from-response>&objId=<objectId-from-response>



  • Replace <ecmservice-url> with the URL of the ECMService.

  • In the URL, you will need to replace <publicLinkId-from-response> with the actual public link ID obtained from the response of the API request.

  • Similarly, replace <objectId-from-response> with the actual object ID associated with the file or folder for which the public share link was created.


By using this URL structure and populating it with the relevant IDs, you will be able to access the public share link and open the corresponding file or folder in the ECMService without the need for explicit authentication.

Summary


SAP Document Management Service (DMS) offers a multitude of possibilities for optimizing document management processes. In this blog post, we have delved into one such possibility and showcased its potential benefits.

However, SAP DMS encompasses a broad range of use cases beyond what we have covered here. We invite you to explore its versatility and discover how it can be tailored to meet your specific needs.

If you have any questions or would like to share your experiences with SAP DMS, please leave a comment in the blog post.


References



  1. Collaboration Help

1 Comment