public interface DraftManager
Modifier and Type | Method and Description |
---|---|
int |
countDrafts(String owner) |
Draft |
create(String username,
DraftService.DraftType draftType,
String spaceKey)
Creates a new persistent draft of the specified draft type in the space
for the user.
|
Draft |
createDraftForPage(AbstractPage page,
String username)
Deprecated.
since 5.7. No replacement.
|
Draft |
findDraft(Long pageId,
String owner,
String type,
String spaceKey)
Finds the draft with the given page ID, owner and type.
|
Draft |
findDraft(String pageId,
String owner,
String type,
String spaceKey)
Deprecated.
since 4.3 use
findDraft(Long, String, String, String) |
List<Draft> |
findDraftsForUser(com.atlassian.user.User user)
Returns the drafts for the user provided or an empty list if the user has no drafts.
|
Draft |
getDraft(long draftId)
Finds the draft given a specific draft id.
|
int |
getDraftSaveInterval()
Deprecated.
since 5.7. No replacement.
|
List<Draft> |
getDraftsForSpace(String spaceKey)
Deprecated.
since 5.7. No replacement.
|
String |
getMergedContent(Draft draft)
Deprecated.
since 4.0 use mergeContent(Draft draft) instead.
|
Draft |
getOrCreate(String username,
String draftType,
String spaceKey)
Deprecated.
since 5.7. No replacement.
|
boolean |
isMergeRequired(Draft draft)
Returns true if the draft version of a page is different to the current version of a page, otherwise false.
|
MergeResult |
mergeContent(Draft draft)
Attempts the merge the changes done by this draft with the latest version of the content.
|
void |
removeAll()
Deprecated.
since 5.7. Use
removeDraftsForUser(String) . |
void |
removeAllDrafts()
Removes all drafts stored in the database
|
void |
removeDraft(Draft draft)
Removes the draft specified.
|
void |
removeDraft(String pageId,
String owner,
String type,
String spaceKey)
Deprecated.
since 4.3 use
removeDraft(Draft) |
void |
removeDraftById(long id)
Deprecated.
since 5.7. Use
removeDraft(Draft) |
void |
removeDraftsForUser(String username)
Removes all drafts in the data store associated with the specified user.
|
void |
saveDraft(Draft draft)
Saves the provided draft to the data store.
|
void |
updateSpaceKey(String newSpaceKey,
String oldSpaceKey)
Deprecated.
since 5.7. No replacement.
|
void saveDraft(Draft draft)
The draft must have a page ID of "0" for drafts of new content, or the ID of an existing page or blog post.
IllegalArgumentException
- if the provided draft is null, has a null page ID, or no content with the draft's page ID
can be found.Draft findDraft(Long pageId, String owner, String type, String spaceKey)
pageId
- the ID of the content which the draft is forowner
- the user name of the user who created the drafttype
- the type of draft, which is usually the result of calling ContentEntityObject.getType()
spaceKey
- Space that the draft lives in.@Deprecated Draft findDraft(String pageId, String owner, String type, String spaceKey)
findDraft(Long, String, String, String)
pageId
- the ID of the content which the draft is forowner
- the user name of the user who created the drafttype
- the type of draft, which is usually the result of calling ContentEntityObject.getType()
spaceKey
- Space that the draft lives in.int countDrafts(String owner)
owner
- Draft getDraft(long draftId)
@Deprecated List<Draft> getDraftsForSpace(String spaceKey)
spaceKey
- void removeDraft(Draft draft)
@Deprecated void removeDraft(String pageId, String owner, String type, String spaceKey)
removeDraft(Draft)
for an explanation of the arguments
@Deprecated void removeDraftById(long id)
removeDraft(Draft)
id
- the ID of the draft to remove@Deprecated int getDraftSaveInterval()
List<Draft> findDraftsForUser(com.atlassian.user.User user)
boolean isMergeRequired(Draft draft)
Always returns false for new content.
@Deprecated String getMergedContent(Draft draft)
draft
- the draft whose changes to merge with the latest version of the contentMergeResult mergeContent(Draft draft)
draft
- the draft whose changes to merge with the latest version of the content@Deprecated void updateSpaceKey(String newSpaceKey, String oldSpaceKey)
newSpaceKey
- the new space keyoldSpaceKey
- the old space key@Deprecated Draft getOrCreate(String username, String draftType, String spaceKey)
username
- name of user or null for anonymous usersdraftType
- the content type of the draft, e.g. Page.CONTENT_TYPE
spaceKey
- the space key of the content@Deprecated Draft createDraftForPage(AbstractPage page, String username)
page
- the existing content to create the draft forusername
- name of user or null for anonymous users@Deprecated void removeAll()
removeDraftsForUser(String)
.void removeAllDrafts()
void removeDraftsForUser(String username)
Draft create(String username, DraftService.DraftType draftType, String spaceKey)
username
- - the owner of the draft, may be null for anonymousdraftType
- - the type of draft, (either blogpost or page)spaceKey
- - the space in which to create the draftCopyright © 2003–2017 Atlassian. All rights reserved.