Constructor and Description |
---|
SessionDraftDao(javax.servlet.http.HttpSession session) |
Modifier and Type | Method and Description |
---|---|
int |
countDrafts(java.lang.String creatorName) |
java.util.List<Draft> |
findAll()
Returns all drafts stored in the data store.
|
java.util.List<Draft> |
findByCreatorName(java.lang.String creatorName)
Returns the drafts stored against the given username.
|
java.util.List<Draft> |
getAllDraftsForSpace(java.lang.String spaceKey) |
Draft |
getDraft(long draftId)
Returns the draft with the given ID, or null if no draft is found with that ID.
|
Draft |
getDraft(java.lang.Long pageId,
java.lang.String owner,
java.lang.String type,
java.lang.String spaceKey)
Deprecated.
|
Draft |
getDraft(java.lang.String pageId,
ConfluenceUser owner,
java.lang.String type,
java.lang.String spaceKey)
Finds and returns a draft object with all the specified properties or null if none is found.
|
Draft |
getDraft(java.lang.String pageId,
java.lang.String owner,
java.lang.String type,
java.lang.String spaceKey)
Deprecated.
|
void |
remove(Draft draft)
Removes a draft based on its page ID, owner and type.
|
void |
remove(long id)
Remove a draft based on its ID.
|
void |
removeAll()
Removes all drafts in the data store.
|
void |
saveOrUpdate(Draft draft)
Saves the draft.
|
void |
updateSpaceKey(java.lang.String newSpaceKey,
java.lang.String oldSpaceKey)
Changes all drafts with a space key of oldSpaceKey to have newSpaceKey.
|
public void saveOrUpdate(Draft draft)
DraftDao
saveOrUpdate
in interface DraftDao
public Draft getDraft(java.lang.String pageId, ConfluenceUser owner, java.lang.String type, java.lang.String spaceKey)
DraftDao
getDraft
in interface DraftDao
pageId
- the id of the page which this draft is associated withowner
- the owner of the drafttype
- the type of draft, which is usually the result of calling ContentEntityObject.getType()
spaceKey
- space key, if relevant for the draft. This is used to enable NEW page drafts across multiple spaces@Deprecated public Draft getDraft(java.lang.String pageId, java.lang.String owner, java.lang.String type, java.lang.String spaceKey)
@Deprecated public Draft getDraft(java.lang.Long pageId, java.lang.String owner, java.lang.String type, java.lang.String spaceKey)
public Draft getDraft(long draftId)
DraftDao
public void remove(Draft draft)
DraftDao
remove
in interface DraftDao
for a faster way to remove a draft when you know its ID
public void remove(long id)
DraftDao
public java.util.List<Draft> findByCreatorName(java.lang.String creatorName)
DraftDao
findByCreatorName
in interface DraftDao
public void updateSpaceKey(java.lang.String newSpaceKey, java.lang.String oldSpaceKey)
DraftDao
updateSpaceKey
in interface DraftDao
newSpaceKey
- the new space keyoldSpaceKey
- the old space keypublic void removeAll()
DraftDao
public java.util.List<Draft> findAll()
DraftDao
public java.util.List<Draft> getAllDraftsForSpace(java.lang.String spaceKey)
getAllDraftsForSpace
in interface DraftDao
public int countDrafts(java.lang.String creatorName)
countDrafts
in interface DraftDao
Copyright © 2003-2014 Atlassian. All Rights Reserved.