@ProviderType public interface Comment<T extends CommentCollectionConfiguration> extends SocialCollectionComponent
AComment
represents a comment created by a user (author) on a specific target (e.g. a page, asset or any node for that matter). The comments are contained within aCommentCollection
(seeResource.getParent()
. A comment simply provides a comment text or "message" (seegetMessage()
and access to various meta data, such as creation date, who created it, etc. Comments support attachments, i.e. files that are stored as part of a comment, e.g. a preview image if the comment is used to annotate an image. Comments can also support reply to a comment
Modifier and Type | Interface and Description |
---|---|
static interface |
Comment.ModeratorActions |
static interface |
Comment.ModeratorStatus |
static interface |
Comment.Tag |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COMMENT_RESOURCETYPE
The comment resourcetype.
|
static java.lang.String |
COMMENTCOLLECTION_RESOURCETYPE
The commentcollection resourcetype.
|
static java.lang.String |
JSON_EXTENSION
JSON extension.
|
static java.lang.String |
NODE_TYPE
The comment node type.
|
static java.lang.String |
PROP_APPROVED
The property name for the approval status.
|
static java.lang.String |
PROP_REFERER
Request paramter and header name for Referrer Url.
|
static java.lang.String |
PROP_SPAM
The property name for the spam flag.
|
static java.lang.String |
PROP_USE_REFERRER_URL
The property name for use referrer as the @link getFriendlyUrl() value.
|
static java.lang.String |
SOCO_SELECTOR
GET Selector.
|
CSV_SELECTOR, DEFAULT_SELECTOR, INDEX_SELECTOR, QUERY_SELECTOR, TRANSLATE_SELECTOR
Modifier and Type | Method and Description |
---|---|
com.adobe.cq.social.commons.Attachment |
getAttachment(java.lang.String name)
Retrieve an attachment of this comment by its file name.
|
java.util.Map<java.lang.String,com.adobe.cq.social.commons.Attachment> |
getAttachments()
Retrieves a map, an entry of which represents a file-name/attachment pair.
|
User |
getAuthor()
Returns the author's identifying name that represents the author of this comment.
|
boolean |
getCanDelete() |
boolean |
getCanEdit() |
boolean |
getCanReply() |
boolean |
getCanTranslate()
Check if the UGC language is the same as the Page language.
|
T |
getConfiguration()
Get the configuration for this comment.
|
java.util.Calendar |
getCreated()
The time stamp this comment was created.
|
java.lang.String |
getCurrentUserFlagText() |
java.util.List<FlagReason> |
getFlagReasons() |
java.lang.String |
getMessage()
Retrieves the message of this comment.
|
Comment.ModeratorActions |
getModeratorActions() |
Comment.ModeratorStatus |
getModeratorStatus()
This only available if the current user is a moderator.
|
PageInfo |
getPageInfo()
Gets information about the pages for this collection.
|
java.lang.String |
getParentId()
Get this comment parent id.
|
java.util.Calendar |
getPublishDate()
Returns the scheduled publish date.
|
java.lang.String |
getReferrerUrl() |
java.lang.String |
getSourceComponentId() |
java.lang.String |
getState()
Retrieves the state of this comment.
|
java.util.List<Comment.Tag> |
getTags() |
java.lang.String |
getTranslationAttribution() |
java.lang.String |
getTranslationDescription() |
java.lang.String |
getTranslationDisplay() |
java.lang.String |
getTranslationTitle() |
boolean |
getUseFlagReasons() |
SocialComponent |
getVotes() |
boolean |
isApproved()
Checks whether this comment is approved (in case comments are moderated).
|
boolean |
isClosed() |
boolean |
isDraft()
Checks if is draft.
|
boolean |
isFeatured() |
boolean |
isFlaggedByUser() |
boolean |
isPinned() |
boolean |
isScheduled()
Checks if comment is scheduled to be published later.
|
boolean |
isTopLevel() |
boolean |
isUserModerator() |
boolean |
isVisible() |
getItems, getTotalSize, setPagination, setSortedOrder
getAsMap, getFriendlyUrl, getId, getParentComponent, getProperties, getProperty, getProperty, getResource, getResourceType, getSourceComponent, getUrl, toJSONString
static final java.lang.String JSON_EXTENSION
static final java.lang.String SOCO_SELECTOR
static final java.lang.String COMMENT_RESOURCETYPE
static final java.lang.String COMMENTCOLLECTION_RESOURCETYPE
static final java.lang.String NODE_TYPE
static final java.lang.String PROP_APPROVED
static final java.lang.String PROP_SPAM
static final java.lang.String PROP_USE_REFERRER_URL
static final java.lang.String PROP_REFERER
com.adobe.cq.social.commons.Attachment getAttachment(java.lang.String name)
name
- The file name of the attachment.ResourceID
representing the attachment, or null
if no attachment with the given
name exists.User getAuthor()
java.util.Map<java.lang.String,com.adobe.cq.social.commons.Attachment> getAttachments()
Map
representing the available attachments, or an empty map if no attachments are present.java.util.Calendar getCreated()
Calendar
representing creation time.java.lang.String getMessage()
String
representing the message.java.lang.String getState()
String
representing the state.boolean isTopLevel()
boolean isApproved()
true
if comment is approved or unmoderated, false
otherwiseboolean getCanEdit()
true
if the Edit action button should be displayedboolean getCanDelete()
true
if the Delete action button should be displayedjava.lang.String getParentId()
boolean getCanTranslate()
true
if the ugc language is detected and enabled and different than the page language.boolean isUserModerator()
java.util.List<FlagReason> getFlagReasons()
boolean isVisible()
boolean isClosed()
boolean isPinned()
boolean isScheduled()
boolean isDraft()
java.util.Calendar getPublishDate()
null
if not found.boolean isFeatured()
java.util.List<Comment.Tag> getTags()
SocialComponent getVotes()
java.lang.String getCurrentUserFlagText()
boolean getCanReply()
Comment.ModeratorStatus getModeratorStatus()
Comment.ModeratorActions getModeratorActions()
Comment.ModeratorActions
T getConfiguration()
PageInfo getPageInfo()
boolean getUseFlagReasons()
boolean isFlaggedByUser()
java.lang.String getSourceComponentId()
java.lang.String getTranslationTitle()
java.lang.String getTranslationDescription()
java.lang.String getTranslationAttribution()
java.lang.String getTranslationDisplay()
java.lang.String getReferrerUrl()
PROP_USE_REFERRER_URL
configuration is set to true.Copyright © 2010 - 2020 Adobe. All Rights Reserved