Class LDRepository


  • public class LDRepository
    extends Object
    LogicalDOC implementation of a CMIS Repository
    Since:
    6.5.1
    Author:
    Marco Meschieri - LogicalDOC
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addUser​(String user, boolean readOnly)
      Adds a user to the repository
      void 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 AtomPub
      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
      String 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 moveObject
      void deleteObject​(org.apache.chemistry.opencmis.commons.server.CallContext context, String objectId)
      CMIS deleteObject
      void 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 deleteTree
      org.apache.chemistry.opencmis.commons.data.Acl getAcl​(org.apache.chemistry.opencmis.commons.server.CallContext context, String objectId)
      CMIS getACL
      org.apache.chemistry.opencmis.commons.data.AllowableActions getAllowableActions​(org.apache.chemistry.opencmis.commons.server.CallContext context, String objectId)
      CMIS getAllowableActions
      List<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, BigInteger maxItems, BigInteger skipCount, org.apache.chemistry.opencmis.commons.server.ObjectInfoHandler objectInfos)
      CMIS getChildren
      org.apache.chemistry.opencmis.commons.data.ObjectList getContentChanges​(org.apache.chemistry.opencmis.commons.spi.Holder<String> changeLogToken, int max)  
      org.apache.chemistry.opencmis.commons.data.ObjectList getContentChangesXXXX​(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 getContentStream
      List<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 getFolderParent
      String 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 getObject
      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
      org.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 getObjectParents
      org.apache.chemistry.opencmis.commons.data.RepositoryInfo getRepositoryInfo​(org.apache.chemistry.opencmis.commons.server.CallContext context, String latestChangeLogToken)
      CMIS getRepositoryInfo
      Folder getRoot()  
      org.apache.chemistry.opencmis.commons.definitions.TypeDefinition getTypeDefinition​(org.apache.chemistry.opencmis.commons.server.CallContext context, String typeId)
      CMIS getTypeDefinition
      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
      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
      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
      org.apache.chemistry.opencmis.commons.data.ObjectList query​(String statement, Integer 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
    • Constructor Detail

      • LDRepository

        public LDRepository​(Folder root,
                            String sid)
        Constructor.
        Parameters:
        sid - The Session identifier
        root - root folder
    • Method Detail

      • addUser

        public void addUser​(String user,
                            boolean readOnly)
        Adds a user to the repository
        Parameters:
        user - the username
        readOnly - 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 context
        latestChangeLogToken - 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 context
        typeId - identifier of the type
        includePropertyDefinitions - id the property definitions must be included
        maxItems - maximum number of children
        skipCount - 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 context
        typeId - 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 context
        typeId - identifier of the type
        depth - a depth specification
        includePropertyDefinitions - 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 context
        properties - the properties
        folderId - identifier of the parent folder
        contentStream - stream of the document to create
        versioningState - state of the version
        objectInfos - 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 context
        properties - the folder's properties
        folderId - identifier of the parent folder
        contentStream - binary content of the file to create
        versioningState - 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 context
        properties - the folder's properties
        folderId - 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 context
        objectId - identifier of the file/folder
        targetFolderId - identifier of the target folder
        objectInfos - 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 context
        objectId - 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 context
        folderId - identifier of the folder
        continueOnFailure - 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 context
        objectId - identifier of the object
        properties - the properties
        objectInfos - 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 context
        objectId - identifier of the file/foler
        versionServicesId - version specification
        filter - optional filter
        includeAllowableActions - if the allowable actions must be included
        includeAcl - if the ACL must be included
        objectInfos - 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 context
        path - path of the file/folder
        filter - the filter(optional)
        includeAllowableActions - if the allowable actions must be included
        includeRelationships - if the relationship must be included
        renditionFilter - the rendition filter(optional)
        includePolicyIds - if the policies must be included
        includeAcl - if the ACL must be included
        extension - 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 context
        objectId - 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 context
        objectId - 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 context
        objectId - identifier of the file/folder
        offset - not supported, leave null
        length - 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,
                                                                                         BigInteger maxItems,
                                                                                         BigInteger skipCount,
                                                                                         org.apache.chemistry.opencmis.commons.server.ObjectInfoHandler objectInfos)
        CMIS getChildren
        Parameters:
        context - the call context
        folderId - identifier of the folder
        filter - optional filter
        includeAllowableActions - if the allowable actions must be included
        includePathSegment - if the path segment
        maxItems - maximum number of items
        skipCount - skip the count of children
        objectInfos - informations
        Returns:
        the list of children
      • 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 context
        folderId - 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 context
        objectId - identifier of the file/folder
        filter - an optional filter
        includeAllowableActions - if the allowable actions must be included
        includeRelativePathSegment - if the path segment must be included
        objectInfos - informations
        Returns:
        list of parents
      • query

        public org.apache.chemistry.opencmis.commons.data.ObjectList query​(String statement,
                                                                           Integer maxItems)
      • getAllVersions

        public List<org.apache.chemistry.opencmis.commons.data.ObjectData> getAllVersions​(String objectId)
      • getId

        public String getId()
      • setTemplateDao

        public void setTemplateDao​(TemplateDAO templateDao)
      • getContentChangesXXXX

        public org.apache.chemistry.opencmis.commons.data.ObjectList getContentChangesXXXX​(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
      • 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()