Skip to content

Latest commit

 

History

History
106 lines (85 loc) · 6.19 KB

README.MD

File metadata and controls

106 lines (85 loc) · 6.19 KB

Documentum REST Java Client Reference Implementation

Build Status License: Apache 2

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.

Overview

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 REST API Version REST API Version, REST API Version
Supported Formats
  • JSON
  • XML
Supported Authentications
  • Basic
  • Basic plus client token cookie
  • Basic plus client token cookie + CSRF
Call Mode
  • Synchronous
  • Asynchronous
Service Spec Description
Fundamental Services
  • Home document
  • Product information
  • Repositories
  • Batch execution
Folder Services
  • Cabinet CRUD
  • Folder CRUD
  • Folder navigation
  • Copy, move, link, unlink
Document / Sysobject Services
  • Document CRUD
  • Checkout, cancel checkout, checkin
  • Copy, move, link, unlink
Content Services
  • Import contents
  • Update contents
  • Export contents
Aspect Services
  • Attach aspects
  • Detach aspects
Lightweight object Services
  • Shared parent/children navigation
  • Materialization
  • Dematerialization
Virtual document Services
  • List virtual document nodes
Query and search Services
  • DQL read-only query
  • Full-text search
  • Full-text search with facets
  • Search template CRUD, execution
  • Saved search CRUD, execution
User and group Services
  • User CRUD
  • Group CRUD
  • Add group members
  • Remove group members
  • User preference CRUD
Permission Services
  • ACL CRUD
  • Set object permissions
  • Enquire object permissions
Collaboration Services
  • List comments
  • Add/reply comments
  • Delete comments
Relation Services
  • Create relations
  • List relations
Format Services
  • List formats
Network location Services
  • List network locations
Type services
  • List types
  • List relation types
  • List aspect types
  • Get value assistance

CRUD - Create, Retrieve, Update, Delete

System requirements

  1. Documentum REST Services 7.x is deployed in the development environment. The samples will be automatically loaded according the rest server version.
  2. Java 7 or later is installed.
  3. Maven 3 is required to build the project.

Build the project

  1. Build the project with maven
  mvn clean install
  1. 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

Use the API

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 samples

  1. 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
  1. 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
    ...
  1. Then input the number of the sample you want to execute
  2. Basic sample client

  1. HTTPS connection without authenticating the rest server

  1. 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