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
DraftService
saveDraftFromEditor
in interface DraftService
content
- 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
DraftService
saveDraftFromEditor
in interface DraftService
content
- 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)
DraftService
findDraftForEditor
in interface DraftService
public Draft createNewContentDraft(String spaceKey, DraftService.DraftType type)
createNewContentDraft
in interface DraftService
public Long removeDraft(long abstractPageId, long draftId)
DraftService
removeDraft
in interface DraftService
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.public Long removeDraft(long draftId)
DraftService
removeDraft
in interface DraftService
draftId
- a draft to removepublic List<Draft> findDrafts(int limit, int offset) throws NotValidException
DraftService
findDrafts
in interface DraftService
limit
- - the maximum number of drafts to returnoffset
- - the offset of resultsNotValidException
public Draft getDraft(long draftId) throws NotAuthorizedException, NotValidException
DraftService
getDraft
in interface DraftService
NotAuthorizedException
- - 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
DraftService
Draft.isBlank()
returns false and the draft has no attachmentsisDraftContentChanged
in interface DraftService
NotAuthorizedException
NotValidException
Copyright © 2003–2021 Atlassian. All rights reserved.