java.lang.Object
org.exoplatform.addons.gamification.utils.Utils

public class Utils extends Object
  • Field Details

  • Method Details

    • getIdentityByTypeAndId

      public static org.exoplatform.social.core.identity.model.Identity getIdentityByTypeAndId(String type, String name)
    • getUserRemoteId

      public static String getUserRemoteId(String id)
    • getUserFullName

      public static String getUserFullName(String id)
    • getIdentityEntity

      public static org.exoplatform.social.rest.entity.IdentityEntity getIdentityEntity(org.exoplatform.social.core.manager.IdentityManager identityManager, long identityId)
    • getCurrentUser

      public static final String getCurrentUser()
    • isChallengeManager

      public static boolean isChallengeManager(Challenge challenge, String username)
    • canAnnounce

      public static final boolean canAnnounce(String spaceId, String username)
    • toRFC3339Date

      public static String toRFC3339Date(Date dateTime)
    • toSimpleDateFormat

      public static String toSimpleDateFormat(Date dateTime)
    • parseRFC3339Date

      public static Date parseRFC3339Date(String dateString)
    • parseSimpleDate

      public static Date parseSimpleDate(String dateString)
    • getSpaceById

      public static org.exoplatform.social.core.space.model.Space getSpaceById(String spaceId)
    • getEnabledDomainByTitle

      public static DomainDTO getEnabledDomainByTitle(String domainTitle)
    • getDomainByTitle

      public static DomainDTO getDomainByTitle(String domainTitle)
    • getDomainDTOById

      public static DomainDTO getDomainDTOById(long domainId)
    • getChallengeDomainDTO

      public static DomainDTO getChallengeDomainDTO(Challenge challenge)
    • getDomainById

      public static DomainEntity getDomainById(long domainId)
    • getRulesTotalScoreByDomain

      public static long getRulesTotalScoreByDomain(long domainId)
    • getRuleById

      public static RuleDTO getRuleById(long ruleId) throws IllegalArgumentException
      Throws:
      IllegalArgumentException
    • getRuleByTitle

      public static RuleDTO getRuleByTitle(String title)
    • isRuleManager

      public static boolean isRuleManager(RuleDTO rule, String username)
    • getOwners

      public static List<UserInfo> getOwners(Challenge challenge)
    • toUserInfo

      public static List<UserInfo> toUserInfo(Collection<Long> ids)
    • getDomainOwnersByIds

      public static List<UserInfo> getDomainOwnersByIds(Set<Long> ids, long spaceId)
    • toUserInfo

      public static UserInfo toUserInfo(Challenge challenge, org.exoplatform.social.core.identity.model.Identity identity)
    • toUserInfo

      public static UserInfo toUserInfo(long domainId, String username)
    • toUserInfo

      public static UserInfo toUserInfo(org.exoplatform.social.core.identity.model.Identity identity)
    • countAnnouncementsByChallenge

      public static Long countAnnouncementsByChallenge(Long challengeId)
    • findAllAnnouncementByChallenge

      public static List<Announcement> findAllAnnouncementByChallenge(Long challengeId, int offset, int limit, IdentityType earnerType) throws IllegalAccessException
      Throws:
      IllegalAccessException
    • countAnnouncementByChallengeAndEarnerType

      public static Long countAnnouncementByChallengeAndEarnerType(long challengeId, IdentityType earnerType)
    • getGamificationService

      public static GamificationService getGamificationService()
    • getRuleService

      public static RuleService getRuleService()
    • getUserGlobalScore

      public static Long getUserGlobalScore(String earnerId)
    • getSpaceFromObjectID

      public static String getSpaceFromObjectID(String objectID)
    • getI18NMessage

      public static String getI18NMessage(Locale userLocale, String messageKey)
    • escapeIllegalCharacterInMessage

      public static String escapeIllegalCharacterInMessage(String message)
    • buildActivityParams

      public static void buildActivityParams(org.exoplatform.social.core.activity.model.ExoSocialActivity activity, Map<String,?> templateParams)
    • isProgramOwner

      public static boolean isProgramOwner(long spaceId, Set<Long> ownerIds, org.exoplatform.social.core.identity.model.Identity userIdentity)
    • buildAttachmentUrl

      public static String buildAttachmentUrl(String domainId, Long lastModifiedDate, String type, boolean isDefault)
    • generateAttachmentToken

      public static String generateAttachmentToken(String domainId, String attachmentType, Long lastModifiedDate)
    • isAttachmentTokenValid

      public static boolean isAttachmentTokenValid(String token, String domainId, String attachmentType, Long lastModifiedDate)
    • getBaseURLDomainRest

      public static String getBaseURLDomainRest()
    • broadcastEvent

      public static void broadcastEvent(org.exoplatform.services.listener.ListenerService listenerService, String eventName, Object source, Object data)
    • getPermissions

      public static List<String> getPermissions(String permission)
    • isSuperManager

      public static boolean isSuperManager(String username)
    • getUserAclIdentity

      public static org.exoplatform.services.security.Identity getUserAclIdentity(String username)
    • isSpaceManager

      public static boolean isSpaceManager(long spaceId, String userId)
    • isSpaceMember

      public static boolean isSpaceMember(long spaceId, String userId)
    • isUserMemberOfGroupOrUser

      public static boolean isUserMemberOfGroupOrUser(String username, String permissionExpression)