Class GamificationHistoryDAO
- java.lang.Object
-
- org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<GamificationActionsHistory,Long>
-
- org.exoplatform.addons.gamification.storage.dao.GamificationHistoryDAO
-
- All Implemented Interfaces:
org.exoplatform.commons.api.persistence.GenericDAO<GamificationActionsHistory,Long>
public class GamificationHistoryDAO extends org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<GamificationActionsHistory,Long>
-
-
Constructor Summary
Constructors Constructor Description GamificationHistoryDAO()
-
Method Summary
-
-
-
Field Detail
-
STATUS
public static final String STATUS
- See Also:
- Constant Field Values
-
-
Method Detail
-
findAllActionsHistoryAgnostic
public List<StandardLeaderboard> findAllActionsHistoryAgnostic(IdentityType earnerType)
Get all ActionHistory records and convert them to list of type StandardLeaderboard- Parameters:
earnerType- :IdentityTypeUSER or SPACE- Returns:
- list of type StandardLeaderboard
-
findAllActionsHistoryByDateByDomain
public List<StandardLeaderboard> findAllActionsHistoryByDateByDomain(IdentityType earnerType, Date date, String domain)
Find all gamification entries by domain and by type- Parameters:
earnerType- :IdentityTypeUSER or SPACEdate- : date from when we load gamification entriesdomain- : domain filter- Returns:
- list of object of type StandardLeaderboard
-
findAllActionsHistoryByDomain
public List<StandardLeaderboard> findAllActionsHistoryByDomain(IdentityType earnerType, String domain)
Find all gamification entries by domain- Parameters:
earnerType- :IdentityTypeUSER or SPACEdomain- : domain filter- Returns:
- list of object of type StandardLeaderboard
-
findAllActionsHistoryByDomain
public List<StandardLeaderboard> findAllActionsHistoryByDomain(String domain, IdentityType earnerType, int limit)
Find all gamification entries by domain- Parameters:
domain- : domain filterearnerType- :IdentityTypeUSER or SPACElimit- : limit of the query- Returns:
- list of object of type StandardLeaderboard
-
findAllActionsHistoryByDate
public List<StandardLeaderboard> findAllActionsHistoryByDate(IdentityType earnerType, Date date)
Find all gamification entries by date- Parameters:
date- : date from when entries are loadedearnerType- :IdentityTypeUSER or SPACE- Returns:
- list of object of type StandardLeaderboard
-
findAllActionsHistoryByDate
public List<StandardLeaderboard> findAllActionsHistoryByDate(Date date, IdentityType earnerType, int limit)
Find all gamification entries by date- Parameters:
date- : date from when entries are loadedearnerType- :IdentityTypeUSER or SPACElimit- : limit of the query- Returns:
- list of object of type StandardLeaderboard
-
findActionsHistoryByEarnerId
public List<GamificationActionsHistory> findActionsHistoryByEarnerId(String earnerId, int limit)
Get an ActionHistory record based on userId- Parameters:
earnerId- : the userId used in projectionlimit- : limit of the query- Returns:
- list of objects of type GamificationActionsHistory
-
findAllActionsHistory
public List<StandardLeaderboard> findAllActionsHistory(IdentityType earnerType, int limit)
Get all ActionHistory records paginated- Parameters:
earnerType- :IdentityTypeUSER or SPACElimit- : limit of the query- Returns:
- list of object of type StandardLeaderboard
-
findActionHistoryByDateByEarnerId
public List<GamificationActionsHistory> findActionHistoryByDateByEarnerId(Date date, String earnerId)
Get The last ActionHistory record- Parameters:
date- : date from when we aim to track the userearnerId- identity id of earner- Returns:
- an instance of type GamificationActionsHistory
-
findActionsHistoryByDateByDomain
public List<StandardLeaderboard> findActionsHistoryByDateByDomain(Date date, IdentityType earnerType, String domain, int limit)
Find actionsHistory by data and domain- Parameters:
date- : date from when we aim to track userearnerType- :IdentityTypeUSER or SPACEdomain- : domain we aim to tracklimit- : how many records we should load from DB- Returns:
- a list of object of type StandardLraderboard
-
findStatsByUserId
public List<PiechartLeaderboard> findStatsByUserId(String earnerId, Date fromDate, Date toDate)
Get earner stats- Parameters:
earnerId- identity id of earnerfromDate-toDate-- Returns:
- a list of objects of type PiechartLeaderboard
-
findDomainScoreByIdentityId
public List<ProfileReputation> findDomainScoreByIdentityId(String earnerId)
Compute for a given user the score earned for each doman- Parameters:
earnerId- ProfileReputation- Returns:
- a list of objects of type
-
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)
-
findAllLeaderboardBetweenDate
public List<StandardLeaderboard> findAllLeaderboardBetweenDate(IdentityType earnerType, Date fromDate, Date toDate)
-
findActionsHistoryByEarnerIdSortedByDate
public List<GamificationActionsHistory> findActionsHistoryByEarnerIdSortedByDate(String earnerId, int limit)
Find actionsHistory by data and domain and date and points- Parameters:
earnerId- : earner identity idlimit- : how many records we should load from DB- Returns:
- a list of object of type GamificationActionsHistory
-
getTotalScore
public long getTotalScore(String earnerId)
-
getAllPointsByDomain
public List<GamificationActionsHistory> getAllPointsByDomain(String domain)
-
getAllPointsWithNullDomain
public List<GamificationActionsHistory> getAllPointsWithNullDomain()
-
findAllAnnouncementByChallenge
public List<GamificationActionsHistory> findAllAnnouncementByChallenge(Long challengeId, int offset, int limit)
-
getAllRealizationsByDate
public List<GamificationActionsHistory> getAllRealizationsByDate(Date fromDate, Date toDate, int offset, int limit)
-
-