Interface ContentDraftService

  • All Known Implementing Classes:
    ContentDraftServiceImpl, LegacyContentDraftServiceImpl, SharedContentDraftServiceImpl

    @ExperimentalApi
    public interface ContentDraftService
    Content draft service for creating and manipulating drafts

    In shared drafts, the draftId and the contentId to create a draft will be the same. A draft is just a content with the status of draft.

    In the legacy drafts, the draft may have a different id

    • Method Detail

      • publishNewDraft

        Content publishNewDraft​(Content content,
                                Expansion... expansions)
        Publishes the draft. This will change the status of the current draft to current.
        Parameters:
        content - new content to be created
        expansions - An array list of properties to expand on the content.
        Returns:
        the newly published content
        Throws:
        NotFoundException - if the draft doesn't exist or the user doesn't have permission to view it
        PermissionException - if the user does have permission to modify this draft
      • publishEditDraft

        Content publishEditDraft​(Content content,
                                 ContentDraftService.ConflictPolicy conflictPolicy)
        Update existing page/blog post that has an existing draft
        Parameters:
        content - page/blog post content, requires a valid content id of an existing draft
        conflictPolicy - the policy to apply on a conflict, either abort or automerge. No mergeable conflicts will still return a 409 even if policy is automerge
        Returns:
        the updated content
        Throws:
        NotFoundException - if the draft doesn't exist
        ServiceException - if the updated content is missing spacekey or type
      • deleteDraft

        void deleteDraft​(ContentId contentId)
        Deletes the draft for this content. In the case of shared drafts, only drafts which have never been published can be deleted
        Parameters:
        contentId - id of the draft to delete
        Throws:
        NotFoundException - if a draft doesn't exist, or the user doesn't have permission to view it
        PermissionException - if the user does not have permission to modify this draft