Package com.logicaldoc.cmis
Class LDRepository
- java.lang.Object
-
- com.logicaldoc.cmis.LDRepository
-
public class LDRepository extends Object
LogicalDOC implementation of a CMIS Repository- Since:
- 6.5.1
- Author:
- Marco Meschieri - LogicalDOC
-
-
Constructor Summary
Constructors Constructor Description LDRepository(Folder root, String sid)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addUser(String user, boolean readOnly)
Adds a user to the repositoryvoid
cancelCheckOut(String objectId)
void
checkIn(org.apache.chemistry.opencmis.commons.spi.Holder<String> objectId, Boolean major, org.apache.chemistry.opencmis.commons.data.ContentStream contentStream, org.apache.chemistry.opencmis.commons.data.Properties properties, String checkinComment)
void
checkOut(org.apache.chemistry.opencmis.commons.spi.Holder<String> objectId, org.apache.chemistry.opencmis.commons.spi.Holder<Boolean> contentCopied)
org.apache.chemistry.opencmis.commons.data.ObjectData
create(org.apache.chemistry.opencmis.commons.server.CallContext context, org.apache.chemistry.opencmis.commons.data.Properties properties, String folderId, org.apache.chemistry.opencmis.commons.data.ContentStream contentStream, org.apache.chemistry.opencmis.commons.enums.VersioningState versioningState, org.apache.chemistry.opencmis.commons.server.ObjectInfoHandler objectInfos)
Create dispatch for AtomPubString
createDocument(org.apache.chemistry.opencmis.commons.server.CallContext context, org.apache.chemistry.opencmis.commons.data.Properties properties, String folderId, org.apache.chemistry.opencmis.commons.data.ContentStream contentStream, org.apache.chemistry.opencmis.commons.enums.VersioningState versioningState)
CMIS createDocumentString
createDocumentFromSource(org.apache.chemistry.opencmis.commons.server.CallContext context, String sourceId, String folderId)
String
createFolder(org.apache.chemistry.opencmis.commons.server.CallContext context, org.apache.chemistry.opencmis.commons.data.Properties properties, String folderId)
CMIS moveObjectvoid
deleteObject(org.apache.chemistry.opencmis.commons.server.CallContext context, String objectId)
CMIS deleteObjectvoid
deleteObjectOrCancelCheckOut(org.apache.chemistry.opencmis.commons.server.CallContext context, String objectId)
org.apache.chemistry.opencmis.commons.data.FailedToDeleteData
deleteTree(org.apache.chemistry.opencmis.commons.server.CallContext context, String folderId, Boolean continueOnFailure)
CMIS deleteTreeorg.apache.chemistry.opencmis.commons.data.Acl
getAcl(org.apache.chemistry.opencmis.commons.server.CallContext context, String objectId)
CMIS getACLorg.apache.chemistry.opencmis.commons.data.AllowableActions
getAllowableActions(org.apache.chemistry.opencmis.commons.server.CallContext context, String objectId)
CMIS getAllowableActionsList<org.apache.chemistry.opencmis.commons.data.ObjectData>
getAllVersions(String objectId)
org.apache.chemistry.opencmis.commons.data.ObjectInFolderList
getChildren(org.apache.chemistry.opencmis.commons.server.CallContext context, String folderId, String filter, boolean includeAllowableActions, boolean includePathSegment, int maxItems, int skipCount, org.apache.chemistry.opencmis.commons.server.ObjectInfoHandler objectInfos)
CMIS getChildrenorg.apache.chemistry.opencmis.commons.data.ObjectList
getContentChanges(org.apache.chemistry.opencmis.commons.spi.Holder<String> changeLogToken, int max)
org.apache.chemistry.opencmis.commons.data.ContentStream
getContentStream(org.apache.chemistry.opencmis.commons.server.CallContext context, String objectId, BigInteger offset, BigInteger length)
CMIS getContentStreamList<org.apache.chemistry.opencmis.commons.data.ObjectData>
getDocumentLastChanges(long minDate, int max)
List<org.apache.chemistry.opencmis.commons.data.ObjectData>
getFolderLastChanges(long minDate, int max)
org.apache.chemistry.opencmis.commons.data.ObjectData
getFolderParent(org.apache.chemistry.opencmis.commons.server.CallContext context, String folderId)
CMIS getFolderParentString
getId()
org.apache.chemistry.opencmis.commons.data.ObjectData
getObject(org.apache.chemistry.opencmis.commons.server.CallContext context, String objectId, String versionServicesId, String filter, Boolean includeAllowableActions, Boolean includeAcl, org.apache.chemistry.opencmis.commons.server.ObjectInfoHandler objectInfos)
CMIS getObjectorg.apache.chemistry.opencmis.commons.data.ObjectData
getObjectByPath(org.apache.chemistry.opencmis.commons.server.CallContext context, String path, String filter, Boolean includeAllowableActions, org.apache.chemistry.opencmis.commons.enums.IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds, Boolean includeAcl, org.apache.chemistry.opencmis.commons.data.ExtensionsData extension)
CMIS getObjectByPathorg.apache.chemistry.opencmis.commons.server.ObjectInfo
getObjectInfo(String objectId, org.apache.chemistry.opencmis.commons.server.ObjectInfoHandler handler)
List<org.apache.chemistry.opencmis.commons.data.ObjectParentData>
getObjectParents(org.apache.chemistry.opencmis.commons.server.CallContext context, String objectId, String filter, Boolean includeAllowableActions, Boolean includeRelativePathSegment, org.apache.chemistry.opencmis.commons.server.ObjectInfoHandler objectInfos)
CMIS getObjectParentsorg.apache.chemistry.opencmis.commons.data.RepositoryInfo
getRepositoryInfo(org.apache.chemistry.opencmis.commons.server.CallContext context, String latestChangeLogToken)
CMIS getRepositoryInfoFolder
getRoot()
org.apache.chemistry.opencmis.commons.definitions.TypeDefinition
getTypeDefinition(org.apache.chemistry.opencmis.commons.server.CallContext context, String typeId)
CMIS getTypeDefinitionorg.apache.chemistry.opencmis.commons.definitions.TypeDefinitionList
getTypesChildren(org.apache.chemistry.opencmis.commons.server.CallContext context, String typeId, boolean includePropertyDefinitions, BigInteger maxItems, BigInteger skipCount)
CMIS getTypesChildrenList<org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionContainer>
getTypesDescendants(org.apache.chemistry.opencmis.commons.server.CallContext context, String typeId, BigInteger depth, Boolean includePropertyDefinitions)
CMIS getTypesDescendantsorg.apache.chemistry.opencmis.commons.data.ObjectData
moveObject(org.apache.chemistry.opencmis.commons.server.CallContext context, org.apache.chemistry.opencmis.commons.spi.Holder<String> objectId, String targetFolderId, org.apache.chemistry.opencmis.commons.server.ObjectInfoHandler objectInfos)
CMIS moveObjectorg.apache.chemistry.opencmis.commons.data.ObjectList
query(String statement, int maxItems)
void
setHistoryDao(DocumentHistoryDAO historyDao)
void
setTemplateDao(TemplateDAO templateDao)
org.apache.chemistry.opencmis.commons.data.ObjectData
updateProperties(org.apache.chemistry.opencmis.commons.server.CallContext context, org.apache.chemistry.opencmis.commons.spi.Holder<String> objectId, org.apache.chemistry.opencmis.commons.data.Properties properties, org.apache.chemistry.opencmis.commons.server.ObjectInfoHandler objectInfos)
CMIS updateProperties
-
-
-
Method Detail
-
addUser
public void addUser(String user, boolean readOnly)
Adds a user to the repository- Parameters:
user
- the usernamereadOnly
- if the user must be read-only
-
getRepositoryInfo
public org.apache.chemistry.opencmis.commons.data.RepositoryInfo getRepositoryInfo(org.apache.chemistry.opencmis.commons.server.CallContext context, String latestChangeLogToken)
CMIS getRepositoryInfo- Parameters:
context
- call contextlatestChangeLogToken
- a token that indicates the time stamp of the last update- Returns:
- the repository representation
-
getTypesChildren
public org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionList getTypesChildren(org.apache.chemistry.opencmis.commons.server.CallContext context, String typeId, boolean includePropertyDefinitions, BigInteger maxItems, BigInteger skipCount)
CMIS getTypesChildren- Parameters:
context
- call contexttypeId
- identifier of the typeincludePropertyDefinitions
- id the property definitions must be includedmaxItems
- maximum number of childrenskipCount
- if the children must be counted- Returns:
- the list of type definitions
-
getTypeDefinition
public org.apache.chemistry.opencmis.commons.definitions.TypeDefinition getTypeDefinition(org.apache.chemistry.opencmis.commons.server.CallContext context, String typeId)
CMIS getTypeDefinition- Parameters:
context
- call contexttypeId
- identifier of the type- Returns:
- the type definition
-
getTypesDescendants
public List<org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionContainer> getTypesDescendants(org.apache.chemistry.opencmis.commons.server.CallContext context, String typeId, BigInteger depth, Boolean includePropertyDefinitions)
CMIS getTypesDescendants- Parameters:
context
- the call contexttypeId
- identifier of the typedepth
- a depth specificationincludePropertyDefinitions
- if property definitions must be included- Returns:
- the list of type definitions
-
createDocumentFromSource
public String createDocumentFromSource(org.apache.chemistry.opencmis.commons.server.CallContext context, String sourceId, String folderId)
-
create
public org.apache.chemistry.opencmis.commons.data.ObjectData create(org.apache.chemistry.opencmis.commons.server.CallContext context, org.apache.chemistry.opencmis.commons.data.Properties properties, String folderId, org.apache.chemistry.opencmis.commons.data.ContentStream contentStream, org.apache.chemistry.opencmis.commons.enums.VersioningState versioningState, org.apache.chemistry.opencmis.commons.server.ObjectInfoHandler objectInfos)
Create dispatch for AtomPub- Parameters:
context
- call contextproperties
- the propertiesfolderId
- identifier of the parent foldercontentStream
- stream of the document to createversioningState
- state of the versionobjectInfos
- informations- Returns:
- the newly created object
-
createDocument
public String createDocument(org.apache.chemistry.opencmis.commons.server.CallContext context, org.apache.chemistry.opencmis.commons.data.Properties properties, String folderId, org.apache.chemistry.opencmis.commons.data.ContentStream contentStream, org.apache.chemistry.opencmis.commons.enums.VersioningState versioningState)
CMIS createDocument- Parameters:
context
- call contextproperties
- the folder's propertiesfolderId
- identifier of the parent foldercontentStream
- binary content of the file to createversioningState
- state of the version- Returns:
- the new document's identifier
-
createFolder
public String createFolder(org.apache.chemistry.opencmis.commons.server.CallContext context, org.apache.chemistry.opencmis.commons.data.Properties properties, String folderId)
CMIS moveObject- Parameters:
context
- call contextproperties
- the folder's propertiesfolderId
- identifier of the parent folder- Returns:
- the created folder's identifier
-
moveObject
public org.apache.chemistry.opencmis.commons.data.ObjectData moveObject(org.apache.chemistry.opencmis.commons.server.CallContext context, org.apache.chemistry.opencmis.commons.spi.Holder<String> objectId, String targetFolderId, org.apache.chemistry.opencmis.commons.server.ObjectInfoHandler objectInfos)
CMIS moveObject- Parameters:
context
- call contextobjectId
- identifier of the file/foldertargetFolderId
- identifier of the target folderobjectInfos
- informations- Returns:
- the moved object
-
deleteObjectOrCancelCheckOut
public void deleteObjectOrCancelCheckOut(org.apache.chemistry.opencmis.commons.server.CallContext context, String objectId)
-
deleteObject
public void deleteObject(org.apache.chemistry.opencmis.commons.server.CallContext context, String objectId)
CMIS deleteObject- Parameters:
context
- call contextobjectId
- identifier of the file/folder
-
deleteTree
public org.apache.chemistry.opencmis.commons.data.FailedToDeleteData deleteTree(org.apache.chemistry.opencmis.commons.server.CallContext context, String folderId, Boolean continueOnFailure)
CMIS deleteTree- Parameters:
context
- call contextfolderId
- identifier of the foldercontinueOnFailure
- if the execution must continue even in presence of an issue- Returns:
- informations about the failure
-
updateProperties
public org.apache.chemistry.opencmis.commons.data.ObjectData updateProperties(org.apache.chemistry.opencmis.commons.server.CallContext context, org.apache.chemistry.opencmis.commons.spi.Holder<String> objectId, org.apache.chemistry.opencmis.commons.data.Properties properties, org.apache.chemistry.opencmis.commons.server.ObjectInfoHandler objectInfos)
CMIS updateProperties- Parameters:
context
- the call contextobjectId
- identifier of the objectproperties
- the propertiesobjectInfos
- informations- Returns:
- the updated object
-
getObjectInfo
public org.apache.chemistry.opencmis.commons.server.ObjectInfo getObjectInfo(String objectId, org.apache.chemistry.opencmis.commons.server.ObjectInfoHandler handler)
-
checkOut
public void checkOut(org.apache.chemistry.opencmis.commons.spi.Holder<String> objectId, org.apache.chemistry.opencmis.commons.spi.Holder<Boolean> contentCopied)
-
cancelCheckOut
public void cancelCheckOut(String objectId)
-
checkIn
public void checkIn(org.apache.chemistry.opencmis.commons.spi.Holder<String> objectId, Boolean major, org.apache.chemistry.opencmis.commons.data.ContentStream contentStream, org.apache.chemistry.opencmis.commons.data.Properties properties, String checkinComment)
-
getObject
public org.apache.chemistry.opencmis.commons.data.ObjectData getObject(org.apache.chemistry.opencmis.commons.server.CallContext context, String objectId, String versionServicesId, String filter, Boolean includeAllowableActions, Boolean includeAcl, org.apache.chemistry.opencmis.commons.server.ObjectInfoHandler objectInfos)
CMIS getObject- Parameters:
context
- the call contextobjectId
- identifier of the file/folerversionServicesId
- version specificationfilter
- optional filterincludeAllowableActions
- if the allowable actions must be includedincludeAcl
- if the ACL must be includedobjectInfos
- informations- Returns:
- the file/folder
-
getObjectByPath
public org.apache.chemistry.opencmis.commons.data.ObjectData getObjectByPath(org.apache.chemistry.opencmis.commons.server.CallContext context, String path, String filter, Boolean includeAllowableActions, org.apache.chemistry.opencmis.commons.enums.IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds, Boolean includeAcl, org.apache.chemistry.opencmis.commons.data.ExtensionsData extension)
CMIS getObjectByPath- Parameters:
context
- the call contextpath
- path of the file/folderfilter
- the filter(optional)includeAllowableActions
- if the allowable actions must be includedincludeRelationships
- if the relationship must be includedrenditionFilter
- the rendition filter(optional)includePolicyIds
- if the policies must be includedincludeAcl
- if the ACL must be includedextension
- the extension- Returns:
- the file/folder at the given path
-
getAllowableActions
public org.apache.chemistry.opencmis.commons.data.AllowableActions getAllowableActions(org.apache.chemistry.opencmis.commons.server.CallContext context, String objectId)
CMIS getAllowableActions- Parameters:
context
- the call contextobjectId
- identifier of the file/folder- Returns:
- the allowable actions
-
getAcl
public org.apache.chemistry.opencmis.commons.data.Acl getAcl(org.apache.chemistry.opencmis.commons.server.CallContext context, String objectId)
CMIS getACL- Parameters:
context
- the call contextobjectId
- identifier of the file/folder- Returns:
- the ACL
-
getContentStream
public org.apache.chemistry.opencmis.commons.data.ContentStream getContentStream(org.apache.chemistry.opencmis.commons.server.CallContext context, String objectId, BigInteger offset, BigInteger length)
CMIS getContentStream- Parameters:
context
- the call contextobjectId
- identifier of the file/folderoffset
- not supported, leave nulllength
- not supported, leave null- Returns:
- the stream
-
getChildren
public org.apache.chemistry.opencmis.commons.data.ObjectInFolderList getChildren(org.apache.chemistry.opencmis.commons.server.CallContext context, String folderId, String filter, boolean includeAllowableActions, boolean includePathSegment, int maxItems, int skipCount, org.apache.chemistry.opencmis.commons.server.ObjectInfoHandler objectInfos) throws PersistenceException
CMIS getChildren- Parameters:
context
- the call contextfolderId
- identifier of the folderfilter
- optional filterincludeAllowableActions
- if the allowable actions must be includedincludePathSegment
- if the path segmentmaxItems
- maximum number of itemsskipCount
- skip the count of childrenobjectInfos
- informations- Returns:
- the list of children
- Throws:
PersistenceException
- error at data layer
-
getFolderParent
public org.apache.chemistry.opencmis.commons.data.ObjectData getFolderParent(org.apache.chemistry.opencmis.commons.server.CallContext context, String folderId)
CMIS getFolderParent- Parameters:
context
- the call contextfolderId
- identifier of the folder- Returns:
- the parent object
-
getObjectParents
public List<org.apache.chemistry.opencmis.commons.data.ObjectParentData> getObjectParents(org.apache.chemistry.opencmis.commons.server.CallContext context, String objectId, String filter, Boolean includeAllowableActions, Boolean includeRelativePathSegment, org.apache.chemistry.opencmis.commons.server.ObjectInfoHandler objectInfos)
CMIS getObjectParents- Parameters:
context
- the call contextobjectId
- identifier of the file/folderfilter
- an optional filterincludeAllowableActions
- if the allowable actions must be includedincludeRelativePathSegment
- if the path segment must be includedobjectInfos
- informations- Returns:
- list of parents
-
query
public org.apache.chemistry.opencmis.commons.data.ObjectList query(String statement, int maxItems)
-
getAllVersions
public List<org.apache.chemistry.opencmis.commons.data.ObjectData> getAllVersions(String objectId)
-
getId
public String getId()
-
setTemplateDao
public void setTemplateDao(TemplateDAO templateDao)
-
getContentChanges
public org.apache.chemistry.opencmis.commons.data.ObjectList getContentChanges(org.apache.chemistry.opencmis.commons.spi.Holder<String> changeLogToken, int max) throws org.apache.chemistry.opencmis.commons.exceptions.CmisPermissionDeniedException
- Throws:
org.apache.chemistry.opencmis.commons.exceptions.CmisPermissionDeniedException
-
getDocumentLastChanges
public List<org.apache.chemistry.opencmis.commons.data.ObjectData> getDocumentLastChanges(long minDate, int max)
-
getFolderLastChanges
public List<org.apache.chemistry.opencmis.commons.data.ObjectData> getFolderLastChanges(long minDate, int max)
-
getRoot
public Folder getRoot()
-
setHistoryDao
public void setHistoryDao(DocumentHistoryDAO historyDao)
-
-