...
In OpenCMIS the Session
is a semi-generic context-like object (PersistentSessionImpl
). It Eventually, there will be two Session
implementations. In the persistent model (almost) all changes are immediately passed to the repository. In the transient model all changes are cached until save()
is called on the Session
object. A Session
can be "connected" using parameters to instantiate internally a low-level provider (CmisProvider
). The provider holds configuration parameters that enable it to create a low-level SPI through a CmisSpiFactory
. Through the SPI you can get to the various SPI *Service
implementations.
...
- OpenCMIS
No global registration. A JNDI-based method or dependency injection is suggested but not implemented.
...
- OpenCMIS
Code Block Map<String, String> params = ...; // URL, user, password Session session = sessionFactory.createSession(parameters);
Internal layer hierarchy (OpenCMIS)
(All classes and interfaces in bold are for public use. Everything else belongs to the internal machinery.)
- Session
Main interface of the client API.
- SessionFactory
Interface of the session factory class.
- SessionFactoryImpl
Factory class that createsSession
objects from a given configuration.
- PersistentSessionImpl
Implementation of theSession
interface that follows the persistent model. Should be created withSessionFactoryImpl
.
- TransientSessionImpl (does not exist, yet)
Implementation of theSession
interface that follows the transient model. Should be created withSessionFactoryImpl
.
- CmisProviderHelper
Internal helper class that creates aCmisProvider
object. It contains code that is shared byPersistentSessionImpl
andTransientSessionImpl
. It shouldn't be used by anybody else.
- CmisProvider
The low-level client interface.
- CmisProviderImpl
Implementation of the low-level client interface.
- CmisProviderFactory
Factory class forCmisProvider
objects. AlthoughCmisProviderImpl
can be instantiated directly, this factory sets some reasonable defaults and does a sanity check on the configuration. It is recommended to use this factory to create aCmisProvider
object.
- CmisSpi
Interface of the binding implementations. This interface is only interesting for binding developers. Applications use theCmisProvider
orSession
interfaces that hide the binding.
- CmisAtomPubSpi
AtomPub binding implementation.
- CmisWebServicesSpi
Web Services binding implementation.
From an application point of view it easy to use:
- If you want to use the client API, create a
Session
object withSessionFactoryImpl
and don't bother about the rest. - If you want to use the low-level provider API, create a
CmisProvider
object withCmisProviderFactory
and don't bother about the rest.
High-level APIs
From a connection/session you can get the root folder and express high-level operations
...
- OpenCMIS
The base interface isCmisObject
. It flushes property changes onupdateProperties()
.
...
- OpenCMIS
FileableCmisObject
: ,Folder
,Document
,Relationship
,Policy
.Relationship
Paging
- Chemistry
ListPage: a page
= List + getHasMoreItems + getNumItems
Implemented by SimpleListPage. This is a data transfert object.
- OpenCMIS
PagingList: a list of pages which are themselves lists
= Iterable<List> + getNumItems + getMaxItemsPerPage + size + get(page)
AbstractPagingList is the base class. This is an active object that can fetch new pages by implementing a fetchPage() method that returns a FetchResult (which is equivalent to Chemistry's ListPage). It also has a LRU cache for pages which is disabled by default.
Provider APIs
This is called "SPI" in Chemistry, and "Provider" in OpenCMIS.
...
- OpenCMIS
From a provider you get the various CMIS services as different interfaces (RepositoryService
,ObjectService
,NavigationService
, etc.) using getters. The interfaces and classes are generic and mimick the JAXB generated onesreflect the CMIS schema.
High-level vs low-level vs implementation
- Chemistry
The high-level and SPI interfaces are mutualized (ex: org.apache.chemistry.RepositoryInfo).
Florian> For some objects there are different interfaces on these two levels. For example, the step fromObjectEntry
toCMISObject
is comparable to OpenCMIS' step from the provider API to the client API.
Florian> JAXB objects will be necessary for Web Services, similar to OpenCMIS.
- OpenCMIS
For the same concept OpenCMIS manipulates three different interfaces and their implementations:- the one in the high-level client API (ex:
org.apache.opencmis.client.api.repository.RepositoryInfo
, convenient access to data), - the one in the provider (ex:
org.apache.opencmis.commons.provider.RepositoryInfoData
, access to all extension points), - the one from JAXB (
CmisRepositoryInfoType
).
- the one in the high-level client API (ex:
...
- OpenCMIS
A defaultOperationContext
on the session is used to specify these call parameters. A variant of the high-level methods taking an explicitOperationContext
is also available. Furthermore,OperationContext
controls the caching behavior of the objects retrieved by the call. In the provider interfaces everything is explicit, following JAXBthe CMIS specification.
Object data
The base object contains information about one object: properties, allowable actions, relationships, renditions, etc.
...
- OpenCMIS
ObjectData
is the basic class.
To provide it context, it is used by delegation is more complex constructions:ObjectInFolderData
,ObjectInFolderContainer
,ObjectInFolderList
,ObjectParentData
,ObjectList
, etc. thus mimicking JAXBreflect the CMIS schema and allow access to all extension points.
Various enums
Relationship direction:
...