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 Stringstatic final StringThe content ID of a new piece of content, as a String.static final StringFields 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_SOURCEFields inherited from class com.atlassian.confluence.core.AbstractVersionedEntityObject
INITIAL_VERSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns theContentIdfor this Draft.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 theAbstractPagewhich this is a draft of, as a String.intgetType()An easy name for the type of this content: makes it easy for things like the #contentLink macro to work out what to draw.inthashCode()booleanisAuthor(com.atlassian.user.User user) Deprecated.booleanisBlank()booleanisDraft()booleanContent entity objects that are historical versions should not be indexed.booleanReturns true if the draft is for a new piece of content, otherwise false.booleanvoidsetDraftSpaceKey(String draftSpaceKey) voidsetDraftType(String draftType) voidvoidvoidsetPageVersion(int pageVersion) booleansharedAccessAllowed(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, getAttachmentNamed, getAttachments, getAttachmentsUrlPath, getAttachmentUrlPath, getBodyAsString, getBodyContent, getBodyContent, getBodyContents, getCollaborativeEditingUuid, getComments, getContainerContent, getContentPermission, getContentPermissionSet, getContentStatus, getContentStatusObject, getCustomContent, getDefaultBodyType, getDisplayTitle, getEntity, getIdAsString, getLatestVersionId, 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, wasCreatedByMethods inherited from class com.atlassian.confluence.core.AbstractLabelableEntityObject
addLabelling, getGlobalLabels, getLabelCount, getLabellings, getLabels, getLabelsForDisplay, getPersonalLabels, getTeamLabels, getVisibleLabels, isFavourite, removeLabelling, setLabellingsMethods inherited from class com.atlassian.confluence.core.AbstractVersionedEntityObject
getConfluenceRevision, getLatestVersion, getVersion, getVersionChildPolicy, isLatestVersion, isNew, setVersionMethods inherited from class com.atlassian.confluence.core.ConfluenceEntityObject
getCreator, getCreatorName, getLastModifier, getLastModifierName, getRealClass, isPersistent, setCreator, setLastModifierMethods inherited from class com.atlassian.confluence.core.AnnotatedEntityObject
getCreationDate, getLastModificationDateMethods inherited from class com.atlassian.core.bean.EntityObject
getCurrentDate, getId, setClock, setCreationDate, setId, setLastModificationDateMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.atlassian.confluence.core.Addressable
getIdMethods inherited from interface com.atlassian.confluence.labels.EditableLabelable
getId, isPersistentMethods 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:
isDraftin classContentEntityObject
-
isUnpublished
public boolean isUnpublished()- Overrides:
isUnpublishedin classContentEntityObject
-
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:ContentEntityObjectContent entity objects that are historical versions should not be indexed.- Specified by:
isIndexablein interfaceSearchable- Overrides:
isIndexablein 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:
getUrlPathin interfaceAddressable- Specified by:
getUrlPathin classContentEntityObject
-
getNameForComparison
Description copied from class:ContentEntityObjectSubclasses 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:
getNameForComparisonin classContentEntityObject
-
getType
Description copied from class:ContentEntityObjectAn 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:
getTypein interfaceContentTypeAware- Specified by:
getTypein classContentEntityObject- Returns:
- the content type
-
getDraftSpaceKey
-
setDraftSpaceKey
-
setPageVersion
public void setPageVersion(int pageVersion) -
getPageVersion
public int getPageVersion() -
getPageId
Gets the id of theAbstractPagewhich 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 theContentIdfor this Draft.- Overrides:
getContentIdin classContentEntityObject- Returns:
- the ContentId representation of this Draft's id
-
toString
- Overrides:
toStringin classContentEntityObject
-
equals
- Overrides:
equalsin classContentEntityObject
-
hashCode
public int hashCode()- Overrides:
hashCodein classContentEntityObject
-
ContentEntityObject.wasCreatedBy(com.atlassian.user.User)