public class SocialServicesImpl<T extends SocialUgc> extends Object implements SocialServices
| Constructor and Description |
|---|
SocialServicesImpl() |
| Modifier and Type | Method and Description |
|---|---|
Map<? extends String,Object> |
approveComment(UGC ugc,
org.craftercms.profile.api.Profile profile) |
long |
countAllFlaggedUgs(String context,
int start,
int pageSize,
List 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 sortOrder)
Returns all Flagged UGC
|
Iterable<T> |
findByModerationStatus(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 a given reason why.
|
SocialUgc |
moderate(String ugcId,
ModerationStatus moderationStatus,
String userId,
String contextId)
Change the moderation Status of the given UGC.
|
void |
setProfileServiceRestClient(org.craftercms.profile.api.services.ProfileService profileService) |
void |
setReactor(reactor.core.Reactor reactor) |
void |
setTenantConfigurationServiceImpl(TenantConfigurationService tenantConfigurationService) |
void |
setUgcPipeline(UgcPipeline ugcPipeline) |
void |
setUgcRepository(UGCRepository<T> ugcRepository) |
boolean |
unFlag(String ugcId,
String flagId,
String userId,
String contextId)
Unflags 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 allowed 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 allowed 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 flagging this ugc.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 allowed to removeWatcher UGC and that the user belongs to the same ugc context
.unFlag in interface SocialServicesugcId - 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.SocialExceptionpublic SocialUgc moderate(String ugcId, ModerationStatus moderationStatus, String userId, String contextId) throws SocialException
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.SocialExceptionpublic Iterable<T> findByModerationStatus(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(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 Iterable<T> findAllFlaggedUgs(String context, int start, int pageSize, List sortOrder)
SocialServicesfindAllFlaggedUgs in interface SocialServicescontext - Context of the UGCstart - Where to start the count.pageSize - Amount of Comments to returnsortOrder - Sort Fields.public long countAllFlaggedUgs(String context, int start, int pageSize, List sortOrder)
countAllFlaggedUgs in interface SocialServicespublic Map<? extends String,Object> approveComment(UGC ugc, org.craftercms.profile.api.Profile profile) throws org.craftercms.profile.api.exceptions.ProfileException, SocialException
approveComment in interface SocialServicesorg.craftercms.profile.api.exceptions.ProfileExceptionSocialExceptionpublic void setUgcRepository(UGCRepository<T> ugcRepository)
public void setReactor(reactor.core.Reactor reactor)
public void setUgcPipeline(UgcPipeline ugcPipeline)
public void setTenantConfigurationServiceImpl(TenantConfigurationService tenantConfigurationService)
public void setProfileServiceRestClient(org.craftercms.profile.api.services.ProfileService profileService)
Copyright © 2019 CrafterCMS. All Rights Reserved.