Package com.adobe.granite.comments
Interface CommentCollection<C extends Comment>
-
- All Known Implementing Classes:
AbstractCommentCollection
@ConsumerType public interface CommentCollection<C extends Comment>
ACommentCollectionrepresents a collection ofComments. 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) - seegetTarget().
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CaddComment(java.lang.String message, java.lang.String author, java.lang.String annotationData)Create a new comment and add it to the collection.java.util.List<C>getCommentList()Returns all comments of this collection.java.util.CalendargetCreated()Returns the moment in time this collection was created.java.util.CalendargetLastModified()Returns the moment in time this collection was last modified.java.lang.StringgetPath()Returns the path of the resource representing this collection.ResourcegetTarget()Returns theResourcerepresenting the target this comment collection belongs to.voidremove()Removes (deletes) this comment collection.
-
-
-
Method Detail
-
addComment
C addComment(java.lang.String message, java.lang.String author, java.lang.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
java.util.List<C> getCommentList()
Returns all comments of this collection.- Returns:
- A
Listof comments of this collection, or an empty list if no comments are present.
-
getCreated
java.util.Calendar getCreated()
Returns the moment in time this collection was created.- Returns:
- The calendar representing the creation date/time.
-
getLastModified
java.util.Calendar getLastModified()
Returns the moment in time this collection was last modified.- Returns:
- The calendar representing the last modification.
-
getPath
java.lang.String getPath()
Returns the path of the resource representing this collection.- Returns:
- A
Stringrepresenting the path.
-
getTarget
Resource getTarget()
Returns theResourcerepresenting 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.
-
-