public interface DraftService
This service will only support the handling of Draft (legacy drafts)
| Modifier and Type | Interface and Description |
|---|---|
static class |
DraftService.DraftType |
| Modifier and Type | Method and Description |
|---|---|
Draft |
createNewContentDraft(String spaceKey,
DraftService.DraftType type) |
Draft |
findDraftForEditor(long contentId,
DraftService.DraftType type,
String spaceKey)
Find and return a draft of the specified content Id and type for the current user.
|
List<Draft> |
findDrafts(int limit,
int offset)
Finds the users drafts.
|
Draft |
getDraft(long draftId)
gets the draft by id for the authenticated user
|
boolean |
isDraftContentChanged(Long draftId,
String title,
String content,
Long contentId)
Deprecated.
since 5.7. No replacement (should stop being used).
|
Long |
removeDraft(long draftId)
Removes the draft with the specified ID if it is found, and returns the same ID passed.
|
Long |
removeDraft(long abstractPageId,
long draftId)
Removes the draft specified by the given page id or draft id for the current user.
|
default Draft |
saveDraftFromEditor(Long draftId,
Long parentPageId,
String title,
DraftService.DraftType type,
String content,
Long contentId,
String spaceKey,
int pageVersion)
Create and store a draft for the current user with the supplied details.
|
Draft |
saveDraftFromEditor(Long draftId,
String title,
DraftService.DraftType type,
String content,
Long contentId,
String spaceKey,
int pageVersion)
Deprecated.
|
default Draft saveDraftFromEditor(Long draftId, Long parentPageId, String title, DraftService.DraftType type, String content, Long contentId, String spaceKey, int pageVersion) throws NotValidException
draftId - parentPageId - title - type - content - the editor formatted content (will be converted into storage format).contentId - as a String since NEW is taken to represent a new draftspaceKey - pageVersion - NotAuthorizedException - if the current user is not able to save a draft (doesn't have edit permission)NotValidException - if the data for the draft is incomplete or the content identified does not existIllegalArgumentException - if there is a problem with the arguments supplied@Deprecated Draft saveDraftFromEditor(Long draftId, String title, DraftService.DraftType type, String content, Long contentId, String spaceKey, int pageVersion) throws NotValidException
saveDraftFromEditor(Long, Long, String, DraftType, String, Long, String, int)draftId - title - type - content - the editor formatted content (will be converted into storage format).contentId - as a String since NEW is taken to represent a new draftspaceKey - pageVersion - NotAuthorizedException - if the current user is not able to save a draft (doesn't have edit permission)NotValidException - if the data for the draft is incomplete or the content identified does not existIllegalArgumentException - if there is a problem with the arguments supplied@Deprecated boolean isDraftContentChanged(Long draftId, String title, String content, Long contentId)
Draft.isBlank() returns false and the draft has no attachmentsDraft findDraftForEditor(long contentId, DraftService.DraftType type, String spaceKey) throws NotAuthorizedException, NotValidException
contentId - type - spaceKey - NotAuthorizedException - if the current user is not permitted to view drafts for the identified contentNotValidException - if the content identified does not existIllegalArgumentException - if there are any problems with the supplied parametersDraft createNewContentDraft(String spaceKey, DraftService.DraftType type)
Long removeDraft(long abstractPageId, long draftId)
abstractPageId - the id of the abstract page the draft is an edit for.draftId - the draft of the id to remove, this is necessary if abstractPageId = 0.NotAuthorizedException - if the current user does not have permission.Long removeDraft(long draftId)
draftId - a draft to removeList<Draft> findDrafts(int limit, int offset) throws NotValidException
limit - - the maximum number of drafts to returnoffset - - the offset of resultsNotAuthorizedExceptionNotValidExceptionDraft getDraft(long draftId) throws NotAuthorizedException, NotValidException
draftId - NotAuthorizedException - - if the owner of the draft is not the authenticated userNotValidException - - if no draft exists with this idCopyright © 2003–2022 Atlassian. All rights reserved.