Class GamificationService


  • public class GamificationService
    extends Object
    • Constructor Detail

      • GamificationService

        public GamificationService​(org.exoplatform.social.core.manager.IdentityManager identityManager,
                                   org.exoplatform.social.core.space.spi.SpaceService spaceService,
                                   GamificationHistoryDAO gamificationHistoryDAO,
                                   DomainMapper domainMapper,
                                   RuleService ruleService)
    • Method Detail

      • getLeaderboardRank

        public int getLeaderboardRank​(String earnerId,
                                      Date date,
                                      String domain)
      • findReputationByEarnerId

        public long findReputationByEarnerId​(String earnerId)
        Compute reputation's score
        Parameters:
        earnerId - : the current user earner id
        Returns:
        long score of user
      • buildDomainScoreByIdentityId

        public List<ProfileReputation> buildDomainScoreByIdentityId​(String earnerId)
        Compute User reputation score by Domain
        Parameters:
        earnerId - earner identity id
        Returns:
        list of objects of type ProfileReputation
      • buildStatsByUser

        public List<PiechartLeaderboard> buildStatsByUser​(String earnerId,
                                                          Date startDate,
                                                          Date endDate)
        Build stats dashboard of a given user (based on domain)
        Parameters:
        earnerId - earner identity id
        startDate -
        endDate -
        Returns:
        a list of object of type PiechartLeaderboard
      • findUserReputationScoreBetweenDate

        public long findUserReputationScoreBetweenDate​(String earnerId,
                                                       Date fromDate,
                                                       Date toDate)
      • findUserReputationScoreByMonth

        public long findUserReputationScoreByMonth​(String earnerId,
                                                   Date currentMonth)
      • findUserReputationScoreByDomainBetweenDate

        public long findUserReputationScoreByDomainBetweenDate​(String earnerId,
                                                               String domain,
                                                               Date fromDate,
                                                               Date toDate)
      • findActionsHistoryByEarnerId

        public List<GamificationActionsHistory> findActionsHistoryByEarnerId​(String earnerId,
                                                                             int limit)
        Provided as an API from points n list to find gamification history from the GamificationInformationsPortlet's earner earned points by date
        Parameters:
        earnerId - earner identity Id
        limit - limit entries to return
        Returns:
        List of GamificationActionsHistory
      • computeTotalScore

        public long computeTotalScore​(String actorIdentityId)