Introduction

SAP BTP Document Management Service is being positioned across a gamut of SAP Products as a CMIS DMS. Products like S/4Hana Cloud and On-Premise can now connect to SAP BTP DMS as a External Repository for your Document Management Needs. Likewise, SAP BTP CPI can also now connect to BTP DMS and push messages for Archival. SAP BTP DMS Integration and Repository Option Provides a free tier version on BTP and this post is an attempt to help get started with the Initial Set up before you can integrate this with other Systems

Subaccount Settings

Create Subaccount -Optional

Create a Subaccount if you would like to use a separate Subaccount for BTP DMS. You may of course skip this step if you want to use an existing SubAccount.

Enable Cloud Foundry in your Subaccount – Optional

Configure Entitlements – Document Management Service, Integration Option

  • Note : I have selected free option here.
  • For Productive purposes please use Standard Option. Ofcourse Standard Option comes with its pricing.
  • Ensure you Save your Entitlements

Configure Entitlements – Document Management Service, Repository Option

  • Note : I have selected free option here.
  • For Productive purposes please use Standard Option. Ofcourse Standard Option comes with its pricing.
  • You use this if you want to connect to a SAP BTP Repository ( Storage). If you plan to use external Storage you can skip this step.
  • In the remainder of this post, we assume that you connect to a SAP BTP Internal Repository like here and not to a External Repository.
  • Ensure you Save your Entitlements

Ensure you Save your Entitlements

Create Space in BTP Subaccount – Optional

  • Go to Cloud Foundry –> Spaces and Create a Space ( if you want to use a dedicated space for DMS ).
  • There should be atleast 1 Space in your Subaccount

Subscribe to Document Management Service Integration Option

Go to Services Service Marketplace and select Document Management Service, Integration Option and say Create

Create Service Key for your DMS Instance

Details required from the Service Key

  • ecmservice -> url -> Will be referred to as ecm_url herewith
  • uaa -> clientid
  • uaa -> clientsecret
  • uaa -> url -> Will be referred to as uaa_url herewith

Create Repository using Postman

Get Token

The Get Token can be done in multiple ways but for simplicity I have listed this down here as this is a OAUTH2 Client Credentials.

  • URL: {{uaa_url}}/oauth/token?grant_type=client_credentials ; where uaa_url is the URL taken from ServiceKey
  • Authentication: Basic ( client_id and client_secret from Service Key)
  • Get the access_token from the response.

Create a Repository

  • URL: {{ecm_url}}/rest/v2/repositories; where ecm_url is the URL taken from ServiceKey
  • Authentication: Bearer Token with access_token from previous GetToken call.
  • Method : Post
  • Request JSON is as below
    • displayName : Any Name
    • description : Any Value
    • repositoryType : Internal to use BTP DMS Repository.
    • Other fields are self explanatory.
{
    "repository": {
         "displayName": "TestRepository",
        "description": "TestRepository",
        "repositoryType": "internal",
        "isVersionEnabled": "true",
        "isVirusScanEnabled": "false",
        "skipVirusScanForLargeFile": "false",
        "hashAlgorithms": "SHA-256"
    }
}

Note the value of id in the response – this is your repository Id to use for connecting to your repository. If you do not do this, thats Ok, you can retrieve the Id using the next step ( if you need it )

Use Browser API to Check the Repositories created

While in the previous section we created a Repository, it is also essential to be able to view the repositories created and their Id’s etc. SAP BTP DMS Integration Provides the CMIS APIs for this.

Use the below API to Browse the CMIS and get the Id’s.

Note: the repositoryId from the response. If you have multiple repositories created, you will have multiple repositoryId in the JSON response.

  • URL: {{ecm_url}}/browser; where ecm_url is the URL taken from ServiceKey
  • Authentication: Bearer Token with access_token from previous GetToken call.
  • Method : get

Use Apache Chemistry CMIS Workbench to browse the repository

Download Apache Chemistry CMIS Workbench

Download the Apache Chemistry CMIS Workbench ( Apache Chemistry OpenCMIS Downloads )

Run Apache Chemistry CMIS Workbench

Unzip the file and run workbench.bat ( Note : your java path needs to be set )

Connect to your Repository using Apache CMIS Workbench

Click “Load Repositories“, select your Repository and Login

Your repository will open

You can now play around and create a Folder, upload a file etc.

Final Thoughts

We have successfully configured a SAP BTP DMS Repository using the Integration Option on SAP BTP DMS. We have explored the APIs to browse the repository. We have created a Custom Repository. Your basic repository is now ready. This can now be integrated with other SAP Systems.

As this Repository is a CMIS Compliant Repository you can also now use this with other CMIS Compliant tools to browse, view content, create content, check in , check out etc.