Interface Session<T extends QueryFilter>

    • Method Detail

      • getRepositoryName

        String getRepositoryName()
        Gets the repository that created this session.
        Returns:
        the repository
      • scroll

        ScrollResult<Stringscroll​(String query,
                                    int batchSize,
                                    int keepAliveSeconds)
        Executes the given query and returns the first batch of results containing id of documents, next batch must be requested within the keepAliveSeconds delay.
        Since:
        8.4
      • scroll

        ScrollResult<Stringscroll​(String query,
                                    T queryFilter,
                                    int batchSize,
                                    int keepAliveSeconds)
        Executes the given query and returns the first batch of results containing id of documents, next batch must be requested within the keepAliveSeconds delay.
        Since:
        10.3
      • save

        void save()
        Saves this session.
      • destroy

        void destroy()
        Destroys this session.
      • getRootDocument

        Document getRootDocument()
        Gets the root document in this repository.
        Returns:
        the root document
      • getNullDocument

        Document getNullDocument()
        Gets the null document, to be used as a fake parent to add placeless children.
        Returns:
        the null document
      • copy

        Document copy​(Document src,
                      Document dst,
                      String name)
        Copies the source document to the given folder.

        If the destination document is not a folder, an exception is thrown.

      • move

        Document move​(Document src,
                      Document dst,
                      String name)
        Moves the source document to the given folder.

        If the destination document is not a folder an exception is thrown.

        Parameters:
        src - the source document to move
        dst - the destination folder
        name - the new name of the document or null if the original name should be preserved
      • createProxy

        Document createProxy​(Document doc,
                             Document folder)
        Creates a generic proxy to the given document inside the given folder.
        Parameters:
        doc - the document
        folder - the folder
        Returns:
        the proxy
      • getProxies

        List<DocumentgetProxies​(Document doc,
                                  Document folder)
        Finds the proxies for a document. If the folder is not null, the search will be limited to its children.

        If the document is a version, then only proxies to that version will be looked up.

        Parameters:
        doc - the document or version
        folder - the folder, or null
        Returns:
        the list of proxies if any is found otherwise an empty list
        Since:
        1.4.1 for the case where doc is a proxy
      • getProxies

        List<DocumentgetProxies​(Document doc)
        Finds the proxies for a document. (The document may be a version or a live document)
        Parameters:
        doc - the document or version
        Returns:
        the list of proxies if any is found otherwise an empty list
        Since:
        10.2
      • setProxyTarget

        void setProxyTarget​(Document proxy,
                            Document target)
        Sets a proxies' target.

        The target must have the same version series as the proxy.

        Parameters:
        proxy - the proxy
        target - the new target
        Since:
        5.5
      • importDocument

        Document importDocument​(String uuid,
                                Document parent,
                                String name,
                                String typeName,
                                Map<String,​Serializable> properties)
        Imports a document with a given id and parent.

        The document can then be filled with the normal imported properties.

        Parameters:
        uuid - the document uuid
        parent - the document parent, or null for a version
        name - the document name in its parent
        typeName - the document type, or ecm:proxy for a proxy
        properties - system properties of the document, which will vary depending whether it's a live document, a version or a proxy (see the various IMPORT_* constants of CoreSession)
        Returns:
        a writable Document, even for proxies and versions
      • getVersion

        Document getVersion​(String versionableId,
                            VersionModel versionModel)
        Gets a version of a document, given its versionable id and label.

        The version model contains the label of the version to look for. On return, it is filled with the version's description and creation date.

        Parameters:
        versionableId - the versionable id
        versionModel - the version model
        Returns:
        the version, or null if not found
      • isNegativeAclAllowed

        boolean isNegativeAclAllowed()
        Returns true if negative ACLs are allowed.

        Negative ACLs are ACLs that include an ACE with a deny (isGranted=false). This does not include the full-blocking ACE for Everyone/Everything, which is always allowed.

        Returns:
        true if negative ACLs are allowed
        Since:
        6.0
      • updateReadACLs

        void updateReadACLs​(Collection<String> docIds)
        Updates the Read ACLs for some documents.
        Parameters:
        docIds - the document ids
        Since:
        9.10
      • isFulltextStoredInBlob

        boolean isFulltextStoredInBlob()
        Checks if fulltext extracted from the binary fields is internally stored as a blob.
        Returns:
        true if fulltext from binaries is store as a blob
        Since:
        11.1
      • removeDocument

        void removeDocument​(String id)
        Removes a document. In DBS, this removal is done without checking if proxies are targeting the document, or if it has any children.
        Parameters:
        id - the document id
        Since:
        11.1
      • start

        void start()
        Start the transaction.
        Since:
        11.1
      • end

        void end()
        Called just before the transaction is committed or rolled back.
        Since:
        11.1
      • commit

        void commit()
        Commit the transaction.
        Since:
        11.1
      • rollback

        void rollback()
        Rollback the transaction.
        Since:
        11.1