Class Comment

    • Field Detail

      • INLINE

        public static final String INLINE
        The comment will be found in the page content (aka. inline) if the location query param contains this value
        Since:
        5.7
        See Also:
        Constant Field Values
      • FOOTER

        public static final String FOOTER
        The 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:
        Constant Field Values
    • Constructor Detail

      • Comment

        public Comment()
    • Method Detail

      • getDisplayTitle

        public 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
      • getType

        public 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 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 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)
      • setChildren

        public void setChildren​(List<Comment> children)
      • addChild

        public void addChild​(Comment child)
      • getDescendantsCount

        public int getDescendantsCount()
      • getDescendantAuthors

        public Set<String> getDescendantAuthors()
      • getDepth

        public int getDepth()
      • getThreadChangedDate

        public 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)
      • shouldConvertToContent

        public boolean shouldConvertToContent()
        Specified by:
        shouldConvertToContent in interface ContentConvertible
        Returns:
        true if the implementer wants to be part of the core API (default value), false otherwise
      • isInlineComment

        public boolean isInlineComment()
        Returns:
        true if the comment is inline
        Since:
        5.7
      • setInlineComment

        public void setInlineComment​(boolean isInlineComment)
        Set if the comment is inline
        Parameters:
        isInlineComment -
        Since:
        5.7
      • getStatus

        public CommentStatus getStatus()
        Get the status of comment
        Returns:
        CommentStatus bean
        Since:
        5.7
      • setStatus

        public void setStatus​(CommentStatus status)
        Set status for comment
        Parameters:
        status - CommentStatus
        Since:
        5.7