Class Utils
- java.lang.Object
-
- org.exoplatform.addons.gamification.utils.Utils
-
public class Utils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringANNOUNCEMENT_ACTIVITY_EVENTstatic DateTimeFormatterRFC_3339_FORMATTERstatic DateTimeFormatterSIMPLE_DATE_FORMATTER
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancanAnnounce(String id)static booleancanEditChallenge(List<Long> managersId, String spaceId)static LongcountAnnouncementsByChallenge(Long challengeId)static UserInfocreateUser(org.exoplatform.social.core.identity.model.Identity identity)static UserInfocreateUser(org.exoplatform.social.core.identity.model.Identity identity, org.exoplatform.social.core.space.model.Space space, List<Long> managersId)static StringescapeIllegalCharacterInMessage(String message)static StringgetCurrentUser()static LocalegetCurrentUserLocale()static DomainDTOgetDomainByTitle(String domainTitle)static GamificationServicegetGamificationService()static StringgetI18NMessage(Locale userLocale, String messageKey)static org.exoplatform.social.core.identity.model.IdentitygetIdentityByTypeAndId(String type, String name)static List<UserInfo>getManagersByIds(List<Long> ids)static RuleDTOgetRuleById(long ruleId)static RuleDTOgetRuleByTitle(String title)static RuleServicegetRuleService()static org.exoplatform.social.core.space.model.SpacegetSpaceById(String spaceId)static StringgetSpaceFromObjectID(String objectID)static UserInfogetUserById(Long id, Long challengeId)static LonggetUserGlobalScore(String earnerId)static LocalegetUserLocale(String username)static StringgetUserRemoteId(String id)static DateparseRFC3339Date(String dateString)static DateparseSimpleDate(String dateString)static StringtoRFC3339Date(Date dateTime)static StringtoSimpleDateFormat(Date dateTime)
-
-
-
Field Detail
-
ANNOUNCEMENT_ACTIVITY_EVENT
public static final String ANNOUNCEMENT_ACTIVITY_EVENT
- See Also:
- Constant Field Values
-
RFC_3339_FORMATTER
public static final DateTimeFormatter RFC_3339_FORMATTER
-
SIMPLE_DATE_FORMATTER
public static final DateTimeFormatter SIMPLE_DATE_FORMATTER
-
-
Method Detail
-
getIdentityByTypeAndId
public static org.exoplatform.social.core.identity.model.Identity getIdentityByTypeAndId(String type, String name)
-
getCurrentUser
public static final String getCurrentUser()
-
canEditChallenge
public static final boolean canEditChallenge(List<Long> managersId, String spaceId)
-
canAnnounce
public static final boolean canAnnounce(String id)
-
getSpaceById
public static org.exoplatform.social.core.space.model.Space getSpaceById(String spaceId)
-
getRuleById
public static RuleDTO getRuleById(long ruleId) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
createUser
public static UserInfo createUser(org.exoplatform.social.core.identity.model.Identity identity, org.exoplatform.social.core.space.model.Space space, List<Long> managersId)
-
createUser
public static UserInfo createUser(org.exoplatform.social.core.identity.model.Identity identity)
-
getGamificationService
public static GamificationService getGamificationService()
-
getRuleService
public static RuleService getRuleService()
-
getCurrentUserLocale
public static final Locale getCurrentUserLocale()
-
-