org.exoplatform.clouddrive.cmis
Class CMISAPI

java.lang.Object
  extended by org.exoplatform.clouddrive.cmis.CMISAPI

public class CMISAPI
extends Object

All calls to CMIS API here.


Nested Class Summary
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.
protected  class CMISAPI.TimeChangeToken
           
 
Field Summary
protected  String customDomain
           
static String EMPTY_TOKEN
           
protected  CMISAPI.ChangeToken emptyToken
          Singleton of empty change token.
protected  String enterpriseId
           
protected  String enterpriseName
           
protected static Set<String> FILE_PROPERTY_SET
          Set of properties for CMIS files (document or folder).
protected  org.apache.chemistry.opencmis.client.api.OperationContext fileContext
          OpenCMIS context for object operations.
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
          Set of properties for CMIS folder.
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  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.
static String TOKEN_DATATIME_FORMAT
           
protected  String vendorName
           
 
Constructor Summary
protected CMISAPI(String serviceURL, String user, String password)
          Create API from user credentials.
 
Method Summary
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.
protected  CMISAPI.ChangeToken emptyToken()
           
static String formatTokenTime(Date date)
           
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.ChangesIterator getChanges(CMISAPI.ChangeToken changeToken)
           
protected  CMISAPI.ChildrenIterator getFolderItems(String folderId)
           
protected  org.apache.chemistry.opencmis.client.api.Document getLatestDocumentVersionOrPWC(String id)
          Return latest versions of CMIS document in repository.
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  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  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  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.Document readDocumentVersionOrPWC(String id)
           
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  boolean shouldCheckinRename(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.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.CmisObject updateObject(String parentId, String id, String name, JCRLocalCMISDrive.LocalFile local)
          Update CMIS object name and parent (if object was moved locally).
protected  void updateUser(Map<String,String> parameters)
          Update user credentials.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.exoplatform.services.log.Log LOG

NO_STATE

public static final String NO_STATE
See Also:
Constant Field Values

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
See Also:
Constant Field Values

EMPTY_TOKEN

public static final String EMPTY_TOKEN

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.


parameters

protected Map<String,String> parameters
Client session parameters.


repositoryId

protected String repositoryId
Current CMIS repository Id.


repositoryName

protected String repositoryName
Current CMIS repository name;


productName

protected String productName

productVersion

protected String productVersion

vendorName

protected String vendorName

enterpriseId

protected String enterpriseId

enterpriseName

protected String enterpriseName

customDomain

protected String customDomain

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.clouddrive.CloudDriveException
Create API from user credentials.

Parameters:
serviceURL - String CMIS service URL (AtimPub binding)
user - String CMIS service username
password - String CMIS service user password
Throws:
CMISException
org.exoplatform.clouddrive.CloudDriveException
Method Detail

updateUser

protected void updateUser(Map<String,String> parameters)
Update user credentials.

Parameters:
parameters - Map of connection parameters
Throws:
org.exoplatform.clouddrive.CloudDriveException

getParamaters

protected Map<String,String> getParamaters()
Returns:
CMIS session parameters.

getUser

protected String getUser()
Currently connected cloud user name.

Returns:
String
Throws:
CMISException
org.exoplatform.clouddrive.RefreshAccessException

getPassword

protected String getPassword()
Password of currently connected cloud user.

Returns:
String
Throws:
CMISException
org.exoplatform.clouddrive.RefreshAccessException

getServiceURL

protected String getServiceURL()
CMIS service's AtomPub URL.

Returns:
String
Throws:
CMISException
org.exoplatform.clouddrive.RefreshAccessException

initRepository

protected void initRepository(String repositoryId)
                       throws CMISException,
                              org.exoplatform.clouddrive.RefreshAccessException
Init current CMIS repository for late use.

Parameters:
repositoryId - String repository name
Throws:
CMISException
org.exoplatform.clouddrive.RefreshAccessException

getRepositoryId

public String getRepositoryId()
Current CMIS repository.

Returns:
the repository

getRepositoryName

public String getRepositoryName()

getProductName

public String getProductName()
Returns:
the productName

getProductVersion

public String getProductVersion()
Returns:
the productVersion

getVendorName

public String getVendorName()
Returns:
the vendorName

getUserTitle

public String getUserTitle()

getRepositories

protected List<org.apache.chemistry.opencmis.client.api.Repository> getRepositories()
                                                                             throws CMISException,
                                                                                    org.exoplatform.clouddrive.RefreshAccessException
Available repositories for current user.

Returns:
list of Repository objects
Throws:
CMISException
org.exoplatform.clouddrive.RefreshAccessException

getRootFolder

protected org.apache.chemistry.opencmis.client.api.Folder getRootFolder()
                                                                 throws CMISException,
                                                                        org.exoplatform.clouddrive.RefreshAccessException,
                                                                        org.exoplatform.clouddrive.UnauthorizedException
The drive root folder.

Returns:
Folder
Throws:
CMISException
org.exoplatform.clouddrive.RefreshAccessException
org.exoplatform.clouddrive.UnauthorizedException

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 - String
session - Session
context - OperationContext
Returns:
CmisObject

getObject

protected org.apache.chemistry.opencmis.client.api.CmisObject getObject(String objectId)
                                                                 throws CMISException,
                                                                        org.exoplatform.clouddrive.NotFoundException,
                                                                        org.exoplatform.clouddrive.CloudDriveAccessException,
                                                                        org.exoplatform.clouddrive.UnauthorizedException
Return CMIS object from the repository.

Parameters:
objectId - String
Returns:
CmisObject
Throws:
CMISException
org.exoplatform.clouddrive.NotFoundException
org.exoplatform.clouddrive.CloudDriveAccessException
org.exoplatform.clouddrive.UnauthorizedException

readDocumentVersionOrPWC

protected org.apache.chemistry.opencmis.client.api.Document readDocumentVersionOrPWC(String id)
                                                                              throws org.exoplatform.clouddrive.CloudDriveAccessException,
                                                                                     org.exoplatform.clouddrive.UnauthorizedException
Throws:
org.exoplatform.clouddrive.CloudDriveAccessException
org.exoplatform.clouddrive.UnauthorizedException

getLatestDocumentVersionOrPWC

protected org.apache.chemistry.opencmis.client.api.Document getLatestDocumentVersionOrPWC(String id)
                                                                                   throws CMISException,
                                                                                          org.exoplatform.clouddrive.NotFoundException,
                                                                                          org.exoplatform.clouddrive.CloudDriveAccessException,
                                                                                          org.exoplatform.clouddrive.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
org.exoplatform.clouddrive.NotFoundException
org.exoplatform.clouddrive.CloudDriveAccessException
org.exoplatform.clouddrive.UnauthorizedException

getAllVersion

protected List<org.apache.chemistry.opencmis.client.api.Document> getAllVersion(org.apache.chemistry.opencmis.client.api.Document document)
                                                                         throws CMISException,
                                                                                org.exoplatform.clouddrive.NotFoundException,
                                                                                org.exoplatform.clouddrive.CloudDriveAccessException,
                                                                                org.exoplatform.clouddrive.UnauthorizedException
Return all versions of CMIS document in repository.

Parameters:
document - Document
Returns:
list of Document versions
Throws:
CMISException
org.exoplatform.clouddrive.NotFoundException
org.exoplatform.clouddrive.CloudDriveAccessException
org.exoplatform.clouddrive.UnauthorizedException

getParents

protected Collection<org.apache.chemistry.opencmis.client.api.Folder> getParents(org.apache.chemistry.opencmis.client.api.CmisObject obj)
                                                                          throws CMISException,
                                                                                 org.exoplatform.clouddrive.CloudDriveAccessException,
                                                                                 org.exoplatform.clouddrive.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 Folder parents
Throws:
CMISException
org.exoplatform.clouddrive.CloudDriveAccessException
org.exoplatform.clouddrive.UnauthorizedException

getFolderItems

protected CMISAPI.ChildrenIterator getFolderItems(String folderId)
                                           throws org.exoplatform.clouddrive.CloudDriveException
Throws:
org.exoplatform.clouddrive.CloudDriveException

getChanges

protected CMISAPI.ChangesIterator getChanges(CMISAPI.ChangeToken changeToken)
                                      throws CMISException,
                                             org.exoplatform.clouddrive.CloudDriveAccessException
Throws:
CMISException
org.exoplatform.clouddrive.CloudDriveAccessException

getLink

protected String getLink(org.apache.chemistry.opencmis.client.api.CmisObject file)
                  throws CMISException,
                         org.exoplatform.clouddrive.RefreshAccessException
Link (URl) to a file for opening on provider site (UI).

Parameters:
item - CmisObject
Returns:
String with the file URL.
Throws:
CMISException
org.exoplatform.clouddrive.RefreshAccessException

getLink

protected String getLink(org.apache.chemistry.opencmis.client.api.Folder file)
                  throws CMISException,
                         org.exoplatform.clouddrive.RefreshAccessException
Link (URl) to a folder for downloading from provider site.

Parameters:
item - Document
Returns:
String with the file URL.
Throws:
CMISException
org.exoplatform.clouddrive.RefreshAccessException

createDocument

protected 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,
                                                                           org.exoplatform.clouddrive.ConstraintException,
                                                                           org.exoplatform.clouddrive.UnauthorizedException
Throws:
CMISException
org.exoplatform.clouddrive.NotFoundException
org.exoplatform.clouddrive.ConflictException
org.exoplatform.clouddrive.CloudDriveAccessException
org.exoplatform.clouddrive.ConstraintException
org.exoplatform.clouddrive.UnauthorizedException

createFolder

protected 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,
                                                                       org.exoplatform.clouddrive.ConstraintException,
                                                                       org.exoplatform.clouddrive.UnauthorizedException
Throws:
CMISException
org.exoplatform.clouddrive.NotFoundException
org.exoplatform.clouddrive.ConflictException
org.exoplatform.clouddrive.CloudDriveAccessException
org.exoplatform.clouddrive.ConstraintException
org.exoplatform.clouddrive.UnauthorizedException

deleteDocument

protected void deleteDocument(String id)
                       throws CMISException,
                              org.exoplatform.clouddrive.NotFoundException,
                              org.exoplatform.clouddrive.ConflictException,
                              org.exoplatform.clouddrive.CloudDriveAccessException,
                              org.exoplatform.clouddrive.ConstraintException,
                              org.exoplatform.clouddrive.UnauthorizedException
Delete a cloud file by given fileId.

Parameters:
id - String
Throws:
CMISException
org.exoplatform.clouddrive.NotFoundException
org.exoplatform.clouddrive.ConflictException
org.exoplatform.clouddrive.CloudDriveAccessException
org.exoplatform.clouddrive.ConstraintException
org.exoplatform.clouddrive.UnauthorizedException

deleteFolder

protected void deleteFolder(String id)
                     throws CMISException,
                            org.exoplatform.clouddrive.NotFoundException,
                            org.exoplatform.clouddrive.ConflictException,
                            org.exoplatform.clouddrive.CloudDriveAccessException,
                            org.exoplatform.clouddrive.ConstraintException,
                            org.exoplatform.clouddrive.UnauthorizedException
Delete a cloud folder by given folderId.

Parameters:
id - String
Throws:
CMISException
org.exoplatform.clouddrive.NotFoundException
org.exoplatform.clouddrive.ConflictException
org.exoplatform.clouddrive.CloudDriveAccessException
org.exoplatform.clouddrive.ConstraintException
org.exoplatform.clouddrive.UnauthorizedException

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.clouddrive.NotFoundException,
                                                                          org.exoplatform.clouddrive.ConflictException,
                                                                          org.exoplatform.clouddrive.CloudDriveAccessException,
                                                                          org.exoplatform.clouddrive.ConstraintException,
                                                                          org.exoplatform.clouddrive.UnauthorizedException
Update document name (if differs with remote) and its content stream.

Parameters:
id - String
name - String
data - InputStream content stream
mimeType - String mime-type of the content stream
local - JCRLocalCMISDrive.LocalFile access to local file for move operation support
Returns:
Document of actually changed document
Throws:
CMISException
org.exoplatform.clouddrive.NotFoundException
org.exoplatform.clouddrive.ConflictException
org.exoplatform.clouddrive.CloudDriveAccessException
org.exoplatform.clouddrive.ConstraintException
org.exoplatform.clouddrive.UnauthorizedException

updateObject

protected 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,
                                                                           org.exoplatform.clouddrive.ConstraintException,
                                                                           org.exoplatform.clouddrive.UnauthorizedException
Update CMIS object name and parent (if object was moved locally).

Parameters:
parentId - String
id - String
name - String
data - InputStream content stream or null if content should not be updated
mimeType - String mime-type of the content stream or null if content not provided
local - JCRLocalCMISDrive.LocalFile access to local file for move operation support
Returns:
CmisObject of actually changed object or null if it already exists with such name and parent.
Throws:
CMISException
org.exoplatform.clouddrive.NotFoundException
org.exoplatform.clouddrive.ConflictException
org.exoplatform.clouddrive.CloudDriveAccessException
org.exoplatform.clouddrive.ConstraintException
org.exoplatform.clouddrive.UnauthorizedException

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 - String new name
obj - CmisObject
session - Session
Returns:
CmisObject renamed object

copyDocument

protected 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,
                                                                         org.exoplatform.clouddrive.ConstraintException,
                                                                         org.exoplatform.clouddrive.UnauthorizedException
Copy document to a new one. If file was successfully copied this method return new document object.

Parameters:
id - String
parentId - String
name - String
modified - Calendar
Returns:
Document of actually copied file.
Throws:
CMISException
org.exoplatform.clouddrive.NotFoundException
org.exoplatform.clouddrive.ConflictException
org.exoplatform.clouddrive.CloudDriveAccessException
org.exoplatform.clouddrive.ConstraintException
org.exoplatform.clouddrive.UnauthorizedException

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.clouddrive.NotFoundException,
                                                                         org.exoplatform.clouddrive.ConflictException,
                                                                         org.exoplatform.clouddrive.CloudDriveAccessException,
                                                                         org.exoplatform.clouddrive.ConstraintException,
                                                                         org.exoplatform.clouddrive.UnauthorizedException
Copy document to a new one using CMIS objects. If file was successfully copied this method return new document object.

Parameters:
source - Document
parent - Folder
name - String
modified - Calendar
Returns:
Document of actually copied file.
Throws:
CMISException
org.exoplatform.clouddrive.NotFoundException
org.exoplatform.clouddrive.ConflictException
org.exoplatform.clouddrive.CloudDriveAccessException
org.exoplatform.clouddrive.ConstraintException
org.exoplatform.clouddrive.UnauthorizedException

copyFolder

protected 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,
                                                                     org.exoplatform.clouddrive.ConstraintException,
                                                                     org.exoplatform.clouddrive.UnauthorizedException
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 - String
parentId - String
name - String
Returns:
Folder of actually copied folder.
Throws:
CMISException
org.exoplatform.clouddrive.NotFoundException
org.exoplatform.clouddrive.ConflictException
org.exoplatform.clouddrive.CloudDriveAccessException
org.exoplatform.clouddrive.ConstraintException
org.exoplatform.clouddrive.UnauthorizedException
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.clouddrive.NotFoundException,
                                                                     org.exoplatform.clouddrive.ConflictException,
                                                                     org.exoplatform.clouddrive.CloudDriveAccessException,
                                                                     org.exoplatform.clouddrive.ConstraintException,
                                                                     org.exoplatform.clouddrive.UnauthorizedException
Copy 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 does traversing of the source and create new folder with sub-folders and only copy documents from them. This may cause not full copy of a folder in general case (permissions or other metadata may not be copied).

Parameters:
id - String
parentId - String
name - String
Returns:
Folder of actually copied folder.
Throws:
CMISException
org.exoplatform.clouddrive.NotFoundException
org.exoplatform.clouddrive.ConflictException
org.exoplatform.clouddrive.CloudDriveAccessException
org.exoplatform.clouddrive.ConstraintException
org.exoplatform.clouddrive.UnauthorizedException

getRepositoryInfo

protected org.apache.chemistry.opencmis.commons.data.RepositoryInfo getRepositoryInfo()
                                                                               throws CMISException,
                                                                                      org.exoplatform.clouddrive.RefreshAccessException
Throws:
CMISException
org.exoplatform.clouddrive.RefreshAccessException

isFolder

protected boolean isFolder(org.apache.chemistry.opencmis.client.api.CmisObject object)

isDocument

protected boolean isDocument(org.apache.chemistry.opencmis.client.api.CmisObject object)

isRelationship

protected boolean isRelationship(org.apache.chemistry.opencmis.client.api.CmisObject object)

isFileable

protected boolean isFileable(org.apache.chemistry.opencmis.client.api.CmisObject object)

repositories

protected List<org.apache.chemistry.opencmis.client.api.Repository> repositories()
                                                                          throws CMISException,
                                                                                 org.exoplatform.clouddrive.RefreshAccessException
List of repositories available on CMIS service.

Returns:
list of Repository objects
Throws:
CMISException - when runtime or connection error happens
org.exoplatform.clouddrive.RefreshAccessException - if user credentials rejected (and need try renew them)

binding

protected org.apache.chemistry.opencmis.commons.spi.CmisBinding binding()
                                                                 throws CMISException
Create CMIS binding instance (low-level API but with fine grained control).

Returns:
CmisBinding
Throws:
CMISException

session

protected org.apache.chemistry.opencmis.client.api.Session session()
                                                            throws CMISException,
                                                                   org.exoplatform.clouddrive.RefreshAccessException
Create CMIS session.

Returns:
Session
Throws:
CMISException
org.exoplatform.clouddrive.RefreshAccessException

session

protected org.apache.chemistry.opencmis.client.api.Session session(boolean forceNew)
                                                            throws CMISException,
                                                                   org.exoplatform.clouddrive.RefreshAccessException
Create CMIS session.

Parameters:
forceNew - boolean if true then session will be recreated, otherwise will try use cached in thread-local variable.
Returns:
Session
Throws:
CMISException
org.exoplatform.clouddrive.RefreshAccessException

readToken

protected CMISAPI.ChangeToken readToken(org.apache.chemistry.opencmis.client.api.ChangeEvent event)
                                 throws CMISException
Throws:
CMISException

readToken

protected CMISAPI.ChangeToken readToken(String tokenString)
                                 throws CMISException
Throws:
CMISException

emptyToken

protected CMISAPI.ChangeToken emptyToken()

isVersionable

protected boolean isVersionable(org.apache.chemistry.opencmis.client.api.ObjectType type)

isSyncableChange

protected boolean isSyncableChange(org.apache.chemistry.opencmis.client.api.ChangeEvent change)
                            throws org.exoplatform.clouddrive.RefreshAccessException,
                                   CMISException
Throws:
org.exoplatform.clouddrive.RefreshAccessException
CMISException

shouldCheckinRename

protected boolean shouldCheckinRename(org.apache.chemistry.opencmis.client.api.Document doc)
Should perform CMIS check-in after renaming of already checked-in document.

Returns:
boolean

formatTokenTime

public static String formatTokenTime(Date date)


Copyright © 2003–2015 eXo Platform SAS. All rights reserved.