Class Utils
java.lang.Object
org.exoplatform.addons.gamification.utils.Utils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final longstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final DateTimeFormatterstatic final DateTimeFormatterstatic final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptionstatic voidbroadcastEvent(org.exoplatform.services.listener.ListenerService listenerService, String eventName, Object source, Object data) static voidbuildActivityParams(org.exoplatform.social.core.activity.model.ExoSocialActivity activity, Map<String, ?> templateParams) static StringbuildAttachmentUrl(String domainId, Long lastModifiedDate, String type, boolean isDefault) static final booleancanAnnounce(String spaceId, String username) static LongcountAnnouncementByChallengeAndEarnerType(long challengeId, IdentityType earnerType) static LongcountAnnouncementsByChallenge(Long challengeId) static StringescapeIllegalCharacterInMessage(String message) static List<Announcement>findAllAnnouncementByChallenge(Long challengeId, int offset, int limit, IdentityType earnerType) static StringgenerateAttachmentToken(String domainId, String attachmentType, Long lastModifiedDate) static Stringstatic DomainDTOgetChallengeDomainDTO(Challenge challenge) static final Stringstatic DomainEntitygetDomainById(long domainId) static DomainDTOgetDomainByTitle(String domainTitle) static DomainDTOgetDomainDTOById(long domainId) getDomainOwnersByIds(Set<Long> ids, long spaceId) static GamificationServicestatic StringgetI18NMessage(Locale userLocale, String messageKey) static org.exoplatform.social.core.identity.model.IdentitygetIdentityByTypeAndId(String type, String name) static org.exoplatform.social.rest.entity.IdentityEntitygetIdentityEntity(org.exoplatform.social.core.manager.IdentityManager identityManager, long identityId) static RuleDTOgetRuleById(long ruleId) static RuleDTOgetRuleByTitle(String title) static RuleServicestatic longgetRulesTotalScoreByDomain(long domainId) static org.exoplatform.social.core.space.model.SpacegetSpaceById(String spaceId) static StringgetSpaceFromObjectID(String objectID) static org.exoplatform.services.security.IdentitygetUserAclIdentity(String username) static Stringstatic LonggetUserGlobalScore(String earnerId) static Stringstatic booleanisAttachmentTokenValid(String token, String domainId, String attachmentType, Long lastModifiedDate) static booleanisChallengeManager(Challenge challenge, String username) static booleanisProgramOwner(long spaceId, Set<Long> ownerIds, org.exoplatform.social.core.identity.model.Identity userIdentity) static booleanisRuleManager(RuleDTO rule, String username) static booleanisSpaceManager(long spaceId, String userId) static booleanisSpaceMember(long spaceId, String userId) static booleanisSuperManager(String username) static booleanisUserMemberOfGroupOrUser(String username, String permissionExpression) static DateparseRFC3339Date(String dateString) static DateparseSimpleDate(String dateString) static StringtoRFC3339Date(Date dateTime) static StringtoSimpleDateFormat(Date dateTime) static UserInfotoUserInfo(long domainId, String username) toUserInfo(Collection<Long> ids) static UserInfotoUserInfo(Challenge challenge, org.exoplatform.social.core.identity.model.Identity identity) static UserInfotoUserInfo(org.exoplatform.social.core.identity.model.Identity identity)
-
Field Details
-
ANNOUNCEMENT_ACTIVITY_EVENT
- See Also:
-
DEFAULT_COVER_LAST_MODIFIED
public static final long DEFAULT_COVER_LAST_MODIFIED -
RFC_3339_FORMATTER
-
SIMPLE_DATE_FORMATTER
-
POST_CREATE_RULE_EVENT
- See Also:
-
POST_UPDATE_RULE_EVENT
- See Also:
-
POST_DELETE_RULE_EVENT
- See Also:
-
ANNOUNCEMENT_ACTIVITY_TYPE
- See Also:
-
SYSTEM_USERNAME
- See Also:
-
BASE_URL_DOMAINS_REST_API
- See Also:
-
DEFAULT_IMAGE_REMOTE_ID
- See Also:
-
TYPE
- See Also:
-
REWARDING_GROUP
- See Also:
-
ADMINS_GROUP
- See Also:
-
BLACK_LIST_GROUP
- See Also:
-
-
Method Details
-
getIdentityByTypeAndId
-
getUserRemoteId
-
getUserFullName
-
getIdentityEntity
public static org.exoplatform.social.rest.entity.IdentityEntity getIdentityEntity(org.exoplatform.social.core.manager.IdentityManager identityManager, long identityId) -
getCurrentUser
-
isChallengeManager
-
canAnnounce
-
toRFC3339Date
-
toSimpleDateFormat
-
parseRFC3339Date
-
parseSimpleDate
-
getSpaceById
-
getDomainByTitle
-
getDomainDTOById
-
getChallengeDomainDTO
-
getDomainById
-
getRulesTotalScoreByDomain
public static long getRulesTotalScoreByDomain(long domainId) -
getRuleById
- Throws:
IllegalArgumentException
-
getRuleByTitle
-
isRuleManager
-
getOwners
-
toUserInfo
-
getDomainOwnersByIds
-
toUserInfo
-
toUserInfo
-
toUserInfo
-
countAnnouncementsByChallenge
-
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
-
getRuleService
-
getUserGlobalScore
-
getSpaceFromObjectID
-
getI18NMessage
-
escapeIllegalCharacterInMessage
-
buildActivityParams
-
isProgramOwner
-
buildAttachmentUrl
-
generateAttachmentToken
-
isAttachmentTokenValid
-
getBaseURLDomainRest
-
broadcastEvent
-
isSuperManager
-
getUserAclIdentity
-
isSpaceManager
-
isSpaceMember
-
isUserMemberOfGroupOrUser
-