Package com.atlassian.confluence.pages
Class Draft
java.lang.Object
com.atlassian.core.bean.EntityObject
- All Implemented Interfaces:
Searchable
,Content
,Addressable
,ContentTypeAware
,Versioned
,RelatableEntity
,EditableLabelable
,Labelable
,Serializable
,Cloneable
,Comparable<ContentEntityObject>
This is the old way of dealing with drafts in Confluence and will be deprecated soon.
See ContentEntityObject.DRAFT
to see how new drafts are defined.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
The content ID of a new piece of content, as a String.static final String
Fields inherited from class com.atlassian.confluence.core.ContentEntityObject
COLLABORATIVE_EDITING_UUID, CONFLUENCE_RECOVERY, CONFLUENCE_RECOVERY_WITH_EXTERNAL_CHANGE, CONTENT_RESTORED_SYNC_REV_SOURCE, CREATED, CURRENT, DELETED, DELETED_BY, DELETED_BY_ANON_VALUE, 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
Fields inherited from class com.atlassian.confluence.core.AbstractVersionedEntityObject
INITIAL_VERSION
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns theContentId
for this Draft.Deprecated.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.Gets the id of theAbstractPage
which this is a draft of, as a String.int
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.int
hashCode()
boolean
isAuthor
(com.atlassian.user.User user) Deprecated.boolean
isBlank()
boolean
isDraft()
boolean
Content entity objects that are historical versions should not be indexed.boolean
Returns true if the draft is for a new piece of content, otherwise false.boolean
void
setDraftSpaceKey
(String draftSpaceKey) void
setDraftType
(String draftType) void
void
void
setPageVersion
(int pageVersion) boolean
sharedAccessAllowed
(com.atlassian.user.User user) Deprecated, for removal: This API element is subject to removal in a future version.boolean
sharedAccessAllowed
(String shareId) Deprecated.since 5.10toString()
Methods inherited from class com.atlassian.confluence.core.ContentEntityObject
addAttachment, addComment, addCustomContent, addOutgoingLink, addPermission, applyChildVersioningPolicy, clone, compareTo, convertToHistoricalVersion, ensureAttachmentBelongsToContent, getAttachmentManager, getAttachmentNamed, getAttachments, getAttachmentsUrlPath, getAttachmentUrlPath, getBodyAsString, getBodyAsStringWithoutMarkup, getBodyContent, getBodyContent, getBodyContents, getCollaborativeEditingUuid, getComments, getContainerContent, getContentPermission, getContentPermissionSet, getContentStatus, getContentStatusObject, getCustomContent, getDefaultBodyType, getDisplayTitle, getEntity, getExcerpt, getIdAsString, getLatestVersionId, getLatestVersionsOfAttachments, getLowerTitle, getOriginalVersionId, getOutgoingLinks, getPermissions, getProperties, getRenderedVersionComment, getSelector, getSynchronyRevision, getSynchronyRevisionSource, getTitle, getTrashDate, getTypeEnum, getVersionComment, hasContentPermissions, hasPermissions, isCurrent, isDeleted, isVersionCommentAvailable, removeAttachment, removeComment, removeContentPermissionSet, removeCustomContent, removeOutgoingLink, replaceContentProperties, restore, restoreDependents, setAttachments, setBodyAsString, setBodyContent, setBodyContents, setCollaborativeEditingUuid, setComments, setContainerContent, setContentPropertiesFrom, setContentStatus, setOriginalVersion, setOriginalVersionId, setOutgoingLinks, setShareId, setSynchronyRevision, setSynchronyRevisionSource, setTitle, setVersionComment, toPageContext, trash, trash, trash, wasCreatedBy
Methods inherited from class com.atlassian.confluence.core.AbstractLabelableEntityObject
addLabelling, getGlobalLabels, getLabelCount, getLabellings, getLabels, getLabelsForDisplay, getPersonalLabels, getTeamLabels, getVisibleLabels, isFavourite, removeLabelling, setLabellings
Methods inherited from class com.atlassian.confluence.core.AbstractVersionedEntityObject
getConfluenceRevision, getLatestVersion, getVersion, getVersionChildPolicy, isLatestVersion, isNew, setVersion
Methods inherited from class com.atlassian.confluence.core.ConfluenceEntityObject
getCreator, getCreatorName, getLastModifier, getLastModifierName, getRealClass, isPersistent, setCreator, setCreatorName, setLastModifier, setLastModifierName
Methods inherited from class com.atlassian.confluence.core.AnnotatedEntityObject
getCreationDate, getLastModificationDate
Methods inherited from class com.atlassian.core.bean.EntityObject
getCurrentDate, getId, setClock, setCreationDate, setId, setLastModificationDate
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.atlassian.confluence.core.Addressable
getId
Methods inherited from interface com.atlassian.confluence.labels.EditableLabelable
getId, isPersistent
Methods inherited from interface com.atlassian.bonnie.Searchable
getId, getSearchableDependants
-
Field Details
-
LEGACY_DRAFT_PARENT_ID_KEY
The content ID of a new piece of content, as a String.- See Also:
-
NEW
-
CONTENT_TYPE
- See Also:
-
-
Constructor Details
-
Draft
public Draft()
-
-
Method Details
-
isDraft
public boolean isDraft()- Overrides:
isDraft
in classContentEntityObject
-
isUnpublished
public boolean isUnpublished()- Overrides:
isUnpublished
in classContentEntityObject
-
getContentSummary
Deprecated.since 5.9 UseContentEntityObject.getExcerpt()
-
isAuthor
Deprecated. -
isNewPage
public boolean isNewPage()Returns true if the draft is for a new piece of content, otherwise false. -
isIndexable
public boolean isIndexable()Description copied from class:ContentEntityObject
Content entity objects that are historical versions should not be indexed.- Specified by:
isIndexable
in interfaceSearchable
- Overrides:
isIndexable
in classContentEntityObject
-
isBlank
public boolean isBlank()- Returns:
- true if this draft has a an empty title and content that is null or empty string
-
getUrlPath
- Specified by:
getUrlPath
in interfaceAddressable
- Specified by:
getUrlPath
in classContentEntityObject
-
getNameForComparison
Description copied from class:ContentEntityObject
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.- Specified by:
getNameForComparison
in classContentEntityObject
-
getType
Description copied from class:ContentEntityObject
An easy name for the type of this content: makes it easy for things like the #contentLink macro to work out what to draw.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.
- Specified by:
getType
in interfaceContentTypeAware
- Specified by:
getType
in classContentEntityObject
- Returns:
- the content type
-
getDraftSpaceKey
-
setDraftSpaceKey
-
setPageVersion
public void setPageVersion(int pageVersion) -
getPageVersion
public int getPageVersion() -
getPageId
Gets the id of theAbstractPage
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. -
getPageIdAsLong
-
setPageId
-
setPageId
-
getDraftType
-
setDraftType
-
getContentId
Returns theContentId
for this Draft.- Overrides:
getContentId
in classContentEntityObject
- Returns:
- the ContentId representation of this Draft's id
-
toString
- Overrides:
toString
in classContentEntityObject
-
equals
- Overrides:
equals
in classContentEntityObject
-
hashCode
public int hashCode()- Overrides:
hashCode
in classContentEntityObject
-
ContentEntityObject.getExcerpt()