This Java project contains a reference implementation of Documentum REST Services client written in Java code. The purpose of this project is to demonstrate one way to develop a hypermedia driven REST client to consume Documentum REST Services. It does NOT indicate that users could not develop a REST client using other technologies.
OpenText shares the source code of this project for the technology sharing. If users plan to migrate the sample code to their products, they are responsible to maintain this part of the code in their products and should agree with license polices of the referenced libraries used by this sample project.
This Documentum REST Services client is written with Java code. Underlying it leverages Spring RestTemplate to send
the REST messages. It supports both XML
and JSON
representations. JAXB
is used to bind XML object, and Jackson
for JSON. Both http and https are supported. The Java client's supported features are listed in below tables.
API Spec | Description |
---|---|
Supported Servers | , |
Supported Formats |
|
Supported Authentications |
|
Call Mode |
|
Service Spec | Description |
---|---|
Fundamental Services |
|
Folder Services |
|
Document / Sysobject Services |
|
Content Services |
|
Aspect Services |
|
Lightweight object Services |
|
Virtual document Services |
|
Query and search Services |
|
User and group Services |
|
Permission Services |
|
Collaboration Services |
|
Relation Services |
|
Format Services |
|
Network location Services |
|
Type services |
|
CRUD - Create, Retrieve, Update, Delete
- Documentum REST Services 7.x is deployed in the development environment. The samples will be automatically loaded according the rest server version.
- Java 7 or later is installed.
- Maven 3 is required to build the project.
- Build the project with maven
mvn clean install
- There will be several files built in target directory:
- rest-api-client-sample-7.3.jar --> the sample client jar file
- lib -> the lib directory contains all other required third party library
- rest-api-client-sample-7.3-all-in-one.jar -> the sample client jar file, with all other third party classes embedded
- rest-api-client-sample-7.3-javadoc.jar -> javadoc of the sample client
- rest-api-client-sample-7.3-sources.jar -> source code of the sample client
The class DCTMRestClient is the client stub class for the client application to call REST APIs. We can use DCTMRestClientBuilder to build a REST client instance.
// new a simple rest client instance
DCTMRestClient client = new DCTMRestClientBuilder().bind(DCTMRestClientBinding.JSON)
.contextRoot("http://localhost:8080/dctm-rest")
.repository("ACME")
.credentials("username", "password")
.build();
// get product info resource
RestObject productInfo = client.getProductInfo();
- Run the project execute rest-api-client-sample-7.3.jar, with lib directory at the same place
java -jar rest-api-client-sample-7.3.jar
or execute rest-api-client-sample-7.3-all-in-one.jar directly
java -jar rest-api-client-sample-7.3-all-in-one.jar
- After the program is started, please input the required information prompted by the sample client. After that, you will see a list of commands:
Please input the number of the sample operation which need be executed: 0 Exit 1 Navigation 2 Folder Create/Update/Delete ...
- Then input the number of the sample you want to execute
- Basic sample client
- HTTPS connection without authenticating the rest server
- HTTPS connection with authenticating the rest server (the trust store must contain the rest server)
Or provide the trust store path with -D parameter:
java -Djavax.net.ssl.trustStore=X:\git\documentum-rest-client-java\truststore.jks -Djavax.net.ssl.trustStorePassword=password -jar rest-api-client-sample-7.3.jar