Class DefaultDraftsTransitionHelper

    • Method Detail

      • getDraftForPage

        public ContentEntityObject getDraftForPage​(AbstractPage abstractPage)
        Description copied from interface: DraftsTransitionHelper
        This method should retrieve a draft from a given AbstractPage respecting the Shared Drafts feature state.
        Specified by:
        getDraftForPage in interface DraftsTransitionHelper
        Parameters:
        abstractPage - the page we want the draft for (for legacy drafts, we get the current users per-page draft).
        Returns:
        a ContentEntityObject of the draft for the given AbstractPage.
      • createDraft

        public ContentEntityObject createDraft​(String contentType,
                                               String spaceKey)
        Description copied from interface: DraftsTransitionHelper
        This method should attempt to create a draft based on whether or not the Shared Drafts Dark Feature is enabled or disabled.
        Specified by:
        createDraft in interface DraftsTransitionHelper
        Parameters:
        contentType - specifies the type of Draft, either "blogpost" or "page" as of 5.9.1.
        spaceKey - is used to specify the key of the Space the draft will belong to.
        Returns:
        a ContentEntityObject of the newly created draft.
      • createDraft

        public ContentEntityObject createDraft​(String contentType,
                                               String spaceKey,
                                               long parentPageId)
        Description copied from interface: DraftsTransitionHelper
        This method should attempt to create a draft based on whether or not the Shared Drafts Dark Feature is enabled or disabled. The draft will be created as a child of the provided parent page.
        Specified by:
        createDraft in interface DraftsTransitionHelper
        Parameters:
        contentType - specifies the type of Draft, either "blogpost" or "page" as of 5.9.1.
        spaceKey - is used to specify the key of the Space the draft will belong to.
        parentPageId - is the parent ID of the draft.
        Returns:
        a ContentEntityObject of the newly created draft.
      • getDraft

        public ContentEntityObject getDraft​(long draftId)
        Description copied from interface: DraftsTransitionHelper
        This method should attempt to retrieve a draft, and based on whether or not the Shared Draft dark feature is enabled (determined by the isSharedDraftsFeatureEnabled method) or disabled should return a Shared Draft or Legacy Draft respectively.

        There is no need to provide a spaceKey because the spaceKey of the draft (if found) will be used in the Shared Draft dark feature check

        Specified by:
        getDraft in interface DraftsTransitionHelper
        Parameters:
        draftId - specifies the ID of the draft to be retrieved.
        Returns:
        a ContentEntityObject of that draft.
      • getEditMode

        public String getEditMode​(String spaceKey)
        Description copied from interface: DraftsTransitionHelper
        This method is used to determine what's the current edit mode regarding collaborative editing (legacy, limited or collaborative), the method is provided a spaceKey and returns the current edit mode for that space.
        Specified by:
        getEditMode in interface DraftsTransitionHelper
        Parameters:
        spaceKey - is used to specify the key of the Space we want to check.
        Returns:
        edit mode: legacy, limited or collaborative.
      • isSharedDraftsFeatureEnabled

        public boolean isSharedDraftsFeatureEnabled​(String spaceKey)
        Description copied from interface: DraftsTransitionHelper
        This method is used to determine whether or not the Shared Drafts Dark Feature is enabled or disabled on a per space basis, the method is provided a spaceKey and returns whether or not the feature is enabled.
        Specified by:
        isSharedDraftsFeatureEnabled in interface DraftsTransitionHelper
        Parameters:
        spaceKey - is used to specify the key of the Space we want to check.
        Returns:
        true if the Shared Drafts feature is enabled in the specified space.
      • isLimitedModeEnabled

        @Deprecated
        public boolean isLimitedModeEnabled​(String spaceKey)
        Deprecated.
        Description copied from interface: DraftsTransitionHelper
        This method is used to determine whether or not the instance is in limited mode. Limited mode is defined as:
        • shared-drafts dark feature is ENABLED
        • synchrony dark feature is DISABLED
        Specified by:
        isLimitedModeEnabled in interface DraftsTransitionHelper
        Returns:
        true if limited mode is on, false otherwise (since 7.5.0 this method always returns false)