public class Utils extends Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
formatContent(String content)
Get 150 first characters of a string
|
static org.exoplatform.social.core.manager.ActivityManager |
getActivityManager() |
static List<String> |
getDestinataires(org.exoplatform.social.core.activity.model.ExoSocialActivity activity,
org.exoplatform.social.core.space.model.Space space)
Gets remote Ids of all users who receive a notification message when an activity is posted in a space.
|
static org.exoplatform.social.core.manager.IdentityManager |
getIdentityManager() |
static Set<String> |
getMentioners(String title,
String posterId)
Gets the list of mentioners in a message that is not the poster
|
static org.exoplatform.social.core.manager.RelationshipManager |
getRelationshipManager() |
static <T> T |
getService(Class<T> clazz) |
static org.exoplatform.commons.api.notification.service.storage.NotificationDataStorage |
getSocialEmailStorage() |
static org.exoplatform.social.core.space.spi.SpaceService |
getSpaceService() |
static String |
getUserId(String identityId)
Gets a remote Id from a user's identity Id.
|
static boolean |
isSpaceActivity(org.exoplatform.social.core.activity.model.ExoSocialActivity activity)
Checks if an activity is created in a space or not.
|
static boolean |
isValidUrl(String url)
Validates URL.
|
static String |
processLinkTitle(String title) |
static String |
processMentions(String title)
Finds all mention prefixes from an activity title, then adds a domain name to ensure the link to a user profile is correct.
|
static void |
sendToActivityPoster(Set<String> receivers,
String activityPosterId,
String posteId)
Checks if a notification message is sent to an activity poster when a new comment is created.
|
static void |
sendToCommeters(Set<String> receivers,
String[] commenters,
String poster) |
static void |
sendToMentioners(Set<String> receivers,
String[] mentioners,
String poster) |
static void |
sendToStreamOwner(Set<String> receivers,
String streamOwner,
String posteId)
Checks if a notification message is sent to a stream owner or not.
|
static List<String> |
toListUserIds(String... userIds)
Converts an array of remote user Ids into a list.
|
public static <T> T getService(Class<T> clazz)
public static org.exoplatform.commons.api.notification.service.storage.NotificationDataStorage getSocialEmailStorage()
public static String getUserId(String identityId)
identityId - The user's identity Id.public static List<String> toListUserIds(String... userIds)
userIds - The remote user Ids.public static boolean isSpaceActivity(org.exoplatform.social.core.activity.model.ExoSocialActivity activity)
activity - The activity to be checked.public static void sendToCommeters(Set<String> receivers, String[] commenters, String poster)
public static void sendToStreamOwner(Set<String> receivers, String streamOwner, String posteId)
receivers - The list of users receiving the notification message.streamOwner - The owner of activity stream.posteId - Id of the user who has posted the activity.public static void sendToActivityPoster(Set<String> receivers, String activityPosterId, String posteId)
receivers - The list of users receiving the notification message.activityPosterId - Id of the activity poster.posteId - Id of the user who has commented.public static void sendToMentioners(Set<String> receivers, String[] mentioners, String poster)
public static String processMentions(String title)
title - The activity title.public static Set<String> getMentioners(String title, String posterId)
title - the activity titleposterId - id of the posterpublic static boolean isValidUrl(String url)
url - string to validatepublic static List<String> getDestinataires(org.exoplatform.social.core.activity.model.ExoSocialActivity activity, org.exoplatform.social.core.space.model.Space space)
activity - The created activity.space - The space which contains the activity.public static String formatContent(String content)
content - public static org.exoplatform.social.core.manager.IdentityManager getIdentityManager()
public static org.exoplatform.social.core.space.spi.SpaceService getSpaceService()
public static org.exoplatform.social.core.manager.ActivityManager getActivityManager()
public static org.exoplatform.social.core.manager.RelationshipManager getRelationshipManager()
Copyright © 2003–2015 eXo Platform SAS. All rights reserved.