public interface SocialServices<T extends SocialUgc>
Implementers Must
| Modifier and Type | Method and Description |
|---|---|
Map<? extends String,?> |
approveComment(UGC ugc,
org.craftercms.profile.api.Profile profile) |
long |
countAllFlaggedUgs(String context,
int start,
int pageSize,
List<org.apache.commons.collections4.keyvalue.DefaultKeyValue<String,Boolean>> sortOrder) |
long |
countByModerationStatus(ModerationStatus status,
String thread,
String contextId)
Counts all Comments with the given Moderation status.
|
Iterable<T> |
findAllFlaggedUgs(String context,
int start,
int pageSize,
List<org.apache.commons.collections4.keyvalue.DefaultKeyValue<String,Boolean>> sortOrder)
Returns all Flagged UGC
|
Iterable<T> |
findByModerationStatus(ModerationStatus status,
String thread,
String contextId,
int start,
int limit,
List<org.apache.commons.collections4.keyvalue.DefaultKeyValue<String,Boolean>> sort)
Finds all Comments with the given Moderation status.
|
T |
flag(String ugcId,
String contextId,
String reason,
String userId)
Flags the given UGC, with a given reason why.
|
T |
moderate(String ugcId,
ModerationStatus moderationStatus,
String userId,
String contextId)
Change the moderation Status of the given UGC.
|
boolean |
unFlag(String ugcId,
String flagId,
String userId,
String contextId)
Unflags the given UGC for the given reason.
|
T |
vote(String ugcId,
VoteOptions voteOptions,
String userId,
String contextId)
Executes the given UserContentInteraction for the given User Content Action.
|
T vote(String ugcId, VoteOptions voteOptions, String userId, String contextId) throws SocialException
Implementers must check if the current user is allowed to removeWatcher UGC and that the user belongs to the same ugc context
.ugcId - Id of the UGC.voteOptions - Interaction to be executed.userId - Id of the user that is interacting with the content.contextId - Context of the UGC.SocialException - if attribute can be deleted.IllegalArgumentException - If given UGC does not exist.T flag(String ugcId, String contextId, String reason, String userId) throws SocialException
Implementers must check if the current user is allowed to removeWatcher UGC and that the user belongs to the same ugc context
.ugcId - Id of the UGC to flag.reason - The reason for flagging this ugc.userId - Id of the user that is flagging this UGC.contextId - Context of the UGC.SocialExceptionboolean unFlag(String ugcId, String flagId, String userId, String contextId) throws SocialException
Implementers must check if the current user is allowed to removeWatcher UGC and that the user belongs to the same ugc context
.ugcId - Id of the UGC to unflag.flagId - Id of the flag to delete.userId - Id of the user that is unflagging this UGC.contextId - Context of the UGC.SocialExceptionT moderate(String ugcId, ModerationStatus moderationStatus, String userId, String contextId) throws SocialException
ugcId - Id of the UGC to change moderation status.moderationStatus - new Moderation Status.userId - Id of the user that is changing the status.contextId - Context of the UGC.SocialExceptionIterable<T> findByModerationStatus(ModerationStatus status, String thread, String contextId, int start, int limit, List<org.apache.commons.collections4.keyvalue.DefaultKeyValue<String,Boolean>> sort) throws UGCException
status - ModerationStatus to filter.thread - Thread owner of the comments (optional)start - Where to to start the count.limit - Amount of Comments to return.contextId - Context of the UGC.sort - Sort Fields.UGCExceptionlong countByModerationStatus(ModerationStatus status, String thread, String contextId) throws UGCException
status - ModerationStatus to filter.thread - Thread owner of the comments (optional)contextId - Context of the UGC.UGCExceptionIterable<T> findAllFlaggedUgs(String context, int start, int pageSize, List<org.apache.commons.collections4.keyvalue.DefaultKeyValue<String,Boolean>> sortOrder)
context - Context of the UGCstart - Where to start the count.pageSize - Amount of Comments to returnsortOrder - Sort Fields.long countAllFlaggedUgs(String context, int start, int pageSize, List<org.apache.commons.collections4.keyvalue.DefaultKeyValue<String,Boolean>> sortOrder)
Map<? extends String,?> approveComment(UGC ugc, org.craftercms.profile.api.Profile profile) throws org.craftercms.profile.api.exceptions.ProfileException, SocialException
org.craftercms.profile.api.exceptions.ProfileExceptionSocialExceptionCopyright © 2019 CrafterCMS. All Rights Reserved.