Package org.exoplatform.clouddrive.cmis
Class CMISAPI
- java.lang.Object
-
- org.exoplatform.clouddrive.cmis.CMISAPI
-
public class CMISAPI extends Object
All calls to CMIS API here.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classCMISAPI.ChangesIteratorIterator over set of drive change events from CMIS Change Log.protected classCMISAPI.ChangeTokenThe Class ChangeToken.protected classCMISAPI.ChildrenIteratorIterator over whole set of items from cloud service.protected classCMISAPI.ContextSession context for CMIS calls.protected classCMISAPI.TimeChangeTokenThe Class TimeChangeToken.
-
Field Summary
Fields Modifier and Type Field Description static intCONNECTION_TIMEOUTOpen CMIS connection timeout.protected StringcustomDomainThe custom domain.static StringEMPTY_TOKENThe Constant EMPTY_TOKEN.protected CMISAPI.ChangeTokenemptyTokenSingleton of empty change token.protected StringenterpriseIdThe custom domain.protected StringenterpriseNameThe custom domain.protected static Set<String>FILE_PROPERTY_SETSet of properties for CMIS files (document or folder).protected org.apache.chemistry.opencmis.client.api.OperationContextfileContextOpenCMIS context for object operations.static intFOLDER_PAGE_SIZEPage size used by folder context and children/change iterators for large data sets.protected static Set<String>FOLDER_PROPERTY_SETSet of properties for CMIS folder.protected org.apache.chemistry.opencmis.client.api.OperationContextfolderContextOpenCMIS context for folder operations.protected static org.exoplatform.services.log.LogLOGThe Constant LOG.static intOBJECT_PAGE_SIZEPage size used by object context.protected Map<String,String>parametersClient session parameters.protected StringproductNameThe product name.protected StringproductVersionThe product version.protected StringrepositoryIdCurrent CMIS repository Id.protected StringrepositoryNameCurrent CMIS repository name;.protected AtomicReference<org.apache.chemistry.opencmis.client.api.Session>sessionSession holder.static StringTOKEN_DATATIME_FORMATThe Constant TOKEN_DATATIME_FORMAT.protected StringvendorNameThe vendor name.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected org.apache.chemistry.opencmis.commons.spi.CmisBindingbinding()Create CMIS binding instance (low-level API but with fine grained control).protected org.apache.chemistry.opencmis.client.api.DocumentcopyDocument(String id, String parentId, String name)Deprecated.protected org.apache.chemistry.opencmis.client.api.DocumentcopyDocument(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.FoldercopyFolder(String id, String parentId, String name)Deprecated.protected org.apache.chemistry.opencmis.client.api.FoldercopyFolder(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.DocumentcreateDocument(String parentId, String name, String mimeType, InputStream data)Creates the document.protected org.apache.chemistry.opencmis.client.api.FoldercreateFolder(String parentId, String name)Creates the folder.protected voiddeleteDocument(String id)Delete a cloud file by given fileId.protected voiddeleteFolder(String id)Delete a cloud folder by given folderId.protected CMISAPI.ChangeTokenemptyToken()Empty token.static StringformatTokenTime(Date date)Format token time.protected List<org.apache.chemistry.opencmis.client.api.Document>getAllVersion(org.apache.chemistry.opencmis.client.api.Document document)Return all versions of CMIS document in repository.protected CMISAPI.ChangesIteratorgetChanges(CMISAPI.ChangeToken changeToken)Gets the changes.protected CMISAPI.ChildrenIteratorgetFolderItems(String folderId)Gets the folder items.protected CMISAPI.ChildrenIteratorgetFolderItems(org.apache.chemistry.opencmis.client.api.Folder folder)Gets the folder items.protected org.apache.chemistry.opencmis.client.api.DocumentgetLatestDocumentVersionOrPWC(String id)Return latest versions of CMIS document in repository.protected StringgetLink(org.apache.chemistry.opencmis.client.api.CmisObject file)Link (URl) to a file for opening on provider site (UI).protected StringgetLink(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.CmisObjectgetObject(String objectId)Return CMIS object from the repository.protected Map<String,String>getParamaters()Gets the paramaters.protected Collection<org.apache.chemistry.opencmis.client.api.Folder>getParents(org.apache.chemistry.opencmis.client.api.CmisObject obj)Return the parent folder(s) for the specified object.protected StringgetPassword()Password of currently connected cloud user.StringgetProductName()Gets the product name.StringgetProductVersion()Gets the product version.protected List<org.apache.chemistry.opencmis.client.api.Repository>getRepositories()Available repositories for current user.StringgetRepositoryId()Current CMIS repository.protected org.apache.chemistry.opencmis.commons.data.RepositoryInfogetRepositoryInfo()Gets the repository info.StringgetRepositoryName()Gets the current CMIS repository name;.protected org.apache.chemistry.opencmis.client.api.FoldergetRootFolder()The drive root folder.protected StringgetServiceURL()CMIS service's AtomPub URL.protected StringgetUser()Currently connected cloud user name.StringgetUserTitle()Gets the user title.StringgetVendorName()Gets the vendor name.protected voidinitRepository(String repositoryId)Init current CMIS repository for late use.protected booleanisDocument(org.apache.chemistry.opencmis.client.api.CmisObject object)Checks if is document.protected booleanisFileable(org.apache.chemistry.opencmis.client.api.CmisObject object)Checks if is fileable.protected booleanisFolder(org.apache.chemistry.opencmis.client.api.CmisObject object)Checks if is folder.protected booleanisRelationship(org.apache.chemistry.opencmis.client.api.CmisObject object)Checks if is relationship.protected booleanisSyncableChange(org.apache.chemistry.opencmis.client.api.ChangeEvent change)Checks if is syncable change.protected booleanisVersionable(org.apache.chemistry.opencmis.client.api.ObjectType type)Checks if is versionable.protected org.apache.chemistry.opencmis.client.api.DocumentreadDocumentVersionOrPWC(String id)Read document version or PWC.protected org.apache.chemistry.opencmis.client.api.CmisObjectreadObject(String id, org.apache.chemistry.opencmis.client.api.Session session, org.apache.chemistry.opencmis.client.api.OperationContext context)For internal use.protected CMISAPI.ChangeTokenreadToken(String tokenString)Read token.protected CMISAPI.ChangeTokenreadToken(org.apache.chemistry.opencmis.client.api.ChangeEvent event)Read token.protected org.apache.chemistry.opencmis.client.api.CmisObjectrename(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.Sessionsession()Create CMIS session.protected org.apache.chemistry.opencmis.client.api.Sessionsession(boolean forceNew)Create CMIS session.protected booleanshouldCheckinRename(org.apache.chemistry.opencmis.client.api.Document doc)Should perform CMIS check-in after renaming of already checked-in document.protected org.apache.chemistry.opencmis.client.api.DocumentupdateContent(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.CmisObjectupdateObject(String parentId, String id, String name, JCRLocalCMISDrive.LocalFile local)Update CMIS object name and parent (if object was moved locally).protected voidupdateUser(Map<String,String> parameters)Update user credentials.
-
-
-
Field Detail
-
LOG
protected static final org.exoplatform.services.log.Log LOG
The Constant LOG.
-
OBJECT_PAGE_SIZE
public static final int OBJECT_PAGE_SIZE
Page size used by object context.- See Also:
- Constant Field Values
-
FOLDER_PAGE_SIZE
public static final int FOLDER_PAGE_SIZE
Page size used by folder context and children/change iterators for large data sets.- See Also:
- Constant Field Values
-
TOKEN_DATATIME_FORMAT
public static final String TOKEN_DATATIME_FORMAT
The Constant TOKEN_DATATIME_FORMAT.- See Also:
- Constant Field Values
-
EMPTY_TOKEN
public static final String EMPTY_TOKEN
The Constant EMPTY_TOKEN.
-
CONNECTION_TIMEOUT
public static final int CONNECTION_TIMEOUT
Open CMIS connection timeout.- See Also:
- Constant Field Values
-
FILE_PROPERTY_SET
protected static final Set<String> FILE_PROPERTY_SET
Set of properties for CMIS files (document or folder).
-
FOLDER_PROPERTY_SET
protected static final Set<String> FOLDER_PROPERTY_SET
Set of properties for CMIS folder.
-
session
protected final AtomicReference<org.apache.chemistry.opencmis.client.api.Session> session
Session holder.
-
emptyToken
protected final CMISAPI.ChangeToken emptyToken
Singleton of empty change token.
-
repositoryId
protected String repositoryId
Current CMIS repository Id.
-
repositoryName
protected String repositoryName
Current CMIS repository name;.
-
productName
protected String productName
The product name.
-
productVersion
protected String productVersion
The product version.
-
vendorName
protected String vendorName
The vendor name.
-
enterpriseId
protected String enterpriseId
The custom domain.
-
enterpriseName
protected String enterpriseName
The custom domain.
-
customDomain
protected String customDomain
The custom domain.
-
fileContext
protected org.apache.chemistry.opencmis.client.api.OperationContext fileContext
OpenCMIS context for object operations.
-
folderContext
protected org.apache.chemistry.opencmis.client.api.OperationContext folderContext
OpenCMIS context for folder operations.
-
-
Constructor Detail
-
CMISAPI
protected CMISAPI(String serviceURL, String user, String password) throws CMISException, org.exoplatform.services.cms.clouddrives.CloudDriveException
Create API from user credentials.- Parameters:
serviceURL-StringCMIS service URL (AtimPub binding)user-StringCMIS service usernamepassword-StringCMIS service user password- Throws:
CMISException- the CMIS exceptionorg.exoplatform.services.cms.clouddrives.CloudDriveException- the cloud drive exception
-
-
Method Detail
-
updateUser
protected void updateUser(Map<String,String> parameters)
Update user credentials.- Parameters:
parameters-Mapof connection parameters
-
getParamaters
protected Map<String,String> getParamaters()
Gets the paramaters.- Returns:
- CMIS session parameters.
-
getUser
protected String getUser()
Currently connected cloud user name.- Returns:
- String
-
getPassword
protected String getPassword()
Password of currently connected cloud user.- Returns:
- String
-
getServiceURL
protected String getServiceURL()
CMIS service's AtomPub URL.- Returns:
- String
-
initRepository
protected void initRepository(String repositoryId) throws CMISException, org.exoplatform.services.cms.clouddrives.RefreshAccessException
Init current CMIS repository for late use.- Parameters:
repositoryId-Stringrepository name- Throws:
CMISException- the CMIS exceptionorg.exoplatform.services.cms.clouddrives.RefreshAccessException- the refresh access exception
-
getRepositoryId
public String getRepositoryId()
Current CMIS repository.- Returns:
- the repository
-
getRepositoryName
public String getRepositoryName()
Gets the current CMIS repository name;.- Returns:
- the current CMIS repository name;
-
getProductName
public String getProductName()
Gets the product name.- Returns:
- the productName
-
getProductVersion
public String getProductVersion()
Gets the product version.- Returns:
- the productVersion
-
getVendorName
public String getVendorName()
Gets the vendor name.- Returns:
- the vendorName
-
getUserTitle
public String getUserTitle()
Gets the user title.- Returns:
- the user title
-
getRepositories
protected List<org.apache.chemistry.opencmis.client.api.Repository> getRepositories() throws CMISException, org.exoplatform.services.cms.clouddrives.RefreshAccessException
Available repositories for current user.- Returns:
- list of
Repositoryobjects - Throws:
CMISException- the CMIS exceptionorg.exoplatform.services.cms.clouddrives.RefreshAccessException- the refresh access exception
-
getRootFolder
protected org.apache.chemistry.opencmis.client.api.Folder getRootFolder() throws CMISException, org.exoplatform.services.cms.clouddrives.RefreshAccessException, org.exoplatform.services.cms.clouddrives.UnauthorizedExceptionThe drive root folder.- Returns:
Folder- Throws:
CMISException- the CMIS exceptionorg.exoplatform.services.cms.clouddrives.RefreshAccessException- the refresh access exceptionorg.exoplatform.services.cms.clouddrives.UnauthorizedException- the unauthorized exception
-
readObject
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. This method doesn't handle OpenCMIS exceptions.- Parameters:
id-Stringsession-Sessioncontext-OperationContext- Returns:
CmisObject
-
getObject
protected org.apache.chemistry.opencmis.client.api.CmisObject getObject(String objectId) throws CMISException, org.exoplatform.services.cms.clouddrives.NotFoundException, org.exoplatform.services.cms.clouddrives.CloudDriveAccessException, org.exoplatform.services.cms.clouddrives.UnauthorizedException
Return CMIS object from the repository.- Parameters:
objectId-String- Returns:
CmisObject- Throws:
CMISException- the CMIS exceptionorg.exoplatform.services.cms.clouddrives.NotFoundException- the not found exceptionorg.exoplatform.services.cms.clouddrives.CloudDriveAccessException- the cloud drive access exceptionorg.exoplatform.services.cms.clouddrives.UnauthorizedException- the unauthorized exception
-
readDocumentVersionOrPWC
protected org.apache.chemistry.opencmis.client.api.Document readDocumentVersionOrPWC(String id) throws org.exoplatform.services.cms.clouddrives.CloudDriveAccessException, org.exoplatform.services.cms.clouddrives.UnauthorizedException
Read document version or PWC.- Parameters:
id- the id- Returns:
- the document
- Throws:
org.exoplatform.services.cms.clouddrives.CloudDriveAccessException- the cloud drive access exceptionorg.exoplatform.services.cms.clouddrives.UnauthorizedException- the unauthorized exception
-
getLatestDocumentVersionOrPWC
protected org.apache.chemistry.opencmis.client.api.Document getLatestDocumentVersionOrPWC(String id) throws CMISException, org.exoplatform.services.cms.clouddrives.NotFoundException, org.exoplatform.services.cms.clouddrives.CloudDriveAccessException, org.exoplatform.services.cms.clouddrives.UnauthorizedException
Return latest versions of CMIS document in repository. If document is checked out by current user and the private working copy (PWC) available it will be returned.- Parameters:
id-String- Returns:
Document- Throws:
CMISException- the CMIS exceptionorg.exoplatform.services.cms.clouddrives.NotFoundException- the not found exceptionorg.exoplatform.services.cms.clouddrives.CloudDriveAccessException- the cloud drive access exceptionorg.exoplatform.services.cms.clouddrives.UnauthorizedException- the unauthorized exception
-
getAllVersion
protected List<org.apache.chemistry.opencmis.client.api.Document> getAllVersion(org.apache.chemistry.opencmis.client.api.Document document) throws CMISException, org.exoplatform.services.cms.clouddrives.NotFoundException, org.exoplatform.services.cms.clouddrives.CloudDriveAccessException, org.exoplatform.services.cms.clouddrives.UnauthorizedException
Return all versions of CMIS document in repository.- Parameters:
document-Document- Returns:
- list of
Documentversions - Throws:
CMISException- the CMIS exceptionorg.exoplatform.services.cms.clouddrives.NotFoundException- the not found exceptionorg.exoplatform.services.cms.clouddrives.CloudDriveAccessException- the cloud drive access exceptionorg.exoplatform.services.cms.clouddrives.UnauthorizedException- the unauthorized exception
-
getParents
protected Collection<org.apache.chemistry.opencmis.client.api.Folder> getParents(org.apache.chemistry.opencmis.client.api.CmisObject obj) throws CMISException, org.exoplatform.services.cms.clouddrives.CloudDriveAccessException, org.exoplatform.services.cms.clouddrives.UnauthorizedException
Return the parent folder(s) for the specified object. If it is not fileable object then empty result will be returned. A single parent will be always for a folder.- Parameters:
obj-CmisObject- Returns:
- collection of
Folderparents - Throws:
CMISException- the CMIS exceptionorg.exoplatform.services.cms.clouddrives.CloudDriveAccessException- the cloud drive access exceptionorg.exoplatform.services.cms.clouddrives.UnauthorizedException- the unauthorized exception
-
getFolderItems
protected CMISAPI.ChildrenIterator getFolderItems(String folderId) throws org.exoplatform.services.cms.clouddrives.CloudDriveException
Gets the folder items.- Parameters:
folderId- the folder id- Returns:
- the folder items
- Throws:
org.exoplatform.services.cms.clouddrives.CloudDriveException- the cloud drive exception
-
getFolderItems
protected CMISAPI.ChildrenIterator getFolderItems(org.apache.chemistry.opencmis.client.api.Folder folder) throws org.exoplatform.services.cms.clouddrives.CloudDriveException
Gets the folder items.- Parameters:
folder- the folder- Returns:
- the folder items
- Throws:
org.exoplatform.services.cms.clouddrives.CloudDriveException- the cloud drive exception
-
getChanges
protected CMISAPI.ChangesIterator getChanges(CMISAPI.ChangeToken changeToken) throws CMISException, org.exoplatform.services.cms.clouddrives.CloudDriveAccessException
Gets the changes.- Parameters:
changeToken- the change token- Returns:
- the changes
- Throws:
CMISException- the CMIS exceptionorg.exoplatform.services.cms.clouddrives.CloudDriveAccessException- the cloud drive access exception
-
getLink
protected String getLink(org.apache.chemistry.opencmis.client.api.CmisObject file) throws CMISException, org.exoplatform.services.cms.clouddrives.RefreshAccessException
Link (URl) to a file for opening on provider site (UI).- Parameters:
file- the file- Returns:
- String with the file URL.
- Throws:
CMISException- the CMIS exceptionorg.exoplatform.services.cms.clouddrives.RefreshAccessException- the refresh access exception
-
getLink
protected String getLink(org.apache.chemistry.opencmis.client.api.Folder file) throws CMISException, org.exoplatform.services.cms.clouddrives.RefreshAccessException
Link (URl) to a folder for downloading from provider site.- Parameters:
file- the file- Returns:
- String with the file URL.
- Throws:
CMISException- the CMIS exceptionorg.exoplatform.services.cms.clouddrives.RefreshAccessException- the refresh access exception
-
createDocument
protected org.apache.chemistry.opencmis.client.api.Document createDocument(String parentId, String name, String mimeType, InputStream data) throws CMISException, org.exoplatform.services.cms.clouddrives.NotFoundException, org.exoplatform.services.cms.clouddrives.ConflictException, org.exoplatform.services.cms.clouddrives.CloudDriveAccessException, org.exoplatform.services.cms.clouddrives.ConstraintException, org.exoplatform.services.cms.clouddrives.UnauthorizedException
Creates the document.- Parameters:
parentId- the parent idname- the namemimeType- the mime typedata- the data- Returns:
- the document
- Throws:
CMISException- the CMIS exceptionorg.exoplatform.services.cms.clouddrives.NotFoundException- the not found exceptionorg.exoplatform.services.cms.clouddrives.ConflictException- the conflict exceptionorg.exoplatform.services.cms.clouddrives.CloudDriveAccessException- the cloud drive access exceptionorg.exoplatform.services.cms.clouddrives.ConstraintException- the constraint exceptionorg.exoplatform.services.cms.clouddrives.UnauthorizedException- the unauthorized exception
-
createFolder
protected org.apache.chemistry.opencmis.client.api.Folder createFolder(String parentId, String name) throws CMISException, org.exoplatform.services.cms.clouddrives.NotFoundException, org.exoplatform.services.cms.clouddrives.ConflictException, org.exoplatform.services.cms.clouddrives.CloudDriveAccessException, org.exoplatform.services.cms.clouddrives.ConstraintException, org.exoplatform.services.cms.clouddrives.UnauthorizedException
Creates the folder.- Parameters:
parentId- the parent idname- the name- Returns:
- the folder
- Throws:
CMISException- the CMIS exceptionorg.exoplatform.services.cms.clouddrives.NotFoundException- the not found exceptionorg.exoplatform.services.cms.clouddrives.ConflictException- the conflict exceptionorg.exoplatform.services.cms.clouddrives.CloudDriveAccessException- the cloud drive access exceptionorg.exoplatform.services.cms.clouddrives.ConstraintException- the constraint exceptionorg.exoplatform.services.cms.clouddrives.UnauthorizedException- the unauthorized exception
-
deleteDocument
protected void deleteDocument(String id) throws CMISException, org.exoplatform.services.cms.clouddrives.NotFoundException, org.exoplatform.services.cms.clouddrives.ConflictException, org.exoplatform.services.cms.clouddrives.CloudDriveAccessException, org.exoplatform.services.cms.clouddrives.ConstraintException, org.exoplatform.services.cms.clouddrives.UnauthorizedException
Delete a cloud file by given fileId.- Parameters:
id-String- Throws:
CMISException- the CMIS exceptionorg.exoplatform.services.cms.clouddrives.NotFoundException- the not found exceptionorg.exoplatform.services.cms.clouddrives.ConflictException- the conflict exceptionorg.exoplatform.services.cms.clouddrives.CloudDriveAccessException- the cloud drive access exceptionorg.exoplatform.services.cms.clouddrives.ConstraintException- the constraint exceptionorg.exoplatform.services.cms.clouddrives.UnauthorizedException- the unauthorized exception
-
deleteFolder
protected void deleteFolder(String id) throws CMISException, org.exoplatform.services.cms.clouddrives.NotFoundException, org.exoplatform.services.cms.clouddrives.ConflictException, org.exoplatform.services.cms.clouddrives.CloudDriveAccessException, org.exoplatform.services.cms.clouddrives.ConstraintException, org.exoplatform.services.cms.clouddrives.UnauthorizedException
Delete a cloud folder by given folderId.- Parameters:
id-String- Throws:
CMISException- the CMIS exceptionorg.exoplatform.services.cms.clouddrives.NotFoundException- the not found exceptionorg.exoplatform.services.cms.clouddrives.ConflictException- the conflict exceptionorg.exoplatform.services.cms.clouddrives.CloudDriveAccessException- the cloud drive access exceptionorg.exoplatform.services.cms.clouddrives.ConstraintException- the constraint exceptionorg.exoplatform.services.cms.clouddrives.UnauthorizedException- the unauthorized exception
-
updateContent
protected org.apache.chemistry.opencmis.client.api.Document updateContent(String id, String name, InputStream data, String mimeType, JCRLocalCMISDrive.LocalFile local) throws CMISException, org.exoplatform.services.cms.clouddrives.NotFoundException, org.exoplatform.services.cms.clouddrives.ConflictException, org.exoplatform.services.cms.clouddrives.CloudDriveAccessException, org.exoplatform.services.cms.clouddrives.ConstraintException, org.exoplatform.services.cms.clouddrives.UnauthorizedException
Update document name (if differs with remote) and its content stream.- Parameters:
id-Stringname-Stringdata-InputStreamcontent streammimeType-Stringmime-type of the content streamlocal-JCRLocalCMISDrive.LocalFileaccess to local file for move operation support- Returns:
Documentof actually changed document- Throws:
CMISException- the CMIS exceptionorg.exoplatform.services.cms.clouddrives.NotFoundException- the not found exceptionorg.exoplatform.services.cms.clouddrives.ConflictException- the conflict exceptionorg.exoplatform.services.cms.clouddrives.CloudDriveAccessException- the cloud drive access exceptionorg.exoplatform.services.cms.clouddrives.ConstraintException- the constraint exceptionorg.exoplatform.services.cms.clouddrives.UnauthorizedException- the unauthorized exception
-
updateObject
protected org.apache.chemistry.opencmis.client.api.CmisObject updateObject(String parentId, String id, String name, JCRLocalCMISDrive.LocalFile local) throws CMISException, org.exoplatform.services.cms.clouddrives.NotFoundException, org.exoplatform.services.cms.clouddrives.ConflictException, org.exoplatform.services.cms.clouddrives.CloudDriveAccessException, org.exoplatform.services.cms.clouddrives.ConstraintException, org.exoplatform.services.cms.clouddrives.UnauthorizedException
Update CMIS object name and parent (if object was moved locally).- Parameters:
parentId-Stringid-Stringname-Stringlocal-JCRLocalCMISDrive.LocalFileaccess to local file for move operation support- Returns:
CmisObjectof actually changed object ornullif it already exists with such name and parent.- Throws:
CMISException- the CMIS exceptionorg.exoplatform.services.cms.clouddrives.NotFoundException- the not found exceptionorg.exoplatform.services.cms.clouddrives.ConflictException- the conflict exceptionorg.exoplatform.services.cms.clouddrives.CloudDriveAccessException- the cloud drive access exceptionorg.exoplatform.services.cms.clouddrives.ConstraintException- the constraint exceptionorg.exoplatform.services.cms.clouddrives.UnauthorizedException- the unauthorized exception
-
rename
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). By default it uses obj.rename() method.- Parameters:
newName-Stringnew nameobj-CmisObjectsession-Session- Returns:
CmisObjectrenamed object
-
copyDocument
@Deprecated protected org.apache.chemistry.opencmis.client.api.Document copyDocument(String id, String parentId, String name) throws CMISException, org.exoplatform.services.cms.clouddrives.NotFoundException, org.exoplatform.services.cms.clouddrives.ConflictException, org.exoplatform.services.cms.clouddrives.CloudDriveAccessException, org.exoplatform.services.cms.clouddrives.ConstraintException, org.exoplatform.services.cms.clouddrives.UnauthorizedException
Deprecated.Copy document to a new one. If file was successfully copied this method return new document object.- Parameters:
id-StringparentId-Stringname-String- Returns:
Documentof actually copied file.- Throws:
CMISException- the CMIS exceptionorg.exoplatform.services.cms.clouddrives.NotFoundException- the not found exceptionorg.exoplatform.services.cms.clouddrives.ConflictException- the conflict exceptionorg.exoplatform.services.cms.clouddrives.CloudDriveAccessException- the cloud drive access exceptionorg.exoplatform.services.cms.clouddrives.ConstraintException- the constraint exceptionorg.exoplatform.services.cms.clouddrives.UnauthorizedException- the unauthorized exception
-
copyDocument
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) throws CMISException, org.exoplatform.services.cms.clouddrives.NotFoundException, org.exoplatform.services.cms.clouddrives.ConflictException, org.exoplatform.services.cms.clouddrives.CloudDriveAccessException, org.exoplatform.services.cms.clouddrives.ConstraintException, org.exoplatform.services.cms.clouddrives.UnauthorizedExceptionCopy document to a new one using CMIS objects. If file was successfully copied this method return new document object.- Parameters:
source-Documentparent-Foldername-String- Returns:
Documentof actually copied file.- Throws:
CMISException- the CMIS exceptionorg.exoplatform.services.cms.clouddrives.NotFoundException- the not found exceptionorg.exoplatform.services.cms.clouddrives.ConflictException- the conflict exceptionorg.exoplatform.services.cms.clouddrives.CloudDriveAccessException- the cloud drive access exceptionorg.exoplatform.services.cms.clouddrives.ConstraintException- the constraint exceptionorg.exoplatform.services.cms.clouddrives.UnauthorizedException- the unauthorized exception
-
copyFolder
@Deprecated protected org.apache.chemistry.opencmis.client.api.Folder copyFolder(String id, String parentId, String name) throws CMISException, org.exoplatform.services.cms.clouddrives.NotFoundException, org.exoplatform.services.cms.clouddrives.ConflictException, org.exoplatform.services.cms.clouddrives.CloudDriveAccessException, org.exoplatform.services.cms.clouddrives.ConstraintException, org.exoplatform.services.cms.clouddrives.UnauthorizedException
Deprecated.Copy folder to a new one. If folder was successfully copied this method return new folder object. Notable that CMIS doesn't support folder copying natively and this method does recursive traversing of the source and create new folder with sub-folders from it. This may cause not full copy of a folder in general case (permissions or other metadata may not be copied).- Parameters:
id-StringparentId-Stringname-String- Returns:
Folderof actually copied folder.- Throws:
CMISException- the CMIS exceptionorg.exoplatform.services.cms.clouddrives.NotFoundException- the not found exceptionorg.exoplatform.services.cms.clouddrives.ConflictException- the conflict exceptionorg.exoplatform.services.cms.clouddrives.CloudDriveAccessException- the cloud drive access exceptionorg.exoplatform.services.cms.clouddrives.ConstraintException- the constraint exceptionorg.exoplatform.services.cms.clouddrives.UnauthorizedException- the unauthorized exception- See Also:
copyFolder(Folder, Folder, String)
-
copyFolder
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.services.cms.clouddrives.NotFoundException, org.exoplatform.services.cms.clouddrives.ConflictException, org.exoplatform.services.cms.clouddrives.CloudDriveAccessException, org.exoplatform.services.cms.clouddrives.ConstraintException, org.exoplatform.services.cms.clouddrives.UnauthorizedExceptionCopy folder to a new one using CMIS objects. If folder was successfully copied this method return new folder object.
Notable that CMIS doesn't support folder copy and this method will create only a copy of the source folder object without copying its sub-files - they must be copied one by one by the caller.- Parameters:
source- the sourceparent- the parentname-String- Returns:
Folderof actually copied folder.- Throws:
CMISException- the CMIS exceptionorg.exoplatform.services.cms.clouddrives.NotFoundException- the not found exceptionorg.exoplatform.services.cms.clouddrives.ConflictException- the conflict exceptionorg.exoplatform.services.cms.clouddrives.CloudDriveAccessException- the cloud drive access exceptionorg.exoplatform.services.cms.clouddrives.ConstraintException- the constraint exceptionorg.exoplatform.services.cms.clouddrives.UnauthorizedException- the unauthorized exception
-
getRepositoryInfo
protected org.apache.chemistry.opencmis.commons.data.RepositoryInfo getRepositoryInfo() throws CMISException, org.exoplatform.services.cms.clouddrives.RefreshAccessExceptionGets the repository info.- Returns:
- the repository info
- Throws:
CMISException- the CMIS exceptionorg.exoplatform.services.cms.clouddrives.RefreshAccessException- the refresh access exception
-
isFolder
protected boolean isFolder(org.apache.chemistry.opencmis.client.api.CmisObject object)
Checks if is folder.- Parameters:
object- the object- Returns:
- true, if is folder
-
isDocument
protected boolean isDocument(org.apache.chemistry.opencmis.client.api.CmisObject object)
Checks if is document.- Parameters:
object- the object- Returns:
- true, if is document
-
isRelationship
protected boolean isRelationship(org.apache.chemistry.opencmis.client.api.CmisObject object)
Checks if is relationship.- Parameters:
object- the object- Returns:
- true, if is relationship
-
isFileable
protected boolean isFileable(org.apache.chemistry.opencmis.client.api.CmisObject object)
Checks if is fileable.- Parameters:
object- the object- Returns:
- true, if is fileable
-
repositories
protected List<org.apache.chemistry.opencmis.client.api.Repository> repositories() throws CMISException, org.exoplatform.services.cms.clouddrives.RefreshAccessException
List of repositories available on CMIS service.- Returns:
- list of
Repositoryobjects - Throws:
CMISException- when runtime or connection error happensorg.exoplatform.services.cms.clouddrives.RefreshAccessException- if user credentials rejected (and need try renew them)
-
binding
protected org.apache.chemistry.opencmis.commons.spi.CmisBinding binding() throws CMISExceptionCreate CMIS binding instance (low-level API but with fine grained control).- Returns:
CmisBinding- Throws:
CMISException- the CMIS exception
-
session
protected org.apache.chemistry.opencmis.client.api.Session session() throws CMISException, org.exoplatform.services.cms.clouddrives.RefreshAccessExceptionCreate CMIS session.- Returns:
Session- Throws:
CMISException- the CMIS exceptionorg.exoplatform.services.cms.clouddrives.RefreshAccessException- the refresh access exception
-
session
protected org.apache.chemistry.opencmis.client.api.Session session(boolean forceNew) throws CMISException, org.exoplatform.services.cms.clouddrives.RefreshAccessExceptionCreate CMIS session.- Parameters:
forceNew- boolean iftruethen session will be recreated, otherwise will try use cached in thread-local variable.- Returns:
Session- Throws:
CMISException- the CMIS exceptionorg.exoplatform.services.cms.clouddrives.RefreshAccessException- the refresh access exception
-
readToken
protected CMISAPI.ChangeToken readToken(org.apache.chemistry.opencmis.client.api.ChangeEvent event) throws CMISException
Read token.- Parameters:
event- the event- Returns:
- the change token
- Throws:
CMISException- the CMIS exception
-
readToken
protected CMISAPI.ChangeToken readToken(String tokenString) throws CMISException
Read token.- Parameters:
tokenString- the token string- Returns:
- the change token
- Throws:
CMISException- the CMIS exception
-
emptyToken
protected CMISAPI.ChangeToken emptyToken()
Empty token.- Returns:
- the change token
-
isVersionable
protected boolean isVersionable(org.apache.chemistry.opencmis.client.api.ObjectType type)
Checks if is versionable.- Parameters:
type- the type- Returns:
- true, if is versionable
-
isSyncableChange
protected boolean isSyncableChange(org.apache.chemistry.opencmis.client.api.ChangeEvent change) throws org.exoplatform.services.cms.clouddrives.RefreshAccessException, CMISExceptionChecks if is syncable change.- Parameters:
change- the change- Returns:
- true, if is syncable change
- Throws:
org.exoplatform.services.cms.clouddrives.RefreshAccessException- the refresh access exceptionCMISException- the CMIS exception
-
shouldCheckinRename
protected boolean shouldCheckinRename(org.apache.chemistry.opencmis.client.api.Document doc)
Should perform CMIS check-in after renaming of already checked-in document.- Parameters:
doc- the doc- Returns:
- boolean
-
-