Class DBSSession

    • Field Detail

      • KEYS_RETENTION_HOLD_AND_PROXIES

        protected static final Set<String> KEYS_RETENTION_HOLD_AND_PROXIES
      • fulltextStoredInBlob

        protected final boolean fulltextStoredInBlob
      • fulltextSearchDisabled

        protected final boolean fulltextSearchDisabled
      • changeTokenEnabled

        protected final boolean changeTokenEnabled
      • registry

        protected final io.dropwizard.metrics5.MetricRegistry registry
      • isLatestVersionDisabled

        protected boolean isLatestVersionDisabled
      • dotDigitsPattern

        protected static final Pattern dotDigitsPattern
      • STRING_ARRAY_TYPE

        protected static final Type STRING_ARRAY_TYPE
      • TRUE_OR_NULL_BOOLEAN_KEYS

        public static final Set<String> TRUE_OR_NULL_BOOLEAN_KEYS
        Keys for boolean values that are stored as true or null (never false).
        Since:
        11.1
      • ID_VALUES_KEYS

        public static final Set<String> ID_VALUES_KEYS
        Keys for values that are ids.
        Since:
        11.1
    • Constructor Detail

    • Method Detail

      • getRepositoryName

        public String getRepositoryName()
        Description copied from interface: Session
        Gets the repository that created this session.
        Returns:
        the repository
      • destroy

        public void destroy()
        Description copied from interface: Session
        Destroys this session.
      • save

        public void save()
        Description copied from interface: Session
        Saves this session.
      • getRootId

        protected String getRootId()
      • resolvePath

        public Document resolvePath​(String path)
        Description copied from interface: Session
        Gets the document at the given path, if any.
      • getDocumentIdByPath

        protected String getDocumentIdByPath​(String path)
      • getChildrenIds

        protected List<String> getChildrenIds​(String parentId,
                                              boolean excludeSpecialChildren,
                                              boolean excludeRegularChildren)
      • hasChildren

        protected boolean hasChildren​(String parentId)
      • getDocumentByUUID

        public Document getDocumentByUUID​(String id)
        Description copied from interface: Session
        Gets a document given its ID.
        Parameters:
        id - the document id
        Returns:
        the document
      • getRootDocument

        public Document getRootDocument()
        Description copied from interface: Session
        Gets the root document in this repository.
        Returns:
        the root document
      • getNullDocument

        public Document getNullDocument()
        Description copied from interface: Session
        Gets the null document, to be used as a fake parent to add placeless children.
        Returns:
        the null document
      • hasChild

        protected boolean hasChild​(String parentId,
                                   String name)
      • isOrderable

        protected boolean isOrderable​(String id)
      • getNextPos

        protected Long getNextPos​(String parentId)
      • orderBefore

        protected void orderBefore​(String parentId,
                                   String sourceId,
                                   String destId)
      • checkOut

        protected void checkOut​(String id)
      • recomputeVersionSeries

        protected void recomputeVersionSeries​(String versionSeriesId)
        Recomputes isLatest / isLatestMajor on all versions.
      • restoreVersion

        protected void restoreVersion​(Document doc,
                                      Document version)
      • keepWhenRestore

        protected boolean keepWhenRestore​(String key)
      • copy

        public Document copy​(Document source,
                             Document parent,
                             String name)
        Description copied from interface: Session
        Copies the source document to the given folder.

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

      • checkNotUnder

        protected void checkNotUnder​(String parentId,
                                     String id,
                                     String op)
        Checks that we don't move/copy under ourselves.
      • move

        public Document move​(Document source,
                             Document parent,
                             String name)
        Description copied from interface: Session
        Moves the source document to the given folder.

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

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

        protected void remove​(String rootId,
                              NuxeoPrincipal principal)
        Removes a document.

        We also have to update everything impacted by "relations":

        • parent-child relations: delete all subchildren recursively,
        • proxy-target relations: if a proxy is removed, update the target's PROXY_IDS; and if a target is removed, raise an error if a proxy still exists for that target.
      • createProxy

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

        public List<Document> getProxies​(Document doc,
                                         Document folder)
        Description copied from interface: Session
        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
      • getProxies

        public List<Document> getProxies​(Document doc)
        Description copied from interface: Session
        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
      • setProxyTarget

        public void setProxyTarget​(Document proxy,
                                   Document target)
        Description copied from interface: Session
        Sets a proxies' target.

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

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

        public Document importDocument​(String id,
                                       Document parent,
                                       String name,
                                       String typeName,
                                       Map<String,​Serializable> properties)
        Description copied from interface: Session
        Imports a document with a given id and parent.

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

        Parameters:
        id - 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
      • trueOrNull

        protected static Boolean trueOrNull​(Object value)
      • getVersion

        public Document getVersion​(String versionSeriesId,
                                   VersionModel versionModel)
        Description copied from interface: Session
        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:
        versionSeriesId - the versionable id
        versionModel - the version model
        Returns:
        the version, or null if not found
      • getVersionsIds

        protected List<String> getVersionsIds​(String versionSeriesId)
      • getLastVersion

        protected Document getLastVersion​(String versionSeriesId)
      • updateReadACLs

        public void updateReadACLs​(Collection<String> docIds)
        Description copied from interface: Session
        Updates the Read ACLs for some documents.
        Parameters:
        docIds - the document ids
      • isNegativeAclAllowed

        public boolean isNegativeAclAllowed()
        Description copied from interface: Session
        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
      • getACP

        public ACP getACP​(Document doc)
        Description copied from class: BaseSession
        Gets the ACP for the document (without any inheritance).
        Specified by:
        getACP in class BaseSession
        Parameters:
        doc - the document
        Returns:
        the ACP
      • setACP

        public void setACP​(Document doc,
                           ACP acp,
                           boolean overwrite)
      • isFulltextStoredInBlob

        public boolean isFulltextStoredInBlob()
        Description copied from interface: Session
        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
      • getBinaryFulltext

        public Map<String,​String> getBinaryFulltext​(String id)
        Description copied from interface: Session
        Gets the fulltext extracted from the binary fields.
      • removeDocument

        public void removeDocument​(String id)
        Description copied from interface: Session
        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
      • notifyDocumentRemove

        protected void notifyDocumentRemove​(String docId)
      • isOrderByPath

        protected boolean isOrderByPath​(OrderByClause orderByClause)
        Does an ORDER BY clause include ecm:path
      • scroll

        public ScrollResult<String> scroll​(String query,
                                           int batchSize,
                                           int keepAliveSeconds)
        Description copied from interface: Session
        Executes the given query and returns the first batch of results containing id of documents, next batch must be requested within the keepAliveSeconds delay.
      • scroll

        public ScrollResult<String> scroll​(String query,
                                           QueryFilter queryFilter,
                                           int batchSize,
                                           int keepAliveSeconds)
        Description copied from interface: Session
        Executes the given query and returns the first batch of results containing id of documents, next batch must be requested within the keepAliveSeconds delay.
      • scroll

        public ScrollResult<String> scroll​(String scrollId)
        Description copied from interface: Session
        Get the next batch of result containing id of documents.
      • convToInternal

        public static String convToInternal​(String name)
      • convToInternalAce

        public static String convToInternalAce​(String name)
      • convToNXQL

        public static String convToNXQL​(String name)
      • getType

        public static Type getType​(String name)
      • getLockManager

        public LockManager getLockManager()
        Description copied from interface: Session
        Gets the lock manager for this session.
        Returns:
        the lock manager
      • markUserChange

        public void markUserChange​(String id)
        Marks this document id as belonging to a user change.
        Since:
        9.2
      • start

        public void start()
        Description copied from interface: Session
        Start the transaction.
      • end

        public void end()
        Description copied from interface: Session
        Called just before the transaction is committed or rolled back.
      • commit

        public void commit()
        Description copied from interface: Session
        Commit the transaction.
      • rollback

        public void rollback()
        Description copied from interface: Session
        Rollback the transaction.