Package io.meeds.gamification.service
Interface RealizationService
- All Known Implementing Classes:
RealizationServiceImpl
public interface RealizationService
-
Method Summary
Modifier and TypeMethodDescriptioncancelRealizations(String event, String earnerIdentityId, String receiverIdentityId, String objectId, String objectType) Cancels an existing Realization with an event name for a given object identified by its id and typeintCount realizations by filterintcountRealizationsByFilter(RealizationFilter filter, org.exoplatform.services.security.Identity userAclIdentity) Count realizations by filtercreateRealizations(String event, String earnerIdentityId, String receiverIdentityId, String objectId, String objectType) Creates new Realizations switch an event name for a given object identified by its id and typevoidcreateRealizationsAsync(String event, String earnerIdentityId, String receiverIdentityId, String objectId, String objectType) Creates new Realizations asynchronously switch an event name for a given object identified by its id and typedeleteRealizations(String objectId, String objectType) Marks all realizations of a given object, generally due to deletion of originating objectexportXlsx(RealizationFilter filter, org.exoplatform.services.security.Identity userAclIdentity, String fileName, Locale locale) Export realizations found switch filter into anInputStreamcontaining a file of format XLSfindRealizationsByObjectIdAndObjectType(String objectId, String objectType) Retrieves the list of realizations identified by object Id and object Type.getLeaderboard(LeaderboardFilter filter, String currentUser) Retrieves Leaderboard switch designated filterintgetLeaderboardRank(String earnerIdentityId, Date date, Long programId) Retrieves Leaderboard rank of an earnerIdentityid andProgramDTOid for the given dategetLeaderboardStatsByIdentityId(String earnerIdentityId, Date startDate, Date endDate) Retrieves scores per doamin of a givenIdentitygetRealizationById(long realizationId) Retrieves a realization identified by its technical identifier.getRealizationById(long realizationId, org.exoplatform.services.security.Identity userAclIdentity) Retrieves a realization identified by its technical identifier.getRealizationsByFilter(RealizationFilter filter, int offset, int limit) Retrieves all Realizations by Filter.getRealizationsByFilter(RealizationFilter filter, org.exoplatform.services.security.Identity userAclIdentity, int offset, int limit) Retrieves all Realizations by Filter.getRealizationValidityContext(RuleDTO rule, String earnerIdentityId) Checks whether earner can create a realization on a designated rule at this moment or notlonggetScoreByIdentityId(String earnerIdentityId) RetrievesIdentitytotal scorelonggetScoreByIdentityIdAndBetweenDates(String earnerIdentityId, Date fromDate, Date toDate) Retrieves identities total score between designated datesgetScorePerProgramByIdentityId(String earnerIdentityId) Compute User reputation score by programgetScoresByIdentityIdsAndBetweenDates(List<String> earnerIdentityIds, Date fromDate, Date toDate) Retrieves identities total score between designated datesbooleanisRealizationManager(String username) Checks whether the user can manage realizations of one or multiple programs, even deleted ones.voidupdateRealizationStatus(long realizationId, RealizationStatus status) Updates an existing realization statusvoidupdateRealizationStatus(long realizationId, RealizationStatus status, String username) Updates an existing realization status
-
Method Details
-
getRealizationsByFilter
List<RealizationDTO> getRealizationsByFilter(RealizationFilter filter, org.exoplatform.services.security.Identity userAclIdentity, int offset, int limit) throws IllegalAccessException Retrieves all Realizations by Filter.- Parameters:
filter- used to filter realizations usingRealizationFilteruserAclIdentity- current identityIdentityoffset- Offsetlimit- Limit- Returns:
- A
<RealizationDTO>object - Throws:
IllegalAccessException- when User doesn't have enough privileges to access achievements of user
-
getRealizationsByFilter
Retrieves all Realizations by Filter.- Parameters:
filter- used to filter realizations usingRealizationFilteroffset- Offsetlimit- Limit- Returns:
- A
<RealizationDTO>object
-
countRealizationsByFilter
int countRealizationsByFilter(RealizationFilter filter, org.exoplatform.services.security.Identity userAclIdentity) throws IllegalAccessException Count realizations by filter- Parameters:
filter- used to filter realizations usingRealizationFilteruserAclIdentity- currentIdentity- Returns:
- realizations count
- Throws:
IllegalAccessException- when User doesn't have enough privileges to access achievements of user
-
countRealizationsByFilter
Count realizations by filter- Parameters:
filter- used to filter realizations usingRealizationFilter- Returns:
- realizations count
-
getRealizationById
RealizationDTO getRealizationById(long realizationId, org.exoplatform.services.security.Identity userAclIdentity) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException Retrieves a realization identified by its technical identifier.- Parameters:
realizationId- technical identifier of a realizationuserAclIdentity- current identityIdentity- Returns:
- A
RealizationDTOobject - Throws:
IllegalAccessException- when user is not authorized to access realizationorg.exoplatform.commons.exception.ObjectNotFoundException- when the realization identified by its technical identifier is not found
-
getRealizationById
Retrieves a realization identified by its technical identifier.- Parameters:
realizationId- technical identifier of a realization- Returns:
- A
RealizationDTOobject
-
isRealizationManager
Checks whether the user can manage realizations of one or multiple programs, even deleted ones.- Parameters:
username- User name- Returns:
- true if can manage realizations, else false
-
exportXlsx
InputStream exportXlsx(RealizationFilter filter, org.exoplatform.services.security.Identity userAclIdentity, String fileName, Locale locale) throws IllegalAccessException Export realizations found switch filter into anInputStreamcontaining a file of format XLS- Parameters:
filter- used to filter realizations usingRealizationFilteruserAclIdentity- currentIdentityfileName- fileName to exportlocale- usedLocalefor XLS header labels- Returns:
InputStreamof a file of format XLS- Throws:
IllegalAccessException- when User doesn't have enough privileges to access achievements of user
-
findRealizationsByObjectIdAndObjectType
Retrieves the list of realizations identified by object Id and object Type.- Parameters:
objectId- object IdobjectType- object Type- Returns:
- A
<RealizationDTO>object
-
getLeaderboardRank
Retrieves Leaderboard rank of an earnerIdentityid andProgramDTOid for the given date- Parameters:
earnerIdentityId-date-programId-- Returns:
- identity leaderboard rank in
Integer
-
getScorePerProgramByIdentityId
Compute User reputation score by program- Parameters:
earnerIdentityId- earnerIdentityid- Returns:
- list of objects of type
ProfileReputation
-
createRealizations
List<RealizationDTO> createRealizations(String event, String earnerIdentityId, String receiverIdentityId, String objectId, String objectType) Creates new Realizations switch an event name for a given object identified by its id and type- Parameters:
event-RuleDTOevent nameearnerIdentityId-IdentityidreceiverIdentityId-IdentityidobjectId- the designated object type identifierobjectType- an object type, like 'activity', 'kudos' ...- Returns:
- list of created
RealizationDTO
-
createRealizationsAsync
void createRealizationsAsync(String event, String earnerIdentityId, String receiverIdentityId, String objectId, String objectType) Creates new Realizations asynchronously switch an event name for a given object identified by its id and type- Parameters:
event-RuleDTOevent nameearnerIdentityId-IdentityidreceiverIdentityId-IdentityidobjectId- the designated object type identifierobjectType- an object type, like 'activity', 'kudos' ...
-
updateRealizationStatus
void updateRealizationStatus(long realizationId, RealizationStatus status, String username) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException Updates an existing realization status- Parameters:
realizationId-RealizationDTOtechnical identifierstatus- newRealizationStatusto setusername- user name of modifier- Throws:
IllegalAccessException- when user is not authorized to update the realizationorg.exoplatform.commons.exception.ObjectNotFoundException- when the realization identified by its technical identifier is not found
-
updateRealizationStatus
void updateRealizationStatus(long realizationId, RealizationStatus status) throws org.exoplatform.commons.exception.ObjectNotFoundException Updates an existing realization status- Parameters:
realizationId-RealizationDTOtechnical identifierstatus- newRealizationStatusto set- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the realization identified by its technical identifier is not found
-
cancelRealizations
List<RealizationDTO> cancelRealizations(String event, String earnerIdentityId, String receiverIdentityId, String objectId, String objectType) Cancels an existing Realization with an event name for a given object identified by its id and type- Parameters:
event-RuleDTOevent nameearnerIdentityId-IdentityidreceiverIdentityId-IdentityidobjectId- the designated object type identifierobjectType- an object type, like 'activity', 'kudos' ...- Returns:
- list of cancelled
RealizationDTO
-
deleteRealizations
Marks all realizations of a given object, generally due to deletion of originating object- Parameters:
objectId- the designated object type identifierobjectType- an object type, like 'activity', 'kudos' ...- Returns:
- list of marked as deleted
RealizationDTO
-
getRealizationValidityContext
Checks whether earner can create a realization on a designated rule at this moment or not- Parameters:
rule-RuleDTOearnerIdentityId-Identityid- Returns:
RealizationValidityContextif can not create a realization, else null
-
getScoreByIdentityIdAndBetweenDates
Retrieves identities total score between designated dates- Parameters:
earnerIdentityId-IdentityidfromDate- From datetoDate- End date- Returns:
- total score
-
getScoreByIdentityId
RetrievesIdentitytotal score- Parameters:
earnerIdentityId-Identityid- Returns:
- total score
-
getLeaderboardStatsByIdentityId
List<PiechartLeaderboard> getLeaderboardStatsByIdentityId(String earnerIdentityId, Date startDate, Date endDate) Retrieves scores per doamin of a givenIdentity- Parameters:
earnerIdentityId- earner identity idstartDate-endDate-- Returns:
- a list of object of type PiechartLeaderboard
-
getLeaderboard
List<StandardLeaderboard> getLeaderboard(LeaderboardFilter filter, String currentUser) throws IllegalAccessException Retrieves Leaderboard switch designated filter- Parameters:
filter- of typeLeaderboardFilter, used to filter querycurrentUser- Currrent user name- Returns:
Listof objects of type StandardLeaderboard- Throws:
IllegalAccessException- when space board and anonymous access
-
getScoresByIdentityIdsAndBetweenDates
Map<Long,Long> getScoresByIdentityIdsAndBetweenDates(List<String> earnerIdentityIds, Date fromDate, Date toDate) Retrieves identities total score between designated dates- Parameters:
earnerIdentityIds-fromDate-toDate-- Returns:
MapwithIdentityid as key and score as value
-