Interface ContentDraftService
-
- All Known Implementing Classes:
ContentDraftServiceImpl
,LegacyContentDraftServiceImpl
,SharedContentDraftServiceImpl
@ExperimentalApi public interface ContentDraftService
Content draft service for creating and manipulating draftsIn 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 Classes Modifier and Type Interface Description static class
ContentDraftService.ConflictPolicy
The conflict resolution policy to apply when a conflict occurs.static class
ContentDraftService.DraftErrorCodes
static interface
ContentDraftService.DraftValidator
Validate the operations for a piece of content
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
deleteDraft(ContentId contentId)
Deletes the draft for this content.Content
publishEditDraft(Content content, ContentDraftService.ConflictPolicy conflictPolicy)
Update existing page/blog post that has an existing draftContent
publishNewDraft(Content content, Expansion... expansions)
Publishes the draft.ContentDraftService.DraftValidator
validator()
-
-
-
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 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
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 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
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 itPermissionException
- if the user does not have permission to modify this draft
-
validator
ContentDraftService.DraftValidator validator()
-
-