@Internal
public interface DraftsTransitionHelper
ContentEntityObject.DRAFT
,
Draft
Modifier and Type | Method and Description |
---|---|
ContentEntityObject |
createDraft(String contentType,
String spaceKey)
This method should attempt to create a draft based on whether or not the Shared Drafts Dark Feature is enabled
or disabled.
|
static Long |
getContentId(ContentEntityObject draft) |
static String |
getContentType(ContentEntityObject draft) |
ContentEntityObject |
getDraft(long draftId)
This method should attempt to retrieve a draft, and based on whether or not the Shared Draft dark feature is
enabled (determined by the isSharedDraftsFeatureEnabled method) or disabled should return a Shared Draft or
Legacy Draft respectively.
|
ContentEntityObject |
getDraftForPage(AbstractPage abstractPage)
This method should retrieve a draft from a given AbstractPage respecting the Shared Drafts feature state.
|
static String |
getSpaceKey(ContentEntityObject draft) |
static boolean |
isLegacyDraft(ContentEntityObject draft) |
boolean |
isSharedDraftsFeatureEnabled(String spaceKey)
This method is used to determine whether or not the Shared Drafts Dark Feature is enabled or disabled on
a per space basis, the method is provided a spaceKey and returns whether or not the feature is enabled.
|
ContentEntityObject getDraftForPage(AbstractPage abstractPage)
abstractPage
- the page we want the draft for (for legacy drafts, we get the current users per-page draft).ContentEntityObject createDraft(String contentType, String spaceKey)
contentType
- specifies the type of Draft, either "blogpost" or "page" as of 5.9.1.spaceKey
- is used to specify the key of the Space the draft will belong to.ContentEntityObject getDraft(long draftId)
There is no need to provide a spaceKey because the spaceKey of the draft (if found) will be used in the Shared Draft dark feature check
draftId
- specifies the ID of the draft to be retrieved.boolean isSharedDraftsFeatureEnabled(String spaceKey)
spaceKey
- is used to specify the key of the Space we want to check.static boolean isLegacyDraft(ContentEntityObject draft)
static String getSpaceKey(ContentEntityObject draft)
static String getContentType(ContentEntityObject draft)
static Long getContentId(ContentEntityObject draft)
Copyright © 2003–2016 Atlassian. All rights reserved.