Class SocialNotificationUtils
- java.lang.Object
-
- org.exoplatform.social.notification.plugin.SocialNotificationUtils
-
public class SocialNotificationUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringA_HREF_TAG_REGEXstatic org.exoplatform.commons.api.notification.model.ArgumentLiteral<org.exoplatform.social.core.activity.model.ExoSocialActivity>ACTIVITYstatic org.exoplatform.commons.api.notification.model.ArgumentLiteral<String>ACTIVITY_IDstatic org.exoplatform.commons.api.notification.model.ArgumentLiteral<String>COMMENT_IDstatic org.exoplatform.commons.api.notification.model.ArgumentLiteral<String>COMMENT_REPLY_IDstatic org.exoplatform.commons.api.notification.model.ArgumentLiteral<Long>DLP_DETECTED_ITEM_IDstatic org.exoplatform.commons.api.notification.model.ArgumentLiteral<String>DLP_RESTORED_ITEM_AUTHORstatic org.exoplatform.commons.api.notification.model.ArgumentLiteral<String>DLP_RESTORED_ITEM_REFERENCEstatic org.exoplatform.commons.api.notification.model.ArgumentLiteral<String>DLP_RESTORED_ITEM_TITLEstatic StringDOT_STRINGstatic StringEMPTY_STRstatic PatternIMG_SRC_REGEXstatic org.exoplatform.commons.api.notification.model.ArgumentLiteral<String>LIKERstatic org.exoplatform.commons.api.notification.model.ArgumentLiteral<String>MFA_REVOCATION_REQUEST_REQUESTERstatic org.exoplatform.commons.api.notification.model.ArgumentLiteral<String>PARENT_ACTIVITY_IDstatic org.exoplatform.commons.api.notification.model.ArgumentLiteral<String>POSTERstatic org.exoplatform.commons.api.notification.model.ArgumentLiteral<String>PRETTY_NAMEstatic org.exoplatform.commons.api.notification.model.ArgumentLiteral<org.exoplatform.social.core.identity.model.Profile>PROFILEstatic org.exoplatform.commons.api.notification.model.ArgumentLiteral<org.exoplatform.social.core.relationship.model.Relationship>RELATIONSHIPstatic org.exoplatform.commons.api.notification.model.ArgumentLiteral<String>RELATIONSHIP_IDstatic org.exoplatform.commons.api.notification.model.ArgumentLiteral<String>REMOTE_IDstatic org.exoplatform.commons.api.notification.model.ArgumentLiteral<String>REQUEST_FROMstatic org.exoplatform.commons.api.notification.model.ArgumentLiteral<String>SENDERstatic org.exoplatform.commons.api.notification.model.ArgumentLiteral<org.exoplatform.social.core.space.model.Space>SPACEstatic org.exoplatform.commons.api.notification.model.ArgumentLiteral<String>SPACE_IDstatic StringSPACE_STR
-
Constructor Summary
Constructors Constructor Description SocialNotificationUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddFooterAndFirstName(String remoteId, org.exoplatform.commons.api.notification.service.template.TemplateContext templateContext)static org.exoplatform.commons.api.notification.model.NotificationInfoaddUserToPreviousNotification(org.exoplatform.commons.api.notification.model.NotificationInfo notification, String propertyName, String activityId, String userId)static StringbuildRedirecActivityUrl(String type, String id, String activityTitle)static StringbuildRedirecUrl(String type, String id, String name)static StringgetBody(org.exoplatform.commons.api.notification.NotificationContext ctx, org.exoplatform.commons.api.notification.service.template.TemplateContext context, org.exoplatform.social.core.activity.model.ExoSocialActivity activity)static StringgetImagePlaceHolder(String language)static StringgetMessageByIds(Map<String,List<String>> receiversMap, Map<String,List<org.apache.commons.lang3.tuple.Pair<String,String>>> activityUserComments, org.exoplatform.commons.api.notification.service.template.TemplateContext templateContext)static StringgetMessageByIds(Map<String,List<String>> receiversMap, org.exoplatform.commons.api.notification.service.template.TemplateContext templateContext)static StringgetMessageByIds(Map<String,List<String>> receiversMap, org.exoplatform.commons.api.notification.service.template.TemplateContext templateContext, String type)static StringgetMessageInSpace(Map<String,List<String>> receiversMap, org.exoplatform.commons.api.notification.service.template.TemplateContext templateContext)static StringgetUserId(String identityId)static booleanisSpaceActivity(org.exoplatform.social.core.activity.model.ExoSocialActivity activity)static List<String>mergeUsers(org.exoplatform.commons.api.notification.model.NotificationInfo notification, String propertyName, String activityId, String userId)static StringprocessImageTitle(String body, String placeholder)static voidprocessInforSendTo(Map<String,List<String>> map, String key, String value)static voidprocessInforUserComments(Map<String,List<org.apache.commons.lang3.tuple.Pair<String,String>>> map, String key, org.apache.commons.lang3.tuple.Pair<String,String> value)static List<String>toListUserIds(String... userIds)
-
-
-
Field Detail
-
IMG_SRC_REGEX
public static final Pattern IMG_SRC_REGEX
-
ACTIVITY_ID
public static final org.exoplatform.commons.api.notification.model.ArgumentLiteral<String> ACTIVITY_ID
-
COMMENT_ID
public static final org.exoplatform.commons.api.notification.model.ArgumentLiteral<String> COMMENT_ID
-
COMMENT_REPLY_ID
public static final org.exoplatform.commons.api.notification.model.ArgumentLiteral<String> COMMENT_REPLY_ID
-
PARENT_ACTIVITY_ID
public static final org.exoplatform.commons.api.notification.model.ArgumentLiteral<String> PARENT_ACTIVITY_ID
-
POSTER
public static final org.exoplatform.commons.api.notification.model.ArgumentLiteral<String> POSTER
-
LIKER
public static final org.exoplatform.commons.api.notification.model.ArgumentLiteral<String> LIKER
-
SENDER
public static final org.exoplatform.commons.api.notification.model.ArgumentLiteral<String> SENDER
-
ACTIVITY
public static final org.exoplatform.commons.api.notification.model.ArgumentLiteral<org.exoplatform.social.core.activity.model.ExoSocialActivity> ACTIVITY
-
PROFILE
public static final org.exoplatform.commons.api.notification.model.ArgumentLiteral<org.exoplatform.social.core.identity.model.Profile> PROFILE
-
SPACE
public static final org.exoplatform.commons.api.notification.model.ArgumentLiteral<org.exoplatform.social.core.space.model.Space> SPACE
-
REMOTE_ID
public static final org.exoplatform.commons.api.notification.model.ArgumentLiteral<String> REMOTE_ID
-
SPACE_ID
public static final org.exoplatform.commons.api.notification.model.ArgumentLiteral<String> SPACE_ID
-
REQUEST_FROM
public static final org.exoplatform.commons.api.notification.model.ArgumentLiteral<String> REQUEST_FROM
-
PRETTY_NAME
public static final org.exoplatform.commons.api.notification.model.ArgumentLiteral<String> PRETTY_NAME
-
RELATIONSHIP
public static final org.exoplatform.commons.api.notification.model.ArgumentLiteral<org.exoplatform.social.core.relationship.model.Relationship> RELATIONSHIP
-
RELATIONSHIP_ID
public static final org.exoplatform.commons.api.notification.model.ArgumentLiteral<String> RELATIONSHIP_ID
-
MFA_REVOCATION_REQUEST_REQUESTER
public static final org.exoplatform.commons.api.notification.model.ArgumentLiteral<String> MFA_REVOCATION_REQUEST_REQUESTER
-
DLP_DETECTED_ITEM_ID
public static final org.exoplatform.commons.api.notification.model.ArgumentLiteral<Long> DLP_DETECTED_ITEM_ID
-
DLP_RESTORED_ITEM_TITLE
public static final org.exoplatform.commons.api.notification.model.ArgumentLiteral<String> DLP_RESTORED_ITEM_TITLE
-
DLP_RESTORED_ITEM_REFERENCE
public static final org.exoplatform.commons.api.notification.model.ArgumentLiteral<String> DLP_RESTORED_ITEM_REFERENCE
-
DLP_RESTORED_ITEM_AUTHOR
public static final org.exoplatform.commons.api.notification.model.ArgumentLiteral<String> DLP_RESTORED_ITEM_AUTHOR
-
EMPTY_STR
public static final String EMPTY_STR
- See Also:
- Constant Field Values
-
SPACE_STR
public static final String SPACE_STR
- See Also:
- Constant Field Values
-
DOT_STRING
public static final String DOT_STRING
- See Also:
- Constant Field Values
-
A_HREF_TAG_REGEX
public static final String A_HREF_TAG_REGEX
- See Also:
- Constant Field Values
-
-
Method Detail
-
isSpaceActivity
public static boolean isSpaceActivity(org.exoplatform.social.core.activity.model.ExoSocialActivity activity)
-
getMessageInSpace
public static String getMessageInSpace(Map<String,List<String>> receiversMap, org.exoplatform.commons.api.notification.service.template.TemplateContext templateContext)
- Parameters:
receiversMap-templateContext-- Returns:
-
getMessageByIds
public static String getMessageByIds(Map<String,List<String>> receiversMap, org.exoplatform.commons.api.notification.service.template.TemplateContext templateContext)
-
getMessageByIds
public static String getMessageByIds(Map<String,List<String>> receiversMap, Map<String,List<org.apache.commons.lang3.tuple.Pair<String,String>>> activityUserComments, org.exoplatform.commons.api.notification.service.template.TemplateContext templateContext)
- Parameters:
receiversMap-activityUserComments-templateContext-- Returns:
-
getMessageByIds
public static String getMessageByIds(Map<String,List<String>> receiversMap, org.exoplatform.commons.api.notification.service.template.TemplateContext templateContext, String type)
- Parameters:
receiversMap-templateContext-type-- Returns:
-
processInforSendTo
public static void processInforSendTo(Map<String,List<String>> map, String key, String value)
-
processInforUserComments
public static void processInforUserComments(Map<String,List<org.apache.commons.lang3.tuple.Pair<String,String>>> map, String key, org.apache.commons.lang3.tuple.Pair<String,String> value)
-
buildRedirecActivityUrl
public static String buildRedirecActivityUrl(String type, String id, String activityTitle)
-
addFooterAndFirstName
public static void addFooterAndFirstName(String remoteId, org.exoplatform.commons.api.notification.service.template.TemplateContext templateContext)
-
getBody
public static String getBody(org.exoplatform.commons.api.notification.NotificationContext ctx, org.exoplatform.commons.api.notification.service.template.TemplateContext context, org.exoplatform.social.core.activity.model.ExoSocialActivity activity)
-
addUserToPreviousNotification
public static org.exoplatform.commons.api.notification.model.NotificationInfo addUserToPreviousNotification(org.exoplatform.commons.api.notification.model.NotificationInfo notification, String propertyName, String activityId, String userId)
-
-