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_SOURCE
INITIAL_VERSION
Constructor and Description |
---|
Draft() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
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, getAttachmentNamed, getAttachments, getAttachmentsUrlPath, getAttachmentUrlPath, getBodyAsString, getBodyAsStringWithoutMarkup, getBodyContent, getBodyContent, getBodyContents, getCollaborativeEditingUuid, getComments, getContainerContent, getContentId, getContentPermission, getContentPermissionSet, getContentStatus, getContentStatusObject, getDefaultBodyType, getDisplayTitle, getEntity, getExcerpt, getIdAsString, getLatestVersionId, getLatestVersionsOfAttachments, getLowerTitle, getOriginalVersionId, getOutgoingLinks, getPermissions, getProperties, getReferralLinks, getRenderedVersionComment, getSearchableDependants, getSelector, getSynchronyRevision, getSynchronyRevisionSource, getTitle, getTrackbackLinks, 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, trashDependents, wasCreatedBy
addLabelling, getGlobalLabels, getLabelCount, getLabellings, getLabels, getLabelsForDisplay, getPersonalLabels, getTeamLabels, getVisibleLabels, isFavourite, removeLabelling, setLabellings
getConfluenceRevision, getLatestVersion, getVersion, getVersionChildPolicy, isLatestVersion, isNew, setVersion
getCreator, getCreatorName, getLastModifier, getLastModifierName, getRealClass, isPersistent, setCreator, setCreatorName, setLastModifier, setLastModifierName
getCreationDate, getCurrentDate, getId, getLastModificationDate, setClock, setCreationDate, setId, setLastModificationDate
finalize, getClass, notify, notifyAll, wait, wait, wait
getId
getId, isPersistent
public 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 ContentEntityObject
shareId
- Used to check for access if neededTODO: delete this method after 6.0
public boolean sharedAccessAllowed(com.atlassian.user.User user)
All legacy drafts are private
sharedAccessAllowed
in class ContentEntityObject
user
- User to check access forContentEntityObject.sharedAccessAllowed(User)
public String getShareId()
getShareId
in class ContentEntityObject
ContentEntityObject.SHARE_ID
public 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()
ContentEntityObject
isIndexable
in interface com.atlassian.bonnie.Searchable
isIndexable
in class ContentEntityObject
public boolean isBlank()
public String getUrlPath()
getUrlPath
in interface Addressable
getUrlPath
in class ContentEntityObject
public String getNameForComparison()
ContentEntityObject
getNameForComparison
in class ContentEntityObject
public String getType()
ContentEntityObject
This 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 ContentTypeAware
getType
in class ContentEntityObject
public 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 String toString()
toString
in class ContentEntityObject
public boolean equals(Object o)
equals
in class ContentEntityObject
public int hashCode()
hashCode
in class ContentEntityObject
Copyright © 2003–2020 Atlassian. All rights reserved.