public abstract class AbstractComment<T extends CommentCollectionConfiguration> extends BaseSocialComponent implements Comment<T>
Comment.ModeratorActions, Comment.ModeratorStatus, Comment.Tag
COMMENT_RESOURCETYPE, COMMENTCOLLECTION_RESOURCETYPE, JSON_EXTENSION, NODE_TYPE, PROP_APPROVED, PROP_REFERER, PROP_SPAM, PROP_USE_REFERRER_URL, SOCO_SELECTOR
CSV_SELECTOR, DEFAULT_SELECTOR, INDEX_SELECTOR, QUERY_SELECTOR, TRANSLATE_SELECTOR
Constructor and Description |
---|
AbstractComment(Resource resource,
ClientUtilities clientUtils,
CommentSocialComponentListProviderManager commentListProviderManager)
Construct a comment for the specified resource and client utilities.
|
AbstractComment(Resource resource,
ClientUtilities clientUtils,
QueryRequestInfo queryInfo,
CommentSocialComponentListProviderManager commentListProviderManager)
Constructor of a comment.
|
Modifier and Type | Method and Description |
---|---|
Attachment |
getAttachment(java.lang.String name)
Retrieve an attachment of this comment by its file name.
|
java.util.Map<java.lang.String,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 |
getFriendlyUrl()
Get a url that can be used to display this component, most of the time, this is the page url that contains the
component.
|
java.util.List<java.lang.Object> |
getItems()
Returns a list of children of this collection.
|
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 |
getParent()
Gets the parent path for the comment.
|
SocialComponent |
getParentComponent()
Gets the immediate parent of this component.
|
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 |
getResourceType() |
SocialComponent |
getSourceComponent()
Gets the SocialComponent that created this piece of UGC.
|
java.lang.String |
getSourceComponentId() |
java.lang.String |
getState()
Retrieves the state of this comment.
|
java.util.List<Comment.Tag> |
getTags() |
int |
getTotalSize()
Get total size of the collection.
|
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() |
void |
setPagination(CollectionPagination pagination)
Set the collection list range.
|
void |
setSortedOrder(CollectionSortedOrder sortedOrder)
Set the collection sorted order.
|
void |
setSortFields(java.util.List<java.util.Map.Entry<java.lang.String,java.lang.Boolean>> sortFields) |
java.lang.String |
toString() |
buildJSONString, getAsMap, getId, getProperties, getProperty, getProperty, getResource, getUrl, toJSONString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAsMap, getId, getProperties, getProperty, getProperty, getResource, getUrl, toJSONString
public AbstractComment(Resource resource, ClientUtilities clientUtils, CommentSocialComponentListProviderManager commentListProviderManager) throws RepositoryException
resource
- the specified resourceclientUtils
- the client utilities instancecommentListProviderManager
- list manager to use for listing contentRepositoryException
- if an error occurspublic AbstractComment(Resource resource, ClientUtilities clientUtils, QueryRequestInfo queryInfo, CommentSocialComponentListProviderManager commentListProviderManager) throws RepositoryException
resource
- the specified com.adobe.cq.social.commons.Comment
clientUtils
- the client utilities instancequeryInfo
- the query info.commentListProviderManager
- list manager to use for listing contentRepositoryException
- if an error occurspublic T getConfiguration()
Comment
getConfiguration
in interface Comment<T extends CommentCollectionConfiguration>
public Attachment getAttachment(java.lang.String name)
getAttachment
in interface Comment<T extends CommentCollectionConfiguration>
name
- The file name of the attachment.ResourceID
representing the attachment, or null
if no attachment with the given
name exists.public User getAuthor()
getAuthor
in interface Comment<T extends CommentCollectionConfiguration>
public java.lang.String getState()
getState
in interface Comment<T extends CommentCollectionConfiguration>
String
representing the state.public java.util.Map<java.lang.String,Attachment> getAttachments()
getAttachments
in interface Comment<T extends CommentCollectionConfiguration>
Map
representing the available attachments, or an empty map if no attachments are present.public java.util.Calendar getCreated()
getCreated
in interface Comment<T extends CommentCollectionConfiguration>
Calendar
representing creation time.public java.lang.String getResourceType()
getResourceType
in interface SocialComponent
getResourceType
in class BaseSocialComponent
public java.lang.String getMessage()
getMessage
in interface Comment<T extends CommentCollectionConfiguration>
String
representing the message.public java.lang.String getParent()
public java.lang.String toString()
toString
in class java.lang.Object
public void setPagination(CollectionPagination pagination)
setPagination
in interface SocialCollectionComponent
pagination
- detail information to usepublic void setSortedOrder(CollectionSortedOrder sortedOrder)
setSortedOrder
in interface SocialCollectionComponent
sortedOrder
- the order definition of how the items should be sorted.public void setSortFields(java.util.List<java.util.Map.Entry<java.lang.String,java.lang.Boolean>> sortFields)
public boolean isTopLevel()
isTopLevel
in interface Comment<T extends CommentCollectionConfiguration>
public boolean isApproved()
isApproved
in interface Comment<T extends CommentCollectionConfiguration>
true
if comment is approved or unmoderated, false
otherwisepublic boolean getCanEdit()
getCanEdit
in interface Comment<T extends CommentCollectionConfiguration>
true
if the Edit action button should be displayedpublic boolean getCanReply()
getCanReply
in interface Comment<T extends CommentCollectionConfiguration>
public boolean getCanDelete()
getCanDelete
in interface Comment<T extends CommentCollectionConfiguration>
true
if the Delete action button should be displayedpublic int getTotalSize()
getTotalSize
in interface SocialCollectionComponent
public java.util.List<java.lang.Object> getItems()
getItems
in interface SocialCollectionComponent
List
of children of this collection, or an empty list if no children are present. If the
children is the first level child, then the child is embedded in the list, otherwise, the child url is
included in the list.public java.lang.String getParentId()
getParentId
in interface Comment<T extends CommentCollectionConfiguration>
public java.lang.String getSourceComponentId()
getSourceComponentId
in interface Comment<T extends CommentCollectionConfiguration>
public boolean getCanTranslate()
getCanTranslate
in interface Comment<T extends CommentCollectionConfiguration>
true
if the ugc language is detected and enabled and different than the page language.public boolean isUserModerator()
isUserModerator
in interface Comment<T extends CommentCollectionConfiguration>
public boolean isVisible()
isVisible
in interface Comment<T extends CommentCollectionConfiguration>
public boolean isClosed()
isClosed
in interface Comment<T extends CommentCollectionConfiguration>
public boolean isPinned()
isPinned
in interface Comment<T extends CommentCollectionConfiguration>
public boolean isFeatured()
isFeatured
in interface Comment<T extends CommentCollectionConfiguration>
public boolean isDraft()
isDraft
in interface Comment<T extends CommentCollectionConfiguration>
public boolean isScheduled()
isScheduled
in interface Comment<T extends CommentCollectionConfiguration>
public java.util.Calendar getPublishDate()
Comment
getPublishDate
in interface Comment<T extends CommentCollectionConfiguration>
null
if not found.public java.util.List<FlagReason> getFlagReasons()
getFlagReasons
in interface Comment<T extends CommentCollectionConfiguration>
public java.lang.String getCurrentUserFlagText()
getCurrentUserFlagText
in interface Comment<T extends CommentCollectionConfiguration>
public boolean getUseFlagReasons()
getUseFlagReasons
in interface Comment<T extends CommentCollectionConfiguration>
public boolean isFlaggedByUser()
isFlaggedByUser
in interface Comment<T extends CommentCollectionConfiguration>
public SocialComponent getVotes()
getVotes
in interface Comment<T extends CommentCollectionConfiguration>
public Comment.ModeratorActions getModeratorActions()
getModeratorActions
in interface Comment<T extends CommentCollectionConfiguration>
Comment.ModeratorActions
public Comment.ModeratorStatus getModeratorStatus()
getModeratorStatus
in interface Comment<T extends CommentCollectionConfiguration>
public SocialComponent getParentComponent()
getParentComponent
in interface SocialComponent
getParentComponent
in class BaseSocialComponent
public SocialComponent getSourceComponent()
getSourceComponent
in interface SocialComponent
getSourceComponent
in class BaseSocialComponent
public java.util.List<Comment.Tag> getTags()
getTags
in interface Comment<T extends CommentCollectionConfiguration>
public PageInfo getPageInfo()
getPageInfo
in interface Comment<T extends CommentCollectionConfiguration>
public java.lang.String getTranslationDescription()
getTranslationDescription
in interface Comment<T extends CommentCollectionConfiguration>
public java.lang.String getTranslationAttribution()
getTranslationAttribution
in interface Comment<T extends CommentCollectionConfiguration>
public java.lang.String getTranslationTitle()
getTranslationTitle
in interface Comment<T extends CommentCollectionConfiguration>
public java.lang.String getTranslationDisplay()
getTranslationDisplay
in interface Comment<T extends CommentCollectionConfiguration>
public java.lang.String getFriendlyUrl()
SocialComponent
getFriendlyUrl
in interface SocialComponent
getFriendlyUrl
in class BaseSocialComponent
public java.lang.String getReferrerUrl()
getReferrerUrl
in interface Comment<T extends CommentCollectionConfiguration>
Comment.PROP_USE_REFERRER_URL
configuration is set to true."Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"