com.atlassian.confluence.pages
Class Comment

java.lang.Object
  extended by com.atlassian.core.bean.EntityObject
      extended by com.atlassian.confluence.core.ConfluenceEntityObject
          extended by com.atlassian.confluence.core.AbstractVersionedEntityObject
              extended by com.atlassian.confluence.core.AbstractLabelableEntityObject
                  extended by com.atlassian.confluence.core.ContentEntityObject
                      extended by com.atlassian.confluence.pages.Comment
All Implemented Interfaces:
com.atlassian.bonnie.Searchable, Content, Addressable, ContentTypeAware, HasLinkWikiMarkup, Versioned, EditableLabelable, Labelable, Spaced, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable

public class Comment
extends ContentEntityObject
implements HasLinkWikiMarkup, Spaced

See Also:
Serialized Form

Field Summary
static java.lang.String CONTENT_TYPE
           
 
Fields inherited from class com.atlassian.confluence.core.ContentEntityObject
CREATED, CURRENT, DELETED, MODIFIED
 
Fields inherited from class com.atlassian.confluence.core.AbstractVersionedEntityObject
INITIAL_VERSION
 
Constructor Summary
Comment()
           
 
Method Summary
 void addChild(Comment child)
           
 java.lang.Object clone()
           
 void convertToHistoricalVersion()
          Remove all data from the object that does not need to be saved by historical versions.
 java.util.List<Comment> getChildren()
           
 ContentEntityObject getContentEntityObject()
           
 int getDepth()
           
 java.util.Set<java.lang.String> getDescendantAuthors()
           
 int getDescendantsCount()
           
 java.lang.String getDisplayTitle()
          Returns the display title.
 java.lang.String getLinkWikiMarkup()
           
 java.lang.String getNameForComparison()
          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.
 ContentEntityObject getOwner()
           
 AbstractPage getPage()
          Deprecated. since 4.0. Please use getOwner() instead.
 Comment getParent()
           
 Space getSpace()
           
 java.lang.String getSpaceKey()
          Deprecated. 
 java.util.Date getThreadChangedDate()
           
 java.lang.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.
 java.lang.String getUrlPath()
           
 void removeChild(Comment child)
           
 void reparentChildren(Comment newParent)
           
 void setChildren(java.util.List<Comment> children)
           
 void setOwner(ContentEntityObject owner)
           
 void setPage(AbstractPage page)
          Deprecated. Since 3.3 Use setOwner(com.atlassian.confluence.core.ContentEntityObject)
 void setParent(Comment parent)
           
 
Methods inherited from class com.atlassian.confluence.core.ContentEntityObject
addAttachment, addComment, addOutgoingLink, addPermission, addReferralLink, addTrackbackLink, compareTo, ensureAttachmentBelongsToContent, equals, getAttachmentNamed, getAttachments, getAttachmentsUrlPath, getAttachmentUrlPath, getBodyAsString, getBodyAsStringWithoutMarkup, getBodyContent, getBodyContent, getBodyContents, getComments, getContentPermission, getContentPermissionSet, getContentStatus, getDefaultBodyType, getEntity, getExcerpt, getIdAsString, getLatestVersionsOfAttachments, getOutgoingLinks, getPermissions, getReferralLinks, getRenderedVersionComment, getSearchableDependants, getTitle, getTrackbackLinks, getTypeEnum, getUserAccessor, getVersionComment, hasContentPermissions, hashCode, hasPermissions, isCurrent, isDeleted, isIndexable, isRecentlyUpdatedFor, isVersionCommentAvailable, removeAttachment, removeComment, removeContentPermissionSet, removeOutgoingLink, removeReferralLink, removeTrackbackLink, setAttachments, setBodyAsString, setBodyContent, setBodyContents, setComments, setContent, setContentStatus, setOutgoingLinks, setReferralLinks, setTitle, setTrackbackLinks, setUserAccessor, setVersionComment, toPageContext, toString, trash
 
Methods inherited from class com.atlassian.confluence.core.AbstractLabelableEntityObject
addLabelling, getGlobalLabels, getLabelCount, getLabellings, getLabels, getLabelsForDisplay, getLabelUtil, getPersonalLabels, getTeamLabels, getVisibleLabels, isFavourite, isFavourite, removeLabelling, setLabellings
 
Methods inherited from class com.atlassian.confluence.core.AbstractVersionedEntityObject
getLatestVersion, getOriginalVersion, getVersion, isLatestVersion, isNew, setOriginalVersion, 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.core.bean.EntityObject
getCreationDate, getCurrentDate, getId, getLastModificationDate, setClock, setCreationDate, setId, setLastModificationDate
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.atlassian.bonnie.Searchable
getId
 
Methods inherited from interface com.atlassian.confluence.core.Addressable
getId
 
Methods inherited from interface com.atlassian.confluence.labels.EditableLabelable
getId, isPersistent
 

Field Detail

CONTENT_TYPE

public static final java.lang.String CONTENT_TYPE
See Also:
Constant Field Values
Constructor Detail

Comment

public Comment()
Method Detail

getContentEntityObject

public ContentEntityObject getContentEntityObject()

getOwner

public ContentEntityObject getOwner()

setOwner

public void setOwner(ContentEntityObject owner)

getPage

@Deprecated
public AbstractPage getPage()
Deprecated. since 4.0. Please use getOwner() instead.

Please use getOwner() instead.


setPage

@Deprecated
public void setPage(AbstractPage page)
Deprecated. Since 3.3 Use setOwner(com.atlassian.confluence.core.ContentEntityObject)


getSpace

public Space getSpace()
Specified by:
getSpace in interface Spaced

getDisplayTitle

public java.lang.String getDisplayTitle()
Description copied from class: ContentEntityObject
Returns 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:
getDisplayTitle in interface Addressable
Overrides:
getDisplayTitle in class ContentEntityObject
Returns:
the display title

getUrlPath

public java.lang.String getUrlPath()
Specified by:
getUrlPath in interface Addressable
Specified by:
getUrlPath in class ContentEntityObject

getType

public java.lang.String 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 interface ContentTypeAware
Specified by:
getType in class ContentEntityObject
Returns:
the content type

getNameForComparison

public java.lang.String getNameForComparison()
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. Nifty, eh.

Specified by:
getNameForComparison in class ContentEntityObject

getSpaceKey

@Deprecated
public java.lang.String getSpaceKey()
Deprecated. 

convenience method for lucene to retrieve the key of the space this comment belongs to

Returns:
the space key

getParent

public Comment getParent()

setParent

public void setParent(Comment parent)

getChildren

public java.util.List<Comment> getChildren()

setChildren

public void setChildren(java.util.List<Comment> children)

addChild

public void addChild(Comment child)

getDescendantsCount

public int getDescendantsCount()

getDescendantAuthors

public java.util.Set<java.lang.String> getDescendantAuthors()

getDepth

public int getDepth()

getThreadChangedDate

public java.util.Date getThreadChangedDate()

reparentChildren

public void reparentChildren(Comment newParent)

convertToHistoricalVersion

public void convertToHistoricalVersion()
Description copied from interface: Versioned
Remove 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:
convertToHistoricalVersion in interface Versioned
Overrides:
convertToHistoricalVersion in class ContentEntityObject

removeChild

public void removeChild(Comment child)

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class ContentEntityObject
Throws:
java.lang.CloneNotSupportedException

getLinkWikiMarkup

public java.lang.String getLinkWikiMarkup()
Specified by:
getLinkWikiMarkup in interface HasLinkWikiMarkup
Returns:
the wiki markup used to link to this content


Copyright © 2003-2013 Atlassian. All Rights Reserved.