Class SocialNotificationUtils


  • public class SocialNotificationUtils
    extends Object
    • 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
      • ORIGINAL_TITLE

        public static final org.exoplatform.commons.api.notification.model.ArgumentLiteral<String> ORIGINAL_TITLE
      • ORIGINAL_TITLE_SHARED

        public static final org.exoplatform.commons.api.notification.model.ArgumentLiteral<String> ORIGINAL_TITLE_SHARED
      • 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
      • 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
    • Constructor Detail

      • SocialNotificationUtils

        public SocialNotificationUtils()
    • Method Detail

      • getUserId

        public static String getUserId​(String identityId)
      • toListUserIds

        public static List<String> toListUserIds​(String... userIds)
      • 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:
      • 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)
      • processImageTitle

        public static String processImageTitle​(String body,
                                               String placeholder)
      • getImagePlaceHolder

        public static String getImagePlaceHolder​(String language)
      • 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)
      • mergeUsers

        public static List<String> mergeUsers​(org.exoplatform.commons.api.notification.model.NotificationInfo notification,
                                              String propertyName,
                                              String activityId,
                                              String userId)