|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.confluence.content.service.DefaultDraftService
public class DefaultDraftService
Note that this implementation of the DraftService does not perform any permission checking. This has always been the case in Confluence and needs to remain the case at the moment due to the way certain UI operations work such as copying a page. See CONFDEV-227 for more details.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.atlassian.confluence.content.service.DraftService |
---|
DraftService.DraftType |
Method Summary | |
---|---|
Draft |
createDraftForEditor(AbstractPage page)
Create and store a draft for the supplied AbstractPage for the current user. |
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. |
Draft |
findOrCreateDraftForEditor(String spaceKey,
DraftService.DraftType type)
Find the draft within the identified space for the current user. |
void |
removeDraft(long contentId,
DraftService.DraftType type,
String spaceKey)
Removes the draft specified by the given content id and type for the current user. |
Draft |
saveDraftFromEditor(String title,
DraftService.DraftType type,
String content,
String contentId,
String spaceKey,
int pageVersion)
Create and store a draft for the current user with the supplied details. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public Draft saveDraftFromEditor(String title, DraftService.DraftType type, String content, String contentId, String spaceKey, int pageVersion) throws NotAuthorizedException, NotValidException
DraftService
saveDraftFromEditor
in interface DraftService
content
- the editor formatted content (will be converted into storage format).contentId
- as a String since NEW is taken to represent a new draft
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 existpublic Draft findDraftForEditor(long contentId, DraftService.DraftType type, String spaceKey) throws NotAuthorizedException, NotValidException
DraftService
findDraftForEditor
in interface DraftService
NotAuthorizedException
- if the current user is not permitted to view drafts for the identified content
NotValidException
- if the content identified does not existpublic Draft createDraftForEditor(AbstractPage page) throws NotAuthorizedException, NotValidException
DraftService
createDraftForEditor
in interface DraftService
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 existpublic Draft findOrCreateDraftForEditor(String spaceKey, DraftService.DraftType type) throws NotAuthorizedException, NotValidException
DraftService
findOrCreateDraftForEditor
in interface DraftService
NotAuthorizedException
- if the current user is not permitted to view or create drafts in the space
NotValidException
- if the space identified does not exist.public void removeDraft(long contentId, DraftService.DraftType type, String spaceKey) throws NotAuthorizedException, NotValidException
DraftService
removeDraft
in interface DraftService
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |