Package com.atlassian.confluence.pages
Class Comment
java.lang.Object
com.atlassian.core.bean.EntityObject
- All Implemented Interfaces:
- Searchable,- Content,- Addressable,- ContentTypeAware,- HasLinkWikiMarkup,- Versioned,- RelatableEntity,- EditableLabelable,- Labelable,- Contained<ContentEntityObject>,- ContentConvertible,- Spaced,- Serializable,- Cloneable,- Comparable<ContentEntityObject>
public class Comment
extends ContentEntityObject
implements HasLinkWikiMarkup, Spaced, ContentConvertible, Contained<ContentEntityObject>
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringThe comment will be found in the page footer (i.e.static final StringThe comment will be found in the page content (aka.static final StringContentPropertykey for the property that indicates whether or not the comment is an inline comment.static final StringContentPropertykey for the reference to the selection's markers in storage formatstatic final StringContentPropertykey for original selection text of the inline commentFields inherited from class com.atlassian.confluence.core.ContentEntityObjectCOLLABORATIVE_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.AbstractVersionedEntityObjectINITIAL_VERSION
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidclone()voidRemove all data from the object that does not need to be saved by historical versions.boolean@Nullable ContentEntityObjectReturns theContentIdfor this Comment.intgetDepth()intReturns the display title.Since the ContentEntityObject falls back on ordering by creation date, comments should always end up being sorted in their order of posting, below the page they were created in.getSpace()Deprecated.Get the status of commentgetType()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()booleanvoidremoveChild(Comment child) voidreparentChildren(Comment newParent) voidsetChildren(List<Comment> children) voidsetContainer(ContentEntityObject container) voidsetInlineComment(boolean isInlineComment) Set if the comment is inlinevoidvoidsetStatus(CommentStatus status) Set status for commentbooleanMethods inherited from class com.atlassian.confluence.core.ContentEntityObjectaddAttachment, addComment, addCustomContent, addOutgoingLink, addPermission, applyChildVersioningPolicy, compareTo, ensureAttachmentBelongsToContent, getAttachmentNamed, getAttachments, getAttachmentsUrlPath, getAttachmentUrlPath, getBodyAsString, getBodyContent, getBodyContent, getBodyContents, getCollaborativeEditingUuid, getComments, getContainerContent, getContentPermission, getContentPermissionSet, getContentStatus, getContentStatusObject, getCustomContent, getDefaultBodyType, getEntity, getIdAsString, getLatestVersionId, getLowerTitle, getOriginalVersionId, getOutgoingLinks, getPermissions, getProperties, getRenderedVersionComment, getSelector, getShareId, getSynchronyRevision, getSynchronyRevisionSource, getTitle, getTrashDate, getTypeEnum, getVersionComment, hasContentPermissions, hasPermissions, isCurrent, isDeleted, isDraft, isIndexable, isUnpublished, 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, sharedAccessAllowed, toPageContext, toString, trash, trash, trash, wasCreatedByMethods inherited from class com.atlassian.confluence.core.AbstractLabelableEntityObjectaddLabelling, getGlobalLabels, getLabelCount, getLabellings, getLabels, getLabelsForDisplay, getPersonalLabels, getTeamLabels, getVisibleLabels, isFavourite, removeLabelling, setLabellingsMethods inherited from class com.atlassian.confluence.core.AbstractVersionedEntityObjectgetConfluenceRevision, getLatestVersion, getVersion, getVersionChildPolicy, isLatestVersion, isNew, setVersionMethods inherited from class com.atlassian.confluence.core.ConfluenceEntityObjectgetCreator, getCreatorName, getLastModifier, getLastModifierName, getRealClass, isPersistent, setCreator, setLastModifierMethods inherited from class com.atlassian.confluence.core.AnnotatedEntityObjectgetCreationDate, getLastModificationDateMethods inherited from class com.atlassian.core.bean.EntityObjectgetCurrentDate, getId, setClock, setCreationDate, setId, setLastModificationDateMethods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.atlassian.confluence.core.AddressablegetIdMethods inherited from interface com.atlassian.confluence.pages.ContentConvertiblegetSelectorMethods inherited from interface com.atlassian.confluence.labels.EditableLabelablegetId, isPersistentMethods inherited from interface com.atlassian.bonnie.SearchablegetId, getSearchableDependants
- 
Field Details- 
CONTENT_TYPE- See Also:
 
- 
INLINE_PROPContentPropertykey for the property that indicates whether or not the comment is an inline comment.- Since:
- 5.7
- See Also:
 
- 
MARKER_REF_PROPContentPropertykey for the reference to the selection's markers in storage format- Since:
- 5.7
- See Also:
 
- 
ORIGINAL_SELECTION_PROPContentPropertykey for original selection text of the inline comment- Since:
- 5.7
- See Also:
 
- 
INLINEThe comment will be found in the page content (aka. inline) if the location query param contains this value- Since:
- 5.7
- See Also:
 
- 
FOOTERThe comment will be found in the page footer (i.e. page comment section) if the location query param contains this value- Since:
- 5.7
- See Also:
 
 
- 
- 
Constructor Details- 
Commentpublic Comment()
 
- 
- 
Method Details- 
getContentEntityObject
- 
getContainer- Specified by:
- getContainerin interface- Contained<ContentEntityObject>
- Returns:
- the owner of this content object. Can be null.
- Since:
- 5.6
 
- 
setContainer
- 
getSpace
- 
getDisplayTitleDescription copied from class:ContentEntityObjectReturns the display title. Some entities don't have titles for identification. For example, personal information objects use the user's fullname. Override this method to provide a custom title.- Specified by:
- getDisplayTitlein interface- Addressable
- Overrides:
- getDisplayTitlein class- ContentEntityObject
- Returns:
- the display title
 
- 
getUrlPath- Specified by:
- getUrlPathin interface- Addressable
- Specified by:
- getUrlPathin class- ContentEntityObject
 
- 
getTypeDescription 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 interface- ContentTypeAware
- Specified by:
- getTypein class- ContentEntityObject
- Returns:
- the content type
 
- 
getNameForComparisonSince the ContentEntityObject falls back on ordering by creation date, comments should always end up being sorted in their order of posting, below the page they were created in. Nifty, eh.- Specified by:
- getNameForComparisonin class- ContentEntityObject
 
- 
getSpaceKeyDeprecated.convenience method for lucene to retrieve the key of the space this comment belongs to- Returns:
- the space key
 
- 
getParent
- 
setParent
- 
getChildren
- 
setChildren
- 
addChild
- 
getDescendantsCountpublic int getDescendantsCount()
- 
getDescendantAuthors
- 
getDepthpublic int getDepth()
- 
getThreadChangedDate
- 
reparentChildren
- 
convertToHistoricalVersionpublic void convertToHistoricalVersion()Description copied from interface:VersionedRemove all data from the object that does not need to be saved by historical versions. For versioned objects that are persisted, this includes removing associations with other persisted objects that may otherwise cause us to break the expected arity of the database relations.When using Hibernate to persist versioned objects, take special care to null any field that might contain a Hibernate-persisted collection, as Hibernate does not allow two different persistent objects to refer to the same persisted collection at the same time. - Specified by:
- convertToHistoricalVersionin interface- Versioned
- Overrides:
- convertToHistoricalVersionin class- ContentEntityObject
 
- 
removeChild
- 
clone- Overrides:
- clonein class- ContentEntityObject
 
- 
getLinkWikiMarkup- Specified by:
- getLinkWikiMarkupin interface- HasLinkWikiMarkup
- Returns:
- the wiki markup used to link to this content
 
- 
getContentTypeObject- Specified by:
- getContentTypeObjectin interface- ContentConvertible
- Returns:
- the api ContentType that this ContentConvertible converts to
 
- 
getContentIdReturns theContentIdfor this Comment.- Specified by:
- getContentIdin interface- ContentConvertible
- Overrides:
- getContentIdin class- ContentEntityObject
- Returns:
- the ContentId representation of this comment's id
 
- 
shouldConvertToContentpublic boolean shouldConvertToContent()- Specified by:
- shouldConvertToContentin interface- ContentConvertible
- Returns:
- true if the implementer wants to be part of the core API (default value), false otherwise
 
- 
isInlineCommentpublic boolean isInlineComment()- Returns:
- true if the comment is inline
- Since:
- 5.7
 
- 
setInlineCommentpublic void setInlineComment(boolean isInlineComment) Set if the comment is inline- Parameters:
- isInlineComment-
- Since:
- 5.7
 
- 
getStatusGet the status of comment- Returns:
- CommentStatus bean
- Since:
- 5.7
 
- 
setStatusSet status for comment- Parameters:
- status- CommentStatus
- Since:
- 5.7
 
- 
equals- Overrides:
- equalsin class- ContentEntityObject
 
- 
hashCodepublic int hashCode()- Overrides:
- hashCodein class- ContentEntityObject
 
 
-