public class CMISAPI extends Object
| Modifier and Type | Class and Description |
|---|---|
protected class |
CMISAPI.ChangesIterator
Iterator over set of drive change events from CMIS Change Log.
|
protected class |
CMISAPI.ChangeToken |
protected class |
CMISAPI.ChildrenIterator
Iterator over whole set of items from cloud service.
|
protected class |
CMISAPI.Context
Session context for CMIS calls.
|
static class |
CMISAPI.DriveState
Sample drive state POJO.
|
protected class |
CMISAPI.TimeChangeToken |
| Modifier and Type | Field and Description |
|---|---|
protected String |
customDomain |
protected String |
enterpriseId |
protected String |
enterpriseName |
static int |
FOLDER_PAGE_SIZE
Page size used by folder context and children/change iterators for large data sets.
|
protected static Set<String> |
FOLDER_PROPERTY_SET |
protected org.apache.chemistry.opencmis.client.api.OperationContext |
folderContext
OpenCMIS context for folder operations.
|
protected static org.exoplatform.services.log.Log |
LOG |
static String |
NO_STATE |
static int |
OBJECT_PAGE_SIZE
Page size used by object context.
|
protected org.apache.chemistry.opencmis.client.api.OperationContext |
objectContext
OpenCMIS context for object operations.
|
protected Map<String,String> |
parameters
Client session parameters.
|
protected String |
productName |
protected String |
productVersion |
protected String |
repositoryId
Current CMIS repository Id.
|
protected String |
repositoryName
Current CMIS repository name;
|
protected AtomicReference<org.apache.chemistry.opencmis.client.api.Session> |
session
Session holder.
|
protected CMISAPI.DriveState |
state |
static String |
TOKEN_DATATIME_FORMAT |
protected String |
vendorName |
| Modifier | Constructor and Description |
|---|---|
protected |
CMISAPI(String serviceURL,
String user,
String password)
Create API from user credentials.
|
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.chemistry.opencmis.commons.spi.CmisBinding |
binding()
Create CMIS binding instance (low-level API but with fine grained control).
|
protected org.apache.chemistry.opencmis.client.api.Document |
copyDocument(org.apache.chemistry.opencmis.client.api.Document source,
org.apache.chemistry.opencmis.client.api.Folder parent,
String name)
Copy document to a new one using CMIS objects.
|
protected org.apache.chemistry.opencmis.client.api.Document |
copyDocument(String id,
String parentId,
String name)
Copy document to a new one.
|
protected org.apache.chemistry.opencmis.client.api.Folder |
copyFolder(org.apache.chemistry.opencmis.client.api.Folder source,
org.apache.chemistry.opencmis.client.api.Folder parent,
String name)
Copy folder to a new one using CMIS objects.
|
protected org.apache.chemistry.opencmis.client.api.Folder |
copyFolder(String id,
String parentId,
String name)
Copy folder to a new one.
|
protected org.apache.chemistry.opencmis.client.api.Document |
createDocument(String parentId,
String name,
String mimeType,
InputStream data) |
protected org.apache.chemistry.opencmis.client.api.Folder |
createFolder(String parentId,
String name) |
protected void |
deleteDocument(String id)
Delete a cloud file by given fileId.
|
protected void |
deleteFolder(String id)
Delete a cloud folder by given folderId.
|
static String |
formatTokenTime(Date date) |
protected CMISAPI.ChangesIterator |
getChanges(CMISAPI.ChangeToken changeToken) |
protected String |
getEmbedLink(org.apache.chemistry.opencmis.client.api.CmisObject item)
Link (URL) to embed a file onto external app (in PLF).
|
protected String |
getEmbedLink(org.apache.chemistry.opencmis.client.api.Document doc)
Link (URL) to embed a document onto external app (in PLF).
|
protected String |
getEmbedLink(org.apache.chemistry.opencmis.client.api.Folder folder)
Link (URL) to embed a folder onto external app (in PLF).
|
protected CMISAPI.ChildrenIterator |
getFolderItems(String folderId) |
protected String |
getLink(org.apache.chemistry.opencmis.client.api.CmisObject file)
Link (URl) to a file for opening on provider site (UI).
|
protected String |
getLink(org.apache.chemistry.opencmis.client.api.Folder file)
Link (URl) to a folder for downloading from provider site.
|
protected org.apache.chemistry.opencmis.client.api.CmisObject |
getObject(String objectId)
Return CMIS object from the repository.
|
protected Map<String,String> |
getParamaters() |
protected String |
getPassword()
Password of currently connected cloud user.
|
String |
getProductName() |
String |
getProductVersion() |
protected List<org.apache.chemistry.opencmis.client.api.Repository> |
getRepositories()
Available repositories for current user.
|
String |
getRepositoryId()
Current CMIS repository.
|
protected org.apache.chemistry.opencmis.commons.data.RepositoryInfo |
getRepositoryInfo() |
String |
getRepositoryName() |
protected org.apache.chemistry.opencmis.client.api.Folder |
getRootFolder()
The drive root folder.
|
protected String |
getServiceURL()
CMIS service's AtomPub URL.
|
protected CMISAPI.DriveState |
getState() |
protected String |
getUser()
Currently connected cloud user name.
|
String |
getUserTitle() |
String |
getVendorName() |
protected void |
initRepository(String repositoryId)
Init current CMIS repository for late use.
|
protected boolean |
isDocument(org.apache.chemistry.opencmis.client.api.CmisObject object) |
protected boolean |
isFileable(org.apache.chemistry.opencmis.client.api.CmisObject object) |
protected boolean |
isFolder(org.apache.chemistry.opencmis.client.api.CmisObject object) |
protected boolean |
isRelationship(org.apache.chemistry.opencmis.client.api.CmisObject object) |
protected boolean |
isSyncableChange(org.apache.chemistry.opencmis.client.api.ChangeEvent change) |
protected boolean |
isVersionable(org.apache.chemistry.opencmis.client.api.ObjectType type) |
protected org.apache.chemistry.opencmis.client.api.CmisObject |
readObject(String id,
org.apache.chemistry.opencmis.client.api.Session session,
org.apache.chemistry.opencmis.client.api.OperationContext context)
For internal use.
|
protected CMISAPI.ChangeToken |
readToken(org.apache.chemistry.opencmis.client.api.ChangeEvent event) |
protected CMISAPI.ChangeToken |
readToken(String tokenString) |
protected org.apache.chemistry.opencmis.client.api.CmisObject |
rename(String newName,
org.apache.chemistry.opencmis.client.api.CmisObject obj,
org.apache.chemistry.opencmis.client.api.Session session)
Rename CMIS object by better way working for the CMIS provider (this method can be overridden in
dedicated implementations).
|
protected List<org.apache.chemistry.opencmis.client.api.Repository> |
repositories()
List of repositories available on CMIS service.
|
protected org.apache.chemistry.opencmis.client.api.Session |
session()
Create CMIS session.
|
protected org.apache.chemistry.opencmis.client.api.Session |
session(boolean forceNew)
Create CMIS session.
|
protected org.apache.chemistry.opencmis.client.api.Document |
updateContent(String id,
String name,
InputStream data,
String mimeType,
JCRLocalCMISDrive.LocalFile local)
Update document name (if differs with remote) and its content stream.
|
protected org.apache.chemistry.opencmis.client.api.Folder |
updateFolder(String parentId,
String id,
String name,
JCRLocalCMISDrive.LocalFile local)
Deprecated.
|
protected org.apache.chemistry.opencmis.client.api.CmisObject |
updateObject(String parentId,
String id,
String name,
JCRLocalCMISDrive.LocalFile local)
Update CMIS object name and parent (if object was moved locally).
|
protected void |
updateState()
Update the drive state.
|
protected void |
updateUser(Map<String,String> parameters)
Update user credentials.
|
protected static final org.exoplatform.services.log.Log LOG
public static final String NO_STATE
public static final int OBJECT_PAGE_SIZE
public static final int FOLDER_PAGE_SIZE
public static final String TOKEN_DATATIME_FORMAT
protected String repositoryId
protected String repositoryName
protected String productName
protected String productVersion
protected String vendorName
protected CMISAPI.DriveState state
protected String enterpriseId
protected String enterpriseName
protected String customDomain
protected org.apache.chemistry.opencmis.client.api.OperationContext objectContext
protected org.apache.chemistry.opencmis.client.api.OperationContext folderContext
protected final AtomicReference<org.apache.chemistry.opencmis.client.api.Session> session
protected CMISAPI(String serviceURL, String user, String password) throws CMISException, org.exoplatform.clouddrive.CloudDriveException
serviceURL - Stringuser - Stringpassword - StringCMISExceptionorg.exoplatform.clouddrive.CloudDriveExceptionprotected void updateUser(Map<String,String> parameters)
parameters - Map of connection parametersorg.exoplatform.clouddrive.CloudDriveExceptionprotected String getUser()
CMISExceptionorg.exoplatform.clouddrive.RefreshAccessExceptionprotected String getPassword()
CMISExceptionorg.exoplatform.clouddrive.RefreshAccessExceptionprotected String getServiceURL()
CMISExceptionorg.exoplatform.clouddrive.RefreshAccessExceptionprotected void initRepository(String repositoryId) throws CMISException, org.exoplatform.clouddrive.RefreshAccessException
repositoryId - String repository nameCMISExceptionorg.exoplatform.clouddrive.RefreshAccessExceptionpublic String getRepositoryId()
public String getRepositoryName()
public String getProductName()
public String getProductVersion()
public String getVendorName()
public String getUserTitle()
protected List<org.apache.chemistry.opencmis.client.api.Repository> getRepositories() throws CMISException, org.exoplatform.clouddrive.RefreshAccessException
Repository objectsCMISExceptionorg.exoplatform.clouddrive.RefreshAccessExceptionprotected org.apache.chemistry.opencmis.client.api.Folder getRootFolder()
throws CMISException,
org.exoplatform.clouddrive.RefreshAccessException
FolderCMISExceptionorg.exoplatform.clouddrive.RefreshAccessExceptionprotected org.apache.chemistry.opencmis.client.api.CmisObject readObject(String id, org.apache.chemistry.opencmis.client.api.Session session, org.apache.chemistry.opencmis.client.api.OperationContext context)
id - Stringsession - Sessioncontext - OperationContextCmisObjectprotected org.apache.chemistry.opencmis.client.api.CmisObject getObject(String objectId) throws CMISException, org.exoplatform.clouddrive.NotFoundException, org.exoplatform.clouddrive.CloudDriveAccessException
objectId - StringCmisObjectCMISExceptionorg.exoplatform.clouddrive.NotFoundExceptionorg.exoplatform.clouddrive.CloudDriveAccessExceptionprotected CMISAPI.ChildrenIterator getFolderItems(String folderId) throws org.exoplatform.clouddrive.CloudDriveException
org.exoplatform.clouddrive.CloudDriveExceptionprotected CMISAPI.ChangesIterator getChanges(CMISAPI.ChangeToken changeToken) throws CMISException, org.exoplatform.clouddrive.RefreshAccessException
CMISExceptionorg.exoplatform.clouddrive.RefreshAccessExceptionprotected String getLink(org.apache.chemistry.opencmis.client.api.CmisObject file) throws CMISException, org.exoplatform.clouddrive.RefreshAccessException
item - CmisObjectCMISExceptionorg.exoplatform.clouddrive.RefreshAccessExceptionprotected String getLink(org.apache.chemistry.opencmis.client.api.Folder file) throws CMISException, org.exoplatform.clouddrive.RefreshAccessException
item - DocumentCMISExceptionorg.exoplatform.clouddrive.RefreshAccessExceptionprotected String getEmbedLink(org.apache.chemistry.opencmis.client.api.CmisObject item) throws CMISException, org.exoplatform.clouddrive.RefreshAccessException
item - CmisObjectCMISExceptionorg.exoplatform.clouddrive.RefreshAccessException#getLink(CmisObject)}protected String getEmbedLink(org.apache.chemistry.opencmis.client.api.Folder folder) throws CMISException, org.exoplatform.clouddrive.RefreshAccessException
folder - FolderCMISExceptionorg.exoplatform.clouddrive.RefreshAccessException#getLink(CmisObject)}protected String getEmbedLink(org.apache.chemistry.opencmis.client.api.Document doc) throws CMISException, org.exoplatform.clouddrive.RefreshAccessException
doc - DocumentCMISExceptionorg.exoplatform.clouddrive.RefreshAccessException#getLink(CmisObject)}protected CMISAPI.DriveState getState() throws CMISException, org.exoplatform.clouddrive.RefreshAccessException
CMISExceptionorg.exoplatform.clouddrive.RefreshAccessExceptionprotected void updateState()
throws CMISException,
org.exoplatform.clouddrive.RefreshAccessException
CMISExceptionorg.exoplatform.clouddrive.RefreshAccessExceptionprotected org.apache.chemistry.opencmis.client.api.Document createDocument(String parentId, String name, String mimeType, InputStream data) throws CMISException, org.exoplatform.clouddrive.NotFoundException, org.exoplatform.clouddrive.ConflictException, org.exoplatform.clouddrive.CloudDriveAccessException
CMISExceptionorg.exoplatform.clouddrive.NotFoundExceptionorg.exoplatform.clouddrive.ConflictExceptionorg.exoplatform.clouddrive.CloudDriveAccessExceptionprotected org.apache.chemistry.opencmis.client.api.Folder createFolder(String parentId, String name) throws CMISException, org.exoplatform.clouddrive.NotFoundException, org.exoplatform.clouddrive.ConflictException, org.exoplatform.clouddrive.CloudDriveAccessException
CMISExceptionorg.exoplatform.clouddrive.NotFoundExceptionorg.exoplatform.clouddrive.ConflictExceptionorg.exoplatform.clouddrive.CloudDriveAccessExceptionprotected void deleteDocument(String id) throws CMISException, org.exoplatform.clouddrive.NotFoundException, org.exoplatform.clouddrive.ConflictException, org.exoplatform.clouddrive.CloudDriveAccessException
id - StringCMISExceptionorg.exoplatform.clouddrive.NotFoundExceptionorg.exoplatform.clouddrive.ConflictExceptionorg.exoplatform.clouddrive.CloudDriveAccessExceptionprotected void deleteFolder(String id) throws CMISException, org.exoplatform.clouddrive.NotFoundException, org.exoplatform.clouddrive.ConflictException, org.exoplatform.clouddrive.CloudDriveAccessException
id - StringCMISExceptionorg.exoplatform.clouddrive.NotFoundExceptionorg.exoplatform.clouddrive.ConflictExceptionorg.exoplatform.clouddrive.CloudDriveAccessExceptionprotected org.apache.chemistry.opencmis.client.api.Document updateContent(String id, String name, InputStream data, String mimeType, JCRLocalCMISDrive.LocalFile local) throws CMISException, org.exoplatform.clouddrive.NotFoundException, org.exoplatform.clouddrive.ConflictException, org.exoplatform.clouddrive.CloudDriveAccessException
id - Stringname - Stringdata - InputStream content streammimeType - String mime-type of the content streamlocal - JCRLocalCMISDrive.LocalFile access to local file for move operation supportDocument of actually changed documentCMISExceptionorg.exoplatform.clouddrive.NotFoundExceptionorg.exoplatform.clouddrive.ConflictExceptionorg.exoplatform.clouddrive.CloudDriveAccessExceptionprotected org.apache.chemistry.opencmis.client.api.CmisObject updateObject(String parentId, String id, String name, JCRLocalCMISDrive.LocalFile local) throws CMISException, org.exoplatform.clouddrive.NotFoundException, org.exoplatform.clouddrive.ConflictException, org.exoplatform.clouddrive.CloudDriveAccessException
parentId - Stringid - Stringname - Stringdata - InputStream content stream or null if content should not be updatedmimeType - String mime-type of the content stream or null if content not
providedlocal - JCRLocalCMISDrive.LocalFile access to local file for move operation supportCmisObject of actually changed object or null if it already exists with
such name and parent.CMISExceptionorg.exoplatform.clouddrive.NotFoundExceptionorg.exoplatform.clouddrive.ConflictExceptionorg.exoplatform.clouddrive.CloudDriveAccessExceptionprotected org.apache.chemistry.opencmis.client.api.CmisObject rename(String newName, org.apache.chemistry.opencmis.client.api.CmisObject obj, org.apache.chemistry.opencmis.client.api.Session session)
newName - String new nameobj - CmisObjectsession - SessionCmisObject renamed object@Deprecated protected org.apache.chemistry.opencmis.client.api.Folder updateFolder(String parentId, String id, String name, JCRLocalCMISDrive.LocalFile local) throws CMISException, org.exoplatform.clouddrive.NotFoundException, org.exoplatform.clouddrive.ConflictException, org.exoplatform.clouddrive.CloudDriveAccessException
null if folder already exists
with such name and parent.parentId - Stringid - Stringname - Stringlocal - JCRLocalCMISDrive.LocalFile access to local folder for move operation supportFolder of actually changed folder or null if folder already exists with
such name and parent.CMISExceptionorg.exoplatform.clouddrive.NotFoundExceptionorg.exoplatform.clouddrive.ConflictExceptionorg.exoplatform.clouddrive.CloudDriveAccessExceptionprotected org.apache.chemistry.opencmis.client.api.Document copyDocument(String id, String parentId, String name) throws CMISException, org.exoplatform.clouddrive.NotFoundException, org.exoplatform.clouddrive.ConflictException, org.exoplatform.clouddrive.CloudDriveAccessException
id - StringparentId - Stringname - Stringmodified - CalendarDocument of actually copied file.CMISExceptionorg.exoplatform.clouddrive.NotFoundExceptionorg.exoplatform.clouddrive.ConflictExceptionorg.exoplatform.clouddrive.CloudDriveAccessExceptionprotected org.apache.chemistry.opencmis.client.api.Document copyDocument(org.apache.chemistry.opencmis.client.api.Document source,
org.apache.chemistry.opencmis.client.api.Folder parent,
String name)
throws CMISException,
org.exoplatform.clouddrive.NotFoundException,
org.exoplatform.clouddrive.ConflictException,
org.exoplatform.clouddrive.CloudDriveAccessException
source - Documentparent - Foldername - Stringmodified - CalendarDocument of actually copied file.CMISExceptionorg.exoplatform.clouddrive.NotFoundExceptionorg.exoplatform.clouddrive.ConflictExceptionorg.exoplatform.clouddrive.CloudDriveAccessExceptionprotected org.apache.chemistry.opencmis.client.api.Folder copyFolder(String id, String parentId, String name) throws CMISException, org.exoplatform.clouddrive.NotFoundException, org.exoplatform.clouddrive.ConflictException, org.exoplatform.clouddrive.CloudDriveAccessException
id - StringparentId - Stringname - StringFolder of actually copied folder.CMISExceptionorg.exoplatform.clouddrive.NotFoundExceptionorg.exoplatform.clouddrive.ConflictExceptionorg.exoplatform.clouddrive.CloudDriveAccessExceptioncopyFolder(Folder, Folder, String)protected org.apache.chemistry.opencmis.client.api.Folder copyFolder(org.apache.chemistry.opencmis.client.api.Folder source,
org.apache.chemistry.opencmis.client.api.Folder parent,
String name)
throws CMISException,
org.exoplatform.clouddrive.NotFoundException,
org.exoplatform.clouddrive.ConflictException,
org.exoplatform.clouddrive.CloudDriveAccessException
id - StringparentId - Stringname - StringFolder of actually copied folder.CMISExceptionorg.exoplatform.clouddrive.NotFoundExceptionorg.exoplatform.clouddrive.ConflictExceptionorg.exoplatform.clouddrive.CloudDriveAccessExceptionprotected org.apache.chemistry.opencmis.commons.data.RepositoryInfo getRepositoryInfo()
throws CMISException,
org.exoplatform.clouddrive.RefreshAccessException
CMISExceptionorg.exoplatform.clouddrive.RefreshAccessExceptionprotected boolean isFolder(org.apache.chemistry.opencmis.client.api.CmisObject object)
protected boolean isDocument(org.apache.chemistry.opencmis.client.api.CmisObject object)
protected boolean isRelationship(org.apache.chemistry.opencmis.client.api.CmisObject object)
protected boolean isFileable(org.apache.chemistry.opencmis.client.api.CmisObject object)
protected List<org.apache.chemistry.opencmis.client.api.Repository> repositories() throws CMISException, org.exoplatform.clouddrive.RefreshAccessException
Repository objectsCMISException - when runtime or connection error happensorg.exoplatform.clouddrive.RefreshAccessException - if user credentials rejected (and need try renew them)protected org.apache.chemistry.opencmis.commons.spi.CmisBinding binding()
throws CMISException
CmisBindingCMISExceptionprotected org.apache.chemistry.opencmis.client.api.Session session()
throws CMISException,
org.exoplatform.clouddrive.RefreshAccessException
SessionCMISExceptionorg.exoplatform.clouddrive.RefreshAccessExceptionprotected org.apache.chemistry.opencmis.client.api.Session session(boolean forceNew)
throws CMISException,
org.exoplatform.clouddrive.RefreshAccessException
forceNew - boolean if true then session will be recreated, otherwise will try use
cached in thread-local variable.SessionCMISExceptionorg.exoplatform.clouddrive.RefreshAccessExceptionprotected CMISAPI.ChangeToken readToken(org.apache.chemistry.opencmis.client.api.ChangeEvent event) throws CMISException
CMISExceptionprotected CMISAPI.ChangeToken readToken(String tokenString) throws CMISException
CMISExceptionprotected boolean isVersionable(org.apache.chemistry.opencmis.client.api.ObjectType type)
protected boolean isSyncableChange(org.apache.chemistry.opencmis.client.api.ChangeEvent change)
throws org.exoplatform.clouddrive.RefreshAccessException,
CMISException
org.exoplatform.clouddrive.RefreshAccessExceptionCMISExceptionCopyright © 2003–2014 eXo Platform SAS. All rights reserved.