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_SPAM, SOCO_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(String name)
Retrieve an attachment of this comment by its file name.
|
Map<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
|
Calendar |
getCreated()
The time stamp this comment was created.
|
String |
getCurrentUserFlagText() |
List<FlagReason> |
getFlagReasons() |
List<Object> |
getItems()
Returns a list of children of this collection.
|
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.
|
String |
getParent()
Gets the parent path for the comment.
|
SocialComponent |
getParentComponent()
Gets the immediate parent of this component.
|
String |
getParentId()
Get this comment parent id.
|
String |
getResourceType() |
SocialComponent |
getSourceComponent()
Gets the SocialComponent that created this piece of UGC.
|
String |
getSourceComponentId() |
List<Comment.Tag> |
getTags() |
int |
getTotalSize()
Get total size of the collection.
|
String |
getTranslationAttribution()
{@inheritDoc]
|
String |
getTranslationDescription() |
String |
getTranslationDisplay() |
String |
getTranslationTitle() |
boolean |
getUseFlagReasons() |
SocialComponent |
getVotes() |
boolean |
isApproved()
Checks whether this comment is approved (in case comments are moderated).
|
boolean |
isClosed() |
boolean |
isFlaggedByUser() |
boolean |
isTopLevel() |
boolean |
isUserModerator() |
boolean |
isVisible() |
void |
setPagination(CollectionPagination pagination)
Set the collection list range.
|
void |
setSortedOrder(CollectionSortedOrder sortedOrder)
Set the collection sorted order.
|
String |
toString() |
buildJSONString, getAsMap, getFriendlyUrl, getId, getProperties, getResource, getUrl, toJSONString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAsMap, getFriendlyUrl, getId, getProperties, 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 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(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 Map<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 Calendar getCreated()
getCreated
in interface Comment<T extends CommentCollectionConfiguration>
Calendar
representing creation time.public String getResourceType()
getResourceType
in interface SocialComponent
getResourceType
in class BaseSocialComponent
public String getMessage()
getMessage
in interface Comment<T extends CommentCollectionConfiguration>
String
representing the message.public String getParent()
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 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 List<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 String getParentId()
getParentId
in interface Comment<T extends CommentCollectionConfiguration>
public 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 List<FlagReason> getFlagReasons()
getFlagReasons
in interface Comment<T extends CommentCollectionConfiguration>
public 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 List<Comment.Tag> getTags()
getTags
in interface Comment<T extends CommentCollectionConfiguration>
public PageInfo getPageInfo()
getPageInfo
in interface Comment<T extends CommentCollectionConfiguration>
public String getTranslationDescription()
getTranslationDescription
in interface Comment<T extends CommentCollectionConfiguration>
public String getTranslationAttribution()
getTranslationAttribution
in interface Comment<T extends CommentCollectionConfiguration>
public String getTranslationTitle()
getTranslationTitle
in interface Comment<T extends CommentCollectionConfiguration>
public String getTranslationDisplay()
getTranslationDisplay
in interface Comment<T extends CommentCollectionConfiguration>
"Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"