Interface ContentDraftService
- All Known Implementing Classes:
ContentDraftServiceImpl
,LegacyContentDraftServiceImpl
,SharedContentDraftServiceImpl
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
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
The conflict resolution policy to apply when a conflict occurs.static final class
static interface
Validate the operations for a piece of content -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteDraft
(ContentId contentId) Deletes the draft for this content.publishEditDraft
(Content content, ContentDraftService.ConflictPolicy conflictPolicy) Update existing page/blog post that has an existing draftpublishNewDraft
(Content content, Expansion... expansions) Publishes the draft.
-
Field Details
-
INTERNAL_DRAFT
- See Also:
-
-
Method Details
-
publishNewDraft
Publishes the draft. This will change the status of the current draft to current.- Parameters:
content
- new content to be createdexpansions
- 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 itPermissionException
- if the user does have permission to modify this draft
-
publishEditDraft
Update existing page/blog post that has an existing draft- Parameters:
content
- page/blog post content, requires a valid content id of an existing draftconflictPolicy
- 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 existServiceException
- if the updated content is missing spacekey or type
-
deleteDraft
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 itPermissionException
- if the user does not have permission to modify this draft
-
validator
ContentDraftService.DraftValidator validator()
-