Interface CommentCollection<C extends Comment>

All Known Implementing Classes:
AbstractCommentCollection

@ConsumerType public interface CommentCollection<C extends Comment>
A CommentCollection represents a collection of Comments. Comments can be added to and removed from the collection. A collection is tied to a specific target (e.g. the page, asset or node that was commented on) - see getTarget().
  • Method Summary

    Modifier and Type
    Method
    Description
    addComment(String message, String author, String annotationData)
    Create a new comment and add it to the collection.
    Returns all comments of this collection.
    Returns the moment in time this collection was created.
    Returns the moment in time this collection was last modified.
    Returns the path of the resource representing this collection.
    Returns the Resource representing the target this comment collection belongs to.
    void
    Removes (deletes) this comment collection.
  • Method Details

    • addComment

      C addComment(String message, String author, String annotationData)
      Create a new comment and add it to the collection. The comment will be created with the given message, optional author user ID string and optional annotation data.
      Parameters:
      message - The message of the comment.
      author - The optional user ID to set as the author of the new comment. If none is provided, the session user is considered the author.
      annotationData - The optional annotation data. Annotation data may be used to store SVG data when commenting on an image that is annotated with such data.
      Returns:
      The comment just created.
      Throws:
      CommentException - Upon encountering an error during comment creation.
    • getCommentList

      List<C> getCommentList()
      Returns all comments of this collection.
      Returns:
      A List of comments of this collection, or an empty list if no comments are present.
    • getCreated

      Calendar getCreated()
      Returns the moment in time this collection was created.
      Returns:
      The calendar representing the creation date/time.
    • getLastModified

      Calendar getLastModified()
      Returns the moment in time this collection was last modified.
      Returns:
      The calendar representing the last modification.
    • getPath

      String getPath()
      Returns the path of the resource representing this collection.
      Returns:
      A String representing the path.
    • getTarget

      Resource getTarget()
      Returns the Resource representing the target this comment collection belongs to.
      Returns:
      The resource.
    • remove

      void remove()
      Removes (deletes) this comment collection. After calling this method, the collection must be considered invalid/stale and must not be used anymore.
      Throws:
      CommentException - Upon encountering an error while removing.