Book Image

Alfresco CMIS

By : Martin Bergljung
Book Image

Alfresco CMIS

By: Martin Bergljung

Overview of this book

Table of Contents (14 chapters)
Alfresco CMIS
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Connecting and setting up a session with the repository


Before we start working with the repository, we must first create a session and connect to it. In the CmisClient class, add the following Hash map that will contain active sessions:

public class CmisClient {
  private static Log logger = LogFactory.getLog(CmisClient.class);
  private static Map<String, Session> connections = new 
    ConcurrentHashMap<String, Session>();
  public CmisClient() {    }
}

The Session interface is from the org.apache.chemistry.opencmis.client.api package in the OpenCMIS library. It represents a session/connection for a specific user with the CMIS repository. A session holds the configuration settings and cache settings to use across multiple calls to the repository. The session is also the entry point to perform all operations on the repository, such as listing folders, creating documents and folders, finding out the capabilities of the repository, and searching.

To create a new connection with...