|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DraftManager
Saves, retrieves and merges drafts of Confluence content. Currently supports drafts for blog posts and pages.
Method Summary | |
---|---|
int |
countDrafts(java.lang.String owner)
|
Draft |
create(java.lang.String username,
DraftService.DraftType draftType,
java.lang.String spaceKey)
Creates a new persistent draft of the specified draft type in the space for the user. |
Draft |
createDraftForPage(AbstractPage page,
java.lang.String username)
Gets a new draft object. |
Draft |
findDraft(java.lang.Long pageId,
java.lang.String owner,
java.lang.String type,
java.lang.String spaceKey)
Finds the draft with the given page ID, owner and type. |
Draft |
findDraft(java.lang.String pageId,
java.lang.String owner,
java.lang.String type,
java.lang.String spaceKey)
Deprecated. since 4.3 use findDraft(Long, String, String, String) |
java.util.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()
Returns the time in milliseconds between saving drafts in the editor. |
java.util.List<Draft> |
getDraftsForSpace(java.lang.String spaceKey)
|
java.lang.String |
getMergedContent(Draft draft)
Deprecated. since 4.0 use mergeContent(Draft draft) instead. |
Draft |
getOrCreate(java.lang.String username,
java.lang.String draftType,
java.lang.String spaceKey)
Gets a new draft object. |
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()
Removes all drafts in the data store associated with the current user. |
void |
removeDraft(Draft draft)
Removes the draft specified by the given page ID, owner and type. |
void |
removeDraft(java.lang.String pageId,
java.lang.String owner,
java.lang.String type,
java.lang.String spaceKey)
Deprecated. see 4.3 use removeDraft(Draft) |
void |
removeDraftById(long id)
Removes a draft by ID. |
void |
removeDraftsForUser(java.lang.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(java.lang.String newSpaceKey,
java.lang.String oldSpaceKey)
Updates all drafts with oldSpaceKey as their space key to have newSpaceKey instead. |
Method Detail |
---|
void saveDraft(Draft draft)
java.lang.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(java.lang.Long pageId, java.lang.String owner, java.lang.String type, java.lang.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(java.lang.String pageId, java.lang.String owner, java.lang.String type, java.lang.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(java.lang.String owner)
owner
-
Draft getDraft(long draftId)
java.util.List<Draft> getDraftsForSpace(java.lang.String spaceKey)
spaceKey
-
void removeDraft(Draft draft)
for an explanation of the arguments
,
for a faster way to remove a draft if you have its ID
@Deprecated void removeDraft(java.lang.String pageId, java.lang.String owner, java.lang.String type, java.lang.String spaceKey)
removeDraft(Draft)
for an explanation of the arguments
,
for a faster way to remove a draft if you have its ID
void removeDraftById(long id)
id
- the ID of the draft to removeint getDraftSaveInterval()
java.util.List<Draft> findDraftsForUser(com.atlassian.user.User user)
boolean isMergeRequired(Draft draft)
@Deprecated java.lang.String getMergedContent(Draft draft)
draft
- the draft whose changes to merge with the latest version of the content
MergeResult mergeContent(Draft draft)
draft
- the draft whose changes to merge with the latest version of the content
void updateSpaceKey(java.lang.String newSpaceKey, java.lang.String oldSpaceKey)
newSpaceKey
- the new space keyoldSpaceKey
- the old space keyDraft getOrCreate(java.lang.String username, java.lang.String draftType, java.lang.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
Draft createDraftForPage(AbstractPage page, java.lang.String username)
page
- the existing content to create the draft forusername
- name of user or null for anonymous users
void removeAll()
void removeDraftsForUser(java.lang.String username)
Draft create(java.lang.String username, DraftService.DraftType draftType, java.lang.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 draft
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |