public class Draft extends ContentEntityObject
See ContentEntityObject.DRAFT to see how new drafts are defined.
| Modifier and Type | Field and Description |
|---|---|
static String |
CONTENT_TYPE |
static String |
LEGACY_DRAFT_PARENT_ID_KEY
The content ID of a new piece of content, as a String.
|
static String |
NEW |
COLLABORATIVE_EDITING_UUID, CONFLUENCE_RECOVERY, CONFLUENCE_RECOVERY_WITH_EXTERNAL_CHANGE, CONTENT_RESTORED_SYNC_REV_SOURCE, CREATED, CURRENT, DELETED, DRAFT, DUMMY_SYNC_REV, LIMITED_MODE_SYNC_REV_SOURCE, MODIFIED, SHARE_ID, SYNC_REV, SYNC_REV_SOURCE, SYNCHRONY_ACK_SYNC_REV_SOURCE, SYNCHRONY_RECOVERY, SYNCHRONY_RECOVERY_WITH_EXTERNAL_CHANGE, SYNCHRONY_SYNC_REV_SOURCEINITIAL_VERSION| Constructor and Description |
|---|
Draft() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
ContentId |
getContentId()
Returns the
ContentId for this Draft. |
String |
getContentSummary()
Deprecated.
since 5.9 Use
ContentEntityObject.getExcerpt() |
String |
getDraftSpaceKey() |
String |
getDraftType() |
String |
getNameForComparison()
Subclasses should implement this method, giving a String back so
that the content can be alphabetically sorted in a mixed-type list
of content-entities.
|
String |
getPageId()
Gets the id of the
AbstractPage which this is a draft of, as a String. |
Long |
getPageIdAsLong() |
int |
getPageVersion() |
String |
getShareId() |
String |
getType()
An easy name for the type of this content: makes it easy for
things like the #contentLink macro to work out what to draw.
|
String |
getUrlPath() |
int |
hashCode() |
boolean |
isAuthor(com.atlassian.user.User user)
Deprecated.
|
boolean |
isBlank() |
boolean |
isDraft() |
boolean |
isIndexable()
Content entity objects that are historical versions should not be indexed.
|
boolean |
isNewPage()
Returns true if the draft is for a new piece of content, otherwise false.
|
boolean |
isUnpublished() |
void |
setDraftSpaceKey(String draftSpaceKey) |
void |
setDraftType(String draftType) |
void |
setPageId(Long pageId) |
void |
setPageId(String pageId) |
void |
setPageVersion(int pageVersion) |
boolean |
sharedAccessAllowed(String shareId)
Deprecated.
since 5.10
|
boolean |
sharedAccessAllowed(com.atlassian.user.User user)
Checks if this draft can be accessed by users other than the creator (shared access)
|
String |
toString() |
addAttachment, addComment, addCustomContent, addOutgoingLink, addPermission, addReferralLink, addTrackbackLink, applyChildVersioningPolicy, applyChildVersioningPolicy, clone, compareTo, convertToHistoricalVersion, ensureAttachmentBelongsToContent, getAttachmentManager, getAttachmentNamed, getAttachments, getAttachmentsUrlPath, getAttachmentUrlPath, getBodyAsString, getBodyAsStringWithoutMarkup, getBodyContent, getBodyContent, getBodyContents, getCollaborativeEditingUuid, getComments, getContainerContent, getContentPermission, getContentPermissionSet, getContentStatus, getContentStatusObject, getDefaultBodyType, getDisplayTitle, getEntity, getExcerpt, getIdAsString, getLatestVersionId, getLatestVersionsOfAttachments, getLowerTitle, getOriginalVersionId, getOutgoingLinks, getPermissions, getProperties, getReferralLinks, getRenderedVersionComment, getSearchableDependants, getSelector, getSynchronyRevision, getSynchronyRevisionSource, getTitle, getTrackbackLinks, getTrashDate, getTypeEnum, getVersionComment, hasContentPermissions, hasPermissions, isCurrent, isDeleted, isVersionCommentAvailable, removeAttachment, removeComment, removeContentPermissionSet, removeCustomContent, removeOutgoingLink, removeReferralLink, removeTrackbackLink, replaceContentProperties, restore, restoreDependents, setAttachments, setBodyAsString, setBodyContent, setBodyContents, setCollaborativeEditingUuid, setComments, setContainerContent, setContentPropertiesFrom, setContentStatus, setOriginalVersion, setOriginalVersionId, setOutgoingLinks, setReferralLinks, setShareId, setSynchronyRevision, setSynchronyRevisionSource, setTitle, setTrackbackLinks, setVersionComment, toPageContext, trash, trash, trashDependents, wasCreatedByaddLabelling, getGlobalLabels, getLabelCount, getLabellings, getLabels, getLabelsForDisplay, getPersonalLabels, getTeamLabels, getVisibleLabels, isFavourite, removeLabelling, setLabellingsgetConfluenceRevision, getLatestVersion, getVersion, getVersionChildPolicy, isLatestVersion, isNew, setVersiongetCreator, getCreatorName, getLastModifier, getLastModifierName, getRealClass, isPersistent, setCreator, setCreatorName, setLastModifier, setLastModifierNamegetCreationDate, getCurrentDate, getId, getLastModificationDate, setClock, setCreationDate, setId, setLastModificationDatefinalize, getClass, notify, notifyAll, wait, wait, waitgetIdgetId, isPersistentpublic static final String LEGACY_DRAFT_PARENT_ID_KEY
public static final String NEW
public static final String CONTENT_TYPE
public boolean isDraft()
isDraft in class ContentEntityObject@Deprecated public boolean sharedAccessAllowed(String shareId)
IMPORTANT NOTE: if shared access is disallowed it prevails over permissions (only creator has access), BUT if it is allowed normal permissions still need to be checked
All legacy drafts are private
sharedAccessAllowed in class ContentEntityObjectshareId - Used to check for access if neededTODO: delete this method after 6.0public boolean sharedAccessAllowed(com.atlassian.user.User user)
All legacy drafts are private
sharedAccessAllowed in class ContentEntityObjectuser - User to check access forContentEntityObject.sharedAccessAllowed(User)public String getShareId()
getShareId in class ContentEntityObjectContentEntityObject.SHARE_IDpublic boolean isUnpublished()
isUnpublished in class ContentEntityObject@Deprecated public String getContentSummary()
ContentEntityObject.getExcerpt()@Deprecated public boolean isAuthor(com.atlassian.user.User user)
ContentEntityObject.wasCreatedBy(com.atlassian.user.User)public boolean isNewPage()
public boolean isIndexable()
ContentEntityObjectisIndexable in interface com.atlassian.bonnie.SearchableisIndexable in class ContentEntityObjectpublic boolean isBlank()
public String getUrlPath()
getUrlPath in interface AddressablegetUrlPath in class ContentEntityObjectpublic String getNameForComparison()
ContentEntityObjectgetNameForComparison in class ContentEntityObjectpublic String getType()
ContentEntityObjectThis is a bit of a hack, but it saves heaps of code elsewhere, especially since we tend to get back these objects wrapped in all sorts of Hibernate CGLIB stuff.
getType in interface ContentTypeAwaregetType in class ContentEntityObjectpublic String getDraftSpaceKey()
public void setDraftSpaceKey(String draftSpaceKey)
public void setPageVersion(int pageVersion)
public int getPageVersion()
public String getPageId()
AbstractPage which this is a draft of, as a String. Note that it's currently stored
as a String in the database, but the String always represents the id of a page, which is always representable as
a long.public Long getPageIdAsLong()
public void setPageId(String pageId)
public void setPageId(Long pageId)
public String getDraftType()
public void setDraftType(String draftType)
public ContentId getContentId()
ContentId for this Draft.getContentId in class ContentEntityObjectpublic String toString()
toString in class ContentEntityObjectpublic boolean equals(Object o)
equals in class ContentEntityObjectpublic int hashCode()
hashCode in class ContentEntityObjectCopyright © 2003–2022 Atlassian. All rights reserved.