Class SocialServicesImpl<T extends SocialUgc>

    • Constructor Detail

      • SocialServicesImpl

        public SocialServicesImpl()
    • Method Detail

      • vote

        public SocialUgc vote​(String ugcId,
                              VoteOptions voteOptions,
                              String userId,
                              String contextId)
                       throws SocialException
        Description copied from interface: SocialServices
        Executes the given UserContentInteraction for the given User Content Action.

        Implementers must check if the current user is allowed to removeWatcher UGC and that the user belongs to the same ugc context

        .
        Specified by:
        vote in interface SocialServices<T extends SocialUgc>
        Parameters:
        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.
        Returns:
        A new Public (secure) UGC.
        Throws:
        SocialException - if attribute can be deleted.
      • flag

        public SocialUgc flag​(String ugcId,
                              String contextId,
                              String reason,
                              String userId)
                       throws SocialException
        Description copied from interface: SocialServices
        Flags the given UGC, with a given reason why.

        Implementers must check if the current user is allowed to removeWatcher UGC and that the user belongs to the same ugc context

        .
        Specified by:
        flag in interface SocialServices<T extends SocialUgc>
        Parameters:
        ugcId - 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.
        Returns:
        A new (updated) Public (secure) UGC.
        Throws:
        SocialException
      • unFlag

        public boolean unFlag​(String ugcId,
                              String flagId,
                              String userId,
                              String contextId)
                       throws SocialException
        Description copied from interface: SocialServices
        Unflags the given UGC for the given reason.

        Implementers must check if the current user is allowed to removeWatcher UGC and that the user belongs to the same ugc context

        .
        Specified by:
        unFlag in interface SocialServices<T extends SocialUgc>
        Parameters:
        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.
        Returns:
        A new (updated) Public (secure) UGC.
        Throws:
        SocialException
      • findByModerationStatus

        public Iterable<T> findByModerationStatus​(ModerationStatus status,
                                                  String thread,
                                                  String contextId,
                                                  int start,
                                                  int limit,
                                                  List sort)
                                           throws UGCException
        Description copied from interface: SocialServices
        Finds all Comments with the given Moderation status. Optional: filter the thread
        Specified by:
        findByModerationStatus in interface SocialServices<T extends SocialUgc>
        Parameters:
        status - 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.
        Returns:
        An Iterable with the results.
        Throws:
        UGCException
      • findAllFlaggedUgs

        public Iterable<T> findAllFlaggedUgs​(String context,
                                             int start,
                                             int pageSize,
                                             List sortOrder)
        Description copied from interface: SocialServices
        Returns all Flagged UGC
        Specified by:
        findAllFlaggedUgs in interface SocialServices<T extends SocialUgc>
        Parameters:
        context - Context of the UGC
        start - Where to start the count.
        pageSize - Amount of Comments to return
        sortOrder - Sort Fields.
        Returns:
        An Iterable with the results.
      • voteUp

        protected void voteUp​(T ugc,
                              String userId)
      • unvoteDown

        protected void unvoteDown​(SocialUgc ugc,
                                  String userId)
      • setUgcRepository

        public void setUgcRepository​(UGCRepository<T> ugcRepository)
      • setReactor

        public void setReactor​(reactor.core.Reactor reactor)
      • setUgcPipeline

        public void setUgcPipeline​(UgcPipeline ugcPipeline)
      • setTenantConfigurationServiceImpl

        public void setTenantConfigurationServiceImpl​(TenantConfigurationService tenantConfigurationService)
      • setProfileServiceRestClient

        public void setProfileServiceRestClient​(org.craftercms.profile.api.services.ProfileService profileService)