Interface RealizationService

All Known Implementing Classes:
RealizationServiceImpl

public interface RealizationService
  • 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 using RealizationFilter
      userAclIdentity - current identity Identity
      offset - Offset
      limit - Limit
      Returns:
      A <RealizationDTO> object
      Throws:
      IllegalAccessException - when User doesn't have enough privileges to access achievements of user
    • getRealizationsByFilter

      List<RealizationDTO> getRealizationsByFilter(RealizationFilter filter, int offset, int limit)
      Retrieves all Realizations by Filter.
      Parameters:
      filter - used to filter realizations using RealizationFilter
      offset - Offset
      limit - 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 using RealizationFilter
      userAclIdentity - current Identity
      Returns:
      realizations count
      Throws:
      IllegalAccessException - when User doesn't have enough privileges to access achievements of user
    • countRealizationsByFilter

      int countRealizationsByFilter(RealizationFilter filter)
      Count realizations by filter
      Parameters:
      filter - used to filter realizations using RealizationFilter
      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 realization
      userAclIdentity - current identity Identity
      Returns:
      A RealizationDTO object
      Throws:
      IllegalAccessException - when user is not authorized to access realization
      org.exoplatform.commons.exception.ObjectNotFoundException - when the realization identified by its technical identifier is not found
    • getRealizationById

      RealizationDTO getRealizationById(long realizationId)
      Retrieves a realization identified by its technical identifier.
      Parameters:
      realizationId - technical identifier of a realization
      Returns:
      A RealizationDTO object
    • isRealizationManager

      boolean isRealizationManager(String username)
      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 an InputStream containing a file of format XLS
      Parameters:
      filter - used to filter realizations using RealizationFilter
      userAclIdentity - current Identity
      fileName - fileName to export
      locale - used Locale for XLS header labels
      Returns:
      InputStream of a file of format XLS
      Throws:
      IllegalAccessException - when User doesn't have enough privileges to access achievements of user
    • findRealizationsByObjectIdAndObjectType

      List<RealizationDTO> findRealizationsByObjectIdAndObjectType(String objectId, String objectType)
      Retrieves the list of realizations identified by object Id and object Type.
      Parameters:
      objectId - object Id
      objectType - object Type
      Returns:
      A <RealizationDTO> object
    • getLeaderboardRank

      int getLeaderboardRank(String earnerIdentityId, Date fromDate, Date toDate, Long spaceId, Long programId)
      Retrieves Leaderboard rank of an earner Identity id and ProgramDTO id for the given date
      Parameters:
      earnerIdentityId - earner Identity id
      fromDate - From date
      toDate - End Date
      spaceId - audience space Id
      programId - program Id
      Returns:
      identity leaderboard rank in Integer
    • getScorePerProgramByIdentityId

      List<ProfileReputation> getScorePerProgramByIdentityId(String earnerIdentityId)
      Compute User reputation score by program
      Parameters:
      earnerIdentityId - earner Identity id
      Returns:
      list of objects of type ProfileReputation
    • createRealizations

      List<RealizationDTO> createRealizations(String event, String eventDetails, 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 - RuleDTO event name
      eventDetails -
      earnerIdentityId - Identity id
      receiverIdentityId - Identity id
      objectId - the designated object type identifier
      objectType - an object type, like 'activity', 'kudos' ...
      Returns:
      list of created RealizationDTO
    • createRealizationsAsync

      void createRealizationsAsync(String event, String eventDetails, 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 - RuleDTO event name
      eventDetails -
      earnerIdentityId - Identity id
      receiverIdentityId - Identity id
      objectId - the designated object type identifier
      objectType - 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 - RealizationDTO technical identifier
      status - new RealizationStatus to set
      username - user name of modifier
      Throws:
      IllegalAccessException - when user is not authorized to update the realization
      org.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 - RealizationDTO technical identifier
      status - new RealizationStatus to 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 - RuleDTO event name
      earnerIdentityId - Identity id
      receiverIdentityId - Identity id
      objectId - the designated object type identifier
      objectType - an object type, like 'activity', 'kudos' ...
      Returns:
      list of cancelled RealizationDTO
    • deleteRealizations

      List<RealizationDTO> deleteRealizations(String objectId, String objectType)
      Marks all realizations of a given object, generally due to deletion of originating object
      Parameters:
      objectId - the designated object type identifier
      objectType - an object type, like 'activity', 'kudos' ...
      Returns:
      list of marked as deleted RealizationDTO
    • getRealizationValidityContext

      RealizationValidityContext getRealizationValidityContext(RuleDTO rule, String earnerIdentityId)
      Checks whether earner can create a realization on a designated rule at this moment or not
      Parameters:
      rule - RuleDTO
      earnerIdentityId - Identity id
      Returns:
      RealizationValidityContext if can not create a realization, else null
    • getScoreByIdentityIdAndBetweenDates

      default long getScoreByIdentityIdAndBetweenDates(String earnerIdentityId, Date fromDate, Date toDate)
      Retrieves identities total score between designated dates
      Parameters:
      earnerIdentityId - Identity id
      fromDate - From date
      toDate - End date
      Returns:
      total score
    • getScoreByIdentityIdAndBetweenDates

      long getScoreByIdentityIdAndBetweenDates(String earnerIdentityId, Date fromDate, Date toDate, Long spaceId, Long programId)
      Retrieves identities total score between designated dates
      Parameters:
      earnerIdentityId - Identity id
      fromDate - From date
      toDate - End date
      spaceId - Space Id
      programId - Program Id
      Returns:
      total score
    • getScoreByIdentityId

      long getScoreByIdentityId(String earnerIdentityId)
      Retrieves Identity total score
      Parameters:
      earnerIdentityId - Identity id
      Returns:
      total score
    • getLeaderboardStatsByIdentityId

      List<PiechartLeaderboard> getLeaderboardStatsByIdentityId(String earnerIdentityId, Long spaceId, String period, Date startDate, Date endDate)
      Retrieves scores per doamin of a given Identity
      Parameters:
      earnerIdentityId - earner identity id
      spaceId - Program Audience Space Identifier
      period - Period Type
      startDate - Start Date
      endDate - End Date
      Returns:
      a list of object of type PiechartLeaderboard
    • getLeaderboardStatsByIdentityId

      default List<PiechartLeaderboard> getLeaderboardStatsByIdentityId(String earnerIdentityId, String period, Date startDate, Date endDate)
      Retrieves scores per doamin of a given Identity
      Parameters:
      earnerIdentityId - earner identity id
      period - Period Type
      startDate - Start Date
      endDate - End Date
      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 type LeaderboardFilter, used to filter query
      currentUser - Currrent user name
      Returns:
      List of 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:
      Map with Identity id as key and score as value
    • getParticipantsBetweenDates

      List<Long> getParticipantsBetweenDates(Date fromDate, Date toDate)
      Parameters:
      fromDate - start of period
      toDate - end of period
      Returns:
      List of participant users in a period of time
    • countParticipantsBetweenDates

      long countParticipantsBetweenDates(Date fromDate, Date toDate)
      Parameters:
      fromDate - start of period
      toDate - end of period
      Returns:
      Count participant users in a period of time
    • hasPendingRealization

      boolean hasPendingRealization(long ruleId, String earnerIdentityId)
      Makes a check whether a given user has a pending realization for a given rule or not.
      Parameters:
      ruleId - RuleDTO identifier
      earnerIdentityId - Identity id
      Returns:
      true if has a pending realization, else false