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
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(String title, DraftService.DraftType type, String content, String contentId, String spaceKey, int pageVersion) throws NotValidException
saveDraftFromEditor
in interface DraftService
NotValidException
public Draft findDraftForEditor(long contentId, DraftService.DraftType type, String spaceKey)
DraftService
findDraftForEditor
in interface DraftService
@Deprecated public Draft createDraftForEditor(AbstractPage page) throws NotValidException
DraftService
createDraftForEditor
in interface DraftService
page
- 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)
DraftService
findOrCreateDraftForEditor
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
@Deprecated public int countDrafts()
countDrafts
in interface DraftService
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 void removeDraft(long contentId, DraftService.DraftType type, String spaceKey)
DraftService
removeDraft
in interface DraftService
spaceKey
- 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
DraftService
Draft.isBlank()
returns false and the draft has no attachmentsisDraftContentChanged
in interface DraftService
NotAuthorizedException
NotValidException
Copyright © 2003–2015 Atlassian. All rights reserved.