Use the Document Service in Your Java Application
2020-02-12
Beginner
25 min.
In this part of the tutorial series you will learn how to implement the SAP Cloud Platform Document service in your e-commerce Java application.
You will learn
- How to connect your application to the Document service
- How to store sales orders in the Document service repository
Prerequisites
- You need to check out the base branch from the GitHub repository.
This branch contains thevanilla espm
application on which you will be building upon in order to implement the document service.
- In Eclipse, go to the Git perspective.
- From the Git Repositories view on the left choose
espm2.0
> Branches > Remote Tracking and double-click the origin/base branch. - Choose Checkout as New Local Branch from the dialog box that appears.
> Note: You might notice there are errors in the project as you follow the steps below. All errors should be resolved once you do a maven build as described in Step 7 of this tutorial.
The SAP Cloud Platform Document service is used for managing files and folders on the cloud. It provides an on-demand content repository for unstructured storage. It is an easy-to-consume, central shared service that provides secure storage for content of SAP Cloud Platform. It can be implemented in applications that require document management as well as applications with binary large objects. See Document Service.
To demonstrate the use of the Document service it has been implemented in the ESPM webshop
application. Customers can create sales orders and pdf versions of those orders are then stored in the Document service repository. Once an order has been created the customer can go and download its pdf version.

Step 1: Update the SalesOrderHeader Model Class
Step 2: Add the Document Service and PDFbox Dependencies
Step 3: Create a Document Service Repository
Step 4: Connect to the Document Service
Step 5: Create the Necessary Classes
Step 6: Update Class with the Path to the Invoice PDF Document
Step 7: Add UI Changes
Step 8: Build and update the Maven project
Step 9: Document Service Demo
Navigate tutorial steps
-
Step 1: Update the SalesOrderHeader Model Class
-
Step 2: Add the Document Service and PDFbox Dependencies
-
Step 3: Create a Document Service Repository
-
Step 4: Connect to the Document Service
-
Step 5: Create the Necessary Classes
-
Step 6: Update Class with the Path to the Invoice PDF Document
-
Step 7: Add UI Changes
-
Step 8: Build and update the Maven project
-
Step 9: Document Service Demo
- Back to Top