public class SocialServicesImpl<T extends SocialUgc> extends Object implements SocialServices
| Constructor and Description |
|---|
SocialServicesImpl() |
| Modifier and Type | Method and Description |
|---|---|
long |
countByModerationStatus(SocialUgc.ModerationStatus status,
String thread,
String contextId)
Counts all Comments with the given Moderation status.
|
Iterable<T> |
findByModerationStatus(SocialUgc.ModerationStatus status,
String thread,
String contextId,
int start,
int limit,
List sort)
Finds all Comments with the given Moderation status.
|
SocialUgc |
flag(String ugcId,
String contextId,
String reason,
String userId)
Flags the given UGC, with for given reason.
|
SocialUgc |
moderate(String ugcId,
SocialUgc.ModerationStatus moderationStatus,
String userId,
String contextId)
Change the moderation Status of the given UGC.
|
void |
setReactor(reactor.core.Reactor reactor) |
void |
setUgcRepository(UGCRepository<T> ugcRepository) |
boolean |
unFlag(String ugcId,
String flagId,
String userId,
String contextId)
Un flags the given UGC for the given reason.
|
protected void |
unvoteDown(SocialUgc ugc,
String userId) |
SocialUgc |
vote(String ugcId,
VoteOptions voteOptions,
String userId,
String contextId)
Executes the given UserContentInteraction for the given User Content Action.
|
protected void |
voteUp(T ugc,
String userId) |
public SocialUgc vote(String ugcId, VoteOptions voteOptions, String userId, String contextId) throws SocialException
SocialServicesImplementers must check if the current user is allow to removeWatcher UGC and that the user belongs to the same ugc context
.vote in interface SocialServicesugcId - 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.public SocialUgc flag(String ugcId, String contextId, String reason, String userId) throws SocialException
SocialServicesImplementers must check if the current user is allow to removeWatcher UGC and that the user belongs to the same ugc context
.flag in interface SocialServicesugcId - Id of the UGC to flag.contextId - Context of the UGC.reason - The reason for this ugc is been flag.userId - Id of the user that is flagging this UGC.SocialExceptionpublic boolean unFlag(String ugcId, String flagId, String userId, String contextId) throws SocialException
SocialServicesImplementers must check if the current user is allow to removeWatcher UGC and that the user belongs to the same ugc context
.unFlag in interface SocialServicesugcId - Id of the UGC to un flag.flagId - Id of the flag to delete.userId - Id of the user that is unflagging this UGC.contextId - Context of the UGC.SocialExceptionpublic SocialUgc moderate(String ugcId, SocialUgc.ModerationStatus moderationStatus, String userId, String contextId) throws UGCException
SocialServicesmoderate in interface SocialServicesugcId - 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.UGCExceptionpublic Iterable<T> findByModerationStatus(SocialUgc.ModerationStatus status, String thread, String contextId, int start, int limit, List sort) throws UGCException
SocialServicesfindByModerationStatus in interface SocialServicesstatus - ModerationStatus to filter.thread - Thread owner of the comments (optional)contextId - Context of the UGC.start - Where to to start the count.limit - Amount of Comments to return.sort - Sort Fields.UGCExceptionpublic long countByModerationStatus(SocialUgc.ModerationStatus status, String thread, String contextId) throws UGCException
SocialServicescountByModerationStatus in interface SocialServicesstatus - ModerationStatus to filter.thread - Thread owner of the comments (optional)contextId - Context of the UGC.UGCExceptionpublic void setUgcRepository(UGCRepository<T> ugcRepository)
public void setReactor(reactor.core.Reactor reactor)
Copyright © 2014 CrafterCMS. All Rights Reserved.