Class GamificationService
java.lang.Object
org.exoplatform.addons.gamification.service.effective.GamificationService
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGamificationService(org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, GamificationHistoryDAO gamificationHistoryDAO, RuleService ruleService) -
Method Summary
Modifier and TypeMethodDescriptionbuildDomainScoreByIdentityId(String earnerId) Compute User reputation score by DomainbuildStatsByUser(String earnerId, Date startDate, Date endDate) Build stats dashboard of a given user (based on domain)longcomputeTotalScore(String actorIdentityId) voidcreateHistory(String event, String sender, String receiver, String object) filter(LeaderboardFilter filter) Filter Leaderboard logic (filter by Domain or/and by period)findActionHistoryByDateByEarnerId(Date date, String earnerId) Get actionsHistory entitiesfindActionsHistoryByEarnerId(String earnerId, int limit) Provided as an API from points n list to find gamification history from the GamificationInformationsPortlet's earner earned points by datefindAllLeaderboardBetweenDate(IdentityType earnedType, Date fromDate, Date toDate) findLatestActionHistoryByEarnerId(String earnerId) longfindReputationByEarnerId(String earnerId) Compute reputation's scorelongfindUserReputationScoreBetweenDate(String earnerId, Date fromDate, Date toDate) findUsersReputationScoreBetweenDate(List<String> earnersId, Date fromDate, Date toDate) intgetLeaderboardRank(String earnerId, Date date, Long domainId) Save a GamificationActionsHistory in DB
-
Field Details
-
gamificationHistoryDAO
-
-
Constructor Details
-
GamificationService
public GamificationService(org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, GamificationHistoryDAO gamificationHistoryDAO, RuleService ruleService)
-
-
Method Details
-
findActionHistoryByDateByEarnerId
public List<GamificationActionsHistory> findActionHistoryByDateByEarnerId(Date date, String earnerId) Get actionsHistory entities- Parameters:
date- : filter by dateearnerId- : filter by identity id- Returns:
ListofGamificationActionsHistory
-
getLeaderboardRank
-
findReputationByEarnerId
Compute reputation's score- Parameters:
earnerId- : the current user earner id- Returns:
- long score of user
-
buildDomainScoreByIdentityId
Compute User reputation score by Domain- Parameters:
earnerId- earner identity id- Returns:
- list of objects of type ProfileReputation
-
saveActionHistory
Save a GamificationActionsHistory in DB- Parameters:
history- history entru to save- Returns:
GamificationActionsHistory
-
createHistory
-
findLatestActionHistoryByEarnerId
-
filter
Filter Leaderboard logic (filter by Domain or/and by period)- Parameters:
filter- of typeLeaderboardFilter, used to filter query- Returns:
- list of objects of type StandardLeaderboard
-
buildStatsByUser
Build stats dashboard of a given user (based on domain)- Parameters:
earnerId- earner identity idstartDate-endDate-- Returns:
- a list of object of type PiechartLeaderboard
-
findUserReputationScoreBetweenDate
-
findUsersReputationScoreBetweenDate
-
findAllLeaderboardBetweenDate
public List<StandardLeaderboard> findAllLeaderboardBetweenDate(IdentityType earnedType, Date fromDate, Date toDate) -
findActionsHistoryByEarnerId
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 Idlimit- limit entries to return- Returns:
ListofGamificationActionsHistory
-
build
public GamificationActionsHistory build(RuleDTO ruleDto, String actor, String receiver, String objectId) -
computeTotalScore
-