public class DefaultDraftService extends Object implements DraftService
DraftService.DraftType| Modifier and Type | Method and Description |
|---|---|
int |
countDrafts()
Deprecated.
|
Draft |
createDraftForEditor(AbstractPage page)
Deprecated.
|
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 |
findOrCreateDraftForEditor(String spaceKey,
DraftService.DraftType type)
Create the draft within the identified space for the current user.
|
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.
|
void |
removeDraft(long contentId,
DraftService.DraftType type,
String spaceKey)
Deprecated.
|
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,
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(String title,
DraftService.DraftType type,
String content,
String contentId,
String spaceKey,
int pageVersion)
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 exist@Deprecated public Draft saveDraftFromEditor(String title, DraftService.DraftType type, String content, String contentId, String spaceKey, int pageVersion) throws NotValidException
saveDraftFromEditor in interface DraftServiceNotValidExceptionpublic Draft findDraftForEditor(long contentId, DraftService.DraftType type, String spaceKey)
DraftServicefindDraftForEditor in interface DraftService@Deprecated public Draft createDraftForEditor(AbstractPage page) throws NotValidException
DraftServicecreateDraftForEditor in interface DraftServicepage - the page to create a Draft fromNotValidException - if the data for the draft is incomplete or the content identified does not existpublic Draft findOrCreateDraftForEditor(String spaceKey, DraftService.DraftType type)
DraftServicefindOrCreateDraftForEditor 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 resultsNotValidException@Deprecated public int countDrafts()
countDrafts in interface DraftServicepublic 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 void removeDraft(long contentId, DraftService.DraftType type, String spaceKey)
DraftServiceremoveDraft in interface DraftServicespaceKey - since a new page draft is unique per space the spaceKey must be provided if the contentId is 0@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–2018 Atlassian. All rights reserved.