|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DraftService
A Service responsible for Draft related operations during editing in Confluence.
Nested Class Summary | |
---|---|
static class |
DraftService.DraftType
|
Method Summary | |
---|---|
int |
countDrafts()
|
Draft |
createDraftForEditor(AbstractPage page)
Create and store a draft for the supplied AbstractPage for the current user. |
Draft |
createNewContentDraft(java.lang.String spaceKey,
DraftService.DraftType type)
|
Draft |
findDraftForEditor(long contentId,
DraftService.DraftType type,
java.lang.String spaceKey)
Find and return a draft of the specified content Id and type for the current user. |
java.util.List<Draft> |
findDrafts(int limit,
int offset)
Finds the users drafts. |
Draft |
findOrCreateDraftForEditor(java.lang.String spaceKey,
DraftService.DraftType type)
Deprecated. @since 4.2 use 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. |
Draft |
getDraft(long draftId)
gets the draft by id for the authenticated user |
boolean |
isDraftContentChanged(java.lang.Long draftId,
java.lang.String title,
java.lang.String content,
java.lang.Long contentId)
Compares the content of a draft to an existing page. |
java.lang.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,
java.lang.String spaceKey)
Deprecated. @since 4.3 use removeDraft(long) |
java.lang.Long |
removeDraft(long abstractPageId,
long draftId)
Removes the draft specified by the given page id or draft id for the current user. |
Draft |
saveDraftFromEditor(java.lang.Long draftId,
java.lang.String title,
DraftService.DraftType type,
java.lang.String content,
java.lang.Long contentId,
java.lang.String spaceKey,
int pageVersion)
Create and store a draft for the current user with the supplied details. |
Draft |
saveDraftFromEditor(java.lang.String title,
DraftService.DraftType type,
java.lang.String content,
java.lang.String contentId,
java.lang.String spaceKey,
int pageVersion)
Deprecated. @since 4.3 use saveDraftFromEditor(Long, String, DraftType, String, Long, String, int) |
Method Detail |
---|
Draft saveDraftFromEditor(java.lang.Long draftId, java.lang.String title, DraftService.DraftType type, java.lang.String content, java.lang.Long contentId, java.lang.String spaceKey, int pageVersion) throws NotAuthorizedException, NotValidException
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 exist
java.lang.IllegalArgumentException
- if there is a problem with the arguments supplied@Deprecated Draft saveDraftFromEditor(java.lang.String title, DraftService.DraftType type, java.lang.String content, java.lang.String contentId, java.lang.String spaceKey, int pageVersion) throws NotAuthorizedException, NotValidException
saveDraftFromEditor(Long, String, DraftType, String, Long, String, int)
NotAuthorizedException
NotValidException
Draft createDraftForEditor(AbstractPage page) throws NotAuthorizedException, NotValidException
page
- the page to create a Draft from
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 existboolean isDraftContentChanged(java.lang.Long draftId, java.lang.String title, java.lang.String content, java.lang.Long contentId)
Draft.isBlank()
returns false and the draft has no attachments
draft
- - the draft to check
Draft findDraftForEditor(long contentId, DraftService.DraftType type, java.lang.String spaceKey) throws NotAuthorizedException, NotValidException
contentId
- type
- spaceKey
-
NotAuthorizedException
- if the current user is not permitted to view drafts for the identified content
NotValidException
- if the content identified does not exist
java.lang.IllegalArgumentException
- if there are any problems with the supplied parametersDraft findOrCreateDraftForEditor(java.lang.String spaceKey, DraftService.DraftType type) throws NotAuthorizedException, NotValidException
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 space
NotValidException
- if the space identified does not exist.
java.lang.IllegalArgumentException
- if the required parameters are not provided.Draft createNewContentDraft(java.lang.String spaceKey, DraftService.DraftType type) throws NotAuthorizedException, NotValidException
NotAuthorizedException
NotValidException
java.lang.Long removeDraft(long abstractPageId, long draftId) throws NotAuthorizedException, NotValidException
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.
NotValidException
@Deprecated void removeDraft(long contentId, DraftService.DraftType type, java.lang.String spaceKey) throws NotAuthorizedException, NotValidException
removeDraft(long)
contentId
- type
- spaceKey
- since a new page draft is unique per space the spaceKey must be provided if the contentId is 0
NotAuthorizedException
- if the current user does not have permission.
NotValidException
java.lang.Long removeDraft(long draftId)
draftId
- a draft to remove
java.util.List<Draft> findDrafts(int limit, int offset) throws NotAuthorizedException, NotValidException
limit
- - the maximum number of drafts to returnoffset
- - the offset of results
NotAuthorizedException
NotValidException
int countDrafts()
Draft getDraft(long draftId) throws NotAuthorizedException, NotValidException
draftId
-
NotAuthorizedException
- - if the owner of the draft is not the authenticated user
NotValidException
- - if no draft exists with this id
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |