public class DefaultDraftService extends Object implements DraftService
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.
|
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.
|
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.
|
public Draft saveDraftFromEditor(Long draftId, Long parentPageId, String title, DraftService.DraftType type, String content, Long contentId, String spaceKey, int pageVersion) throws NotValidException
DraftServicesaveDraftFromEditor in interface DraftServicecontent - the editor formatted content (will be converted into storage format).contentId - as a String since NEW is taken to represent a new draftNotValidException - if the data for the draft is incomplete or the content identified does not exist@Deprecated public Draft saveDraftFromEditor(Long draftId, String title, DraftService.DraftType type, String content, Long contentId, String spaceKey, int pageVersion) throws NotValidException
DraftServicesaveDraftFromEditor in interface DraftServicecontent - the editor formatted content (will be converted into storage format).contentId - as a String since NEW is taken to represent a new draftNotValidException - if the data for the draft is incomplete or the content identified does not existpublic Draft findDraftForEditor(long contentId, DraftService.DraftType type, String spaceKey)
DraftServicefindDraftForEditor in interface DraftServicepublic Draft createNewContentDraft(String spaceKey, DraftService.DraftType type)
createNewContentDraft in interface DraftServicepublic Long removeDraft(long abstractPageId, long draftId)
DraftServiceremoveDraft in interface DraftServiceabstractPageId - 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.public Long removeDraft(long draftId)
DraftServiceremoveDraft in interface DraftServicedraftId - a draft to removepublic List<Draft> findDrafts(int limit, int offset) throws NotValidException
DraftServicefindDrafts in interface DraftServicelimit - - the maximum number of drafts to returnoffset - - the offset of resultsNotValidExceptionpublic Draft getDraft(long draftId) throws NotAuthorizedException, NotValidException
DraftServicegetDraft in interface DraftServiceNotAuthorizedException - - if the owner of the draft is not the authenticated userNotValidException - - if no draft exists with this id@Deprecated public boolean isDraftContentChanged(Long draftId, String title, String content, Long contentId) throws NotAuthorizedException, NotValidException
DraftServiceDraft.isBlank() returns false and the draft has no attachmentsisDraftContentChanged in interface DraftServiceNotAuthorizedExceptionNotValidExceptionCopyright © 2003–2022 Atlassian. All rights reserved.