Interface InternalVersionManager

    • Method Detail

      • getVirtualItemStateProvider

        VirtualItemStateProvider getVirtualItemStateProvider()
        returns the virtual item state provider that exposes the internal versions as items.
        Returns:
        the virtual item state provider.
      • getVersionHistory

        VersionHistoryInfo getVersionHistory​(Session session,
                                             NodeState vNode,
                                             NodeId copiedFrom)
                                      throws RepositoryException
        Returns information about the version history of the specified node. If the given node does not already have an associated version history, then an empty history is automatically created. This method should only be called by code that already knows that the specified node is versionable.
        Parameters:
        session - workspace session
        vNode - node whose version history should be returned
        copiedFrom - the node id for the jcr:copiedFrom property use for copied nodes
        Returns:
        identifiers of the version history and root version nodes
        Throws:
        RepositoryException - if an error occurs
      • checkin

        InternalVersion checkin​(Session session,
                                NodeStateEx node,
                                Calendar created)
                         throws RepositoryException
        invokes the checkin() on the persistent version manager and remaps the newly created version objects.
        Parameters:
        session - session that invokes the checkin
        node - node to checkin
        created - create time of the new version, or null for the current time
        Returns:
        the newly created version
        Throws:
        RepositoryException - if an error occurs
      • canCheckout

        NodeId canCheckout​(NodeStateEx state,
                           NodeId activityId)
                    throws RepositoryException
        invokes the checkout() on the persistent version manager.
        Parameters:
        state - node to checkout
        activityId - node id if the current activity
        Returns:
        the base version id
        Throws:
        RepositoryException - if an error occurs
      • removeVersion

        void removeVersion​(Session session,
                           InternalVersionHistory history,
                           Name versionName)
                    throws RepositoryException
        Removes the specified version from the given version history.
        Parameters:
        session - the session that performs the remove
        history - version history to remove the version from
        versionName - name of the version
        Throws:
        RepositoryException - if an error occurs
      • setVersionLabel

        InternalVersion setVersionLabel​(Session session,
                                        InternalVersionHistory history,
                                        Name version,
                                        Name label,
                                        boolean move)
                                 throws RepositoryException
        Sets the version label to the given version. If the label is already assigned to another version, a VersionException is thrown unless move is true. If version is null, the label is removed from the respective version. In either case, the version the label was previously assigned is returned, or null of the label was not moved.
        Parameters:
        session - the session that performs the operation
        history - version history
        version - name of the version
        label - new label
        move - if true label will be moved
        Returns:
        the version that had the label or null
        Throws:
        RepositoryException - if an error occurs
      • getVersionHistoryOfNode

        InternalVersionHistory getVersionHistoryOfNode​(NodeId id)
                                                throws RepositoryException
        Returns the version history for the versionable node with the given id.
        Parameters:
        id - id of the node to retrieve the version history for
        Returns:
        the version history
        Throws:
        RepositoryException - if an error occurs or the history does not exit
      • getHeadVersionOfNode

        InternalVersion getHeadVersionOfNode​(NodeId id)
                                      throws RepositoryException
        Returns the head version of the node with the given id. this is always the last of all versions. this only works correctly for liner version graphs (i.e. simple versioning)
        Parameters:
        id - id of the node to retrieve the version for
        Returns:
        the version.
        Throws:
        RepositoryException - if an error occurs
      • createActivity

        NodeId createActivity​(Session session,
                              String title)
                       throws RepositoryException
        Creates a new activity
        Parameters:
        session - the current session
        title - title of the new activity
        Returns:
        the nodeid of the new activity
        Throws:
        RepositoryException - if an error occurs
      • removeActivity

        void removeActivity​(Session session,
                            NodeId nodeId)
                     throws RepositoryException
        Removes an activity and all
        Parameters:
        session - the current session
        nodeId - id of the activity to remove
        Throws:
        RepositoryException - if an error occurs
      • close

        void close()
            throws Exception
        Close this version manager. After having closed a persistence manager, further operations on this object are treated as illegal and throw
        Throws:
        Exception - if an error occurs