Class Utils
java.lang.Object
org.exoplatform.perkstore.service.utils.Utils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final org.exoplatform.ws.frameworks.json.JsonGeneratorstatic final org.exoplatform.ws.frameworks.json.JsonParserstatic final Stringstatic final org.exoplatform.commons.api.settings.data.Contextstatic final org.exoplatform.commons.api.settings.data.Scopestatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddIdentityIdsFromProfiles(List<Profile> permissionsProfiles, List<Long> permissions) static final voidaddIdentityMembersFromProfiles(Collection<Profile> profiles, Collection<String> profilesRemoteIds) static final javax.ws.rs.core.ResponsecomputeErrorResponse(org.exoplatform.services.log.Log log, PerkStoreException e, String operationDescription, String username, Object objectToDisplay) static final voidcomputeOrderDeliverStatus(ProductOrder order, double refundedQuantity, double deliveredQuantity) static final voidcomputeOrderPaymentStatus(ProductOrder order, boolean transactionSuccess) static final voiddisplayErrorLog(org.exoplatform.services.log.Log log, String operationDescription, String username, Object objectToDisplay, PerkStoreException e) static final StringformatTransactionHash(String transactionHash) static ProductfromEntity(ProductEntity entity) static ProductOrderfromEntity(ProductOrderEntity entity) static <T> TfromString(Class<T> type, String value) static final booleangetApplicationAccessUsersList(Set<String> recipientUsers, GlobalSettings globalSettings) static final Stringstatic final Localestatic final Stringstatic final StringgetI18NMessage(String messageKey) static org.exoplatform.social.core.identity.model.IdentitygetIdentityById(long identityId) static org.exoplatform.social.core.identity.model.IdentitygetIdentityById(String identityId) static org.exoplatform.social.core.identity.model.IdentitygetIdentityByTypeAndId(String type, String remoteId) static StringgetIdentityIdByType(org.exoplatform.social.core.identity.model.Identity receiverIdentity) static Stringstatic StringgetIdentityTypeByProviderId(String providerId) static ProductOrderPeriodTypegetOrderPeriodicity(String orderPeriodicity) static final StringgetPermissionExpression(org.exoplatform.social.core.identity.model.Identity identity) static final booleangetProductAccessUsersList(Set<String> recipientUsers, Product product, GlobalSettings globalSettings) static final voidgetProductManagersUsersList(Set<String> adminUsers, Product product, GlobalSettings globalSettings) static org.exoplatform.social.core.space.model.Spacestatic longgetTechnicalId(Profile profile) static final LocalegetUserLocale(String username) static final booleanhasPermission(String username, List<Long> identityIds) static booleanisGroupType(String type) static booleanisSpaceType(String type) static final booleanisUserAdmin(String username) static final booleanisUserMemberOf(String username, String permissionExpression) static final booleanisUserMemberOf(String username, List<Profile> permittedProfiles) static booleanisUserType(String type) static voidrefreshProfile(Profile profile) static longstatic ProductOrderEntitytoEntity(ProductEntity productEntity, ProductOrder order) static ProductEntitystatic ProfiletoProfile(long identityId) static Profilestatic StringtransformToString(Object object)
-
Field Details
-
COMETD_CHANNEL
- See Also:
-
SPACE_GROUP_PREFIX
- See Also:
-
JSON_PARSER
public static final org.exoplatform.ws.frameworks.json.JsonParser JSON_PARSER -
JSON_GENERATOR
public static final org.exoplatform.ws.frameworks.json.JsonGenerator JSON_GENERATOR -
SCOPE_NAME
- See Also:
-
SETTINGS_KEY_NAME
- See Also:
-
PERKSTORE_CONTEXT
public static final org.exoplatform.commons.api.settings.data.Context PERKSTORE_CONTEXT -
REWARDING_GROUP
- See Also:
-
PERKSTORE_SCOPE
public static final org.exoplatform.commons.api.settings.data.Scope PERKSTORE_SCOPE -
ERROR_SUFFIX_GLOBAL_SETTINGS_ACCESS
- See Also:
-
ERROR_SUFFIX_GLOBAL_SETTINGS_MODIFICATION
- See Also:
-
ERROR_SUFFIX_ORDER_CREATION
- See Also:
-
ERROR_SUFFIX_ORDER_MODIFICATION
- See Also:
-
ERROR_SUFFIX_ORDER_FRAUD
- See Also:
-
ERROR_SUFFIX_ORDER_NOT_EXISTS
- See Also:
-
ERROR_SUFFIX_ORDER_ACCESS_DENIED
- See Also:
-
ERROR_SUFFIX_PRODUCT_ACCESS_DENIED
- See Also:
-
ERROR_SUFFIX_PRODUCT_CREATION
- See Also:
-
ERROR_SUFFIX_PRODUCT_MODIFICATION
- See Also:
-
ERROR_SUFFIX_PRODUCT_NOT_EXISTS
- See Also:
-
ERROR_SUFFIX_PRODUCT_IS_DISABLED
- See Also:
-
SPACE_ACCOUNT_TYPE
- See Also:
-
USER_ACCOUNT_TYPE
- See Also:
-
GROUP_ACCOUNT_TYPE
- See Also:
-
FAKE_TRANSACTION_HASH
- See Also:
-
SETTINGS_MODIFIED_EVENT
- See Also:
-
PRODUCT_CREATE_OR_MODIFY_EVENT
- See Also:
-
ORDER_CREATE_OR_MODIFY_EVENT
- See Also:
-
-
Method Details
-
fromString
public static <T> T fromString(Class<T> type, String value) throws org.exoplatform.ws.frameworks.json.impl.JsonException - Throws:
org.exoplatform.ws.frameworks.json.impl.JsonException
-
transformToString
-
timeToMilliseconds
-
addIdentityMembersFromProfiles
public static final void addIdentityMembersFromProfiles(Collection<Profile> profiles, Collection<String> profilesRemoteIds) -
addIdentityIdsFromProfiles
-
getIdentityIdByType
public static String getIdentityIdByType(org.exoplatform.social.core.identity.model.Identity receiverIdentity) -
getIdentityById
public static org.exoplatform.social.core.identity.model.Identity getIdentityById(long identityId) -
getIdentityById
public static org.exoplatform.social.core.identity.model.Identity getIdentityById(String identityId) -
getIdentityByTypeAndId
-
isSpaceType
-
isUserType
-
isGroupType
-
getIdentityTypeByProviderId
-
getIdentityProviderIdByType
-
getSpace
-
fromEntity
-
toEntity
-
formatTransactionHash
-
fromEntity
-
toEntity
-
getOrderPeriodicity
-
getTechnicalId
-
refreshProfile
-
toProfile
-
toProfile
-
getCurrentUserId
-
getCurrentUserLocale
- Throws:
Exception
-
getI18NMessage
- Throws:
Exception
-
getUserLocale
- Throws:
Exception
-
computeOrderDeliverStatus
public static final void computeOrderDeliverStatus(ProductOrder order, double refundedQuantity, double deliveredQuantity) -
computeOrderPaymentStatus
-
computeErrorResponse
public static final javax.ws.rs.core.Response computeErrorResponse(org.exoplatform.services.log.Log log, PerkStoreException e, String operationDescription, String username, Object objectToDisplay) -
displayErrorLog
public static final void displayErrorLog(org.exoplatform.services.log.Log log, String operationDescription, String username, Object objectToDisplay, PerkStoreException e) -
getErrorJSONFormat
- Throws:
org.json.JSONException
-
getApplicationAccessUsersList
public static final boolean getApplicationAccessUsersList(Set<String> recipientUsers, GlobalSettings globalSettings) -
getProductAccessUsersList
public static final boolean getProductAccessUsersList(Set<String> recipientUsers, Product product, GlobalSettings globalSettings) -
getProductManagersUsersList
public static final void getProductManagersUsersList(Set<String> adminUsers, Product product, GlobalSettings globalSettings) throws Exception - Throws:
Exception
-
isUserAdmin
- Throws:
Exception
-
hasPermission
- Throws:
Exception
-
getPermissionExpression
public static final String getPermissionExpression(org.exoplatform.social.core.identity.model.Identity identity) -
isUserMemberOf
-
isUserMemberOf
public static final boolean isUserMemberOf(String username, String permissionExpression) throws Exception - Throws:
Exception
-