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 |
|---|---|
int |
countDrafts()
Deprecated.
since 5.7. Not used, so no replacement.
|
Draft |
createDraftForEditor(AbstractPage page)
Deprecated.
since 5.7. Not used, so no replacement.
|
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)
|
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.
|
void |
removeDraft(long contentId,
DraftService.DraftType type,
String spaceKey)
Deprecated.
since 4.3 use
removeDraft(long) |
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.
|
Draft |
saveDraftFromEditor(String title,
DraftService.DraftType type,
String content,
String 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 Draft saveDraftFromEditor(String title, DraftService.DraftType type, String content, String contentId, String spaceKey, int pageVersion) throws NotValidException
saveDraftFromEditor(Long, String, DraftType, String, Long, String, int)NotValidException@Deprecated Draft createDraftForEditor(AbstractPage page) throws NotValidException
page - the page to create a Draft fromNotAuthorizedException - 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 exist@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 findOrCreateDraftForEditor(String spaceKey, DraftService.DraftType type)
findDraftForEditor(long, com.atlassian.confluence.content.service.DraftService.DraftType, java.lang.String) or createNewContentDraft(java.lang.String, com.atlassian.confluence.content.service.DraftService.DraftType) or getDraft(long)instead.NotAuthorizedException - if the current user is not permitted to view or create drafts in the spaceNotValidException - if the space identified does not exist.IllegalArgumentException - if the required parameters are not provided.Draft 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.@Deprecated void removeDraft(long contentId, DraftService.DraftType type, String spaceKey)
removeDraft(long)contentId - type - spaceKey - since a new page draft is unique per space the spaceKey must be provided if the contentId is 0NotAuthorizedException - if the current user does not have permission.NotValidExceptionLong 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 resultsNotAuthorizedExceptionNotValidException@Deprecated int countDrafts()
Draft 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–2021 Atlassian. All rights reserved.