|
xCMISHowToImplementSPI
How to implement SPI
Featured This document refers to 1.1.x and 1.2.x version of xCMIS.
Implementor of SPI must implementInterfaces and abstract classes: org.xcmis.spi.CmisRegistryFactoryCmisRegistryFactory provide CmisRegistry instance on getRegistry() method. CmisRegistry instance contains StorageProvider instance. Example Inmemory: org.xcmis.sp.inmemory.tck.InmemoryCmisRegistryFactory org.xcmis.spi.StorageProviderStorageProvider provide access to all available storages. Example Inmemory: org.xcmis.sp.inmemory.StorageProviderImpl org.xcmis.spi.StorageStorage able to create new instances of CMIS object, provide access to existed CMIS objects by id or by path (for fileable objects), delete objects, etc. Storage should not be used directly by REST-Atom, WS-SOAP or any other binding layer. All operation should be done through org.xcmis.spi.Connection. Example Inmemory: org.xcmis.sp.inmemory.StorageImpl org.xcmis.spi.ObjectDataInternal (storage level) representation of CMIS object. There are abstraction for each of root CMIS types such as cmis:document, cmis:folder, cmis:policy, cmis:relationship. CMIS types
org.xcmis.spi.ConnectionSPI (storage provider interface) provide base implementation of org.xcmis.spi.Connection. This implementation validates incoming and uses corresponded methods of implementation of org.xcmis.spi.Storage. Example Inmemory: org.xcmis.sp.inmemory.InmemConnection Provide the FQN of your CmisRegistryFactory implementationCreate in your WAR application the file with FQN: META-INF/services/xcmis/org.xcmis.CmisRegistryFactory Example Inmemory: org.xcmis.sp.inmemory.tck.InmemoryCmisRegistryFactory or provide the system property. Example Inmemory: -Dorg.xcmis.CmisRegistryFactory=org.xcmis.sp.inmemory.tck.InmemoryCmisRegistryFactory Example creation of new Document....
Connection connection = null;
try
{
connection = storageProvider.getConnection(storageId);
String docId = connection.createDocument(parentId, properties, contentStream, addACL, removeACL, policies, versioningState);
return docId;
}
catch (...)
{
...
}
finally
{
if (connection != null)
{
connection.close();
}
}How it reflected in SPI layer.
Links | ||||||||||||||||||