public class Utils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ACTIVITY_STREAM_TAB_SELECTED_COOKIED
.
|
static String |
ACTIVITY_STREAM_VISITED_PREFIX_COOKIED |
static String |
FROM |
static String |
LAST_UPDATED_ACTIVITIES_NUM |
static String |
NOT_SEEN_ACTIVITIES_COOKIES
.
|
static String |
OLD_FROM |
static String |
SEEN_ACTIVITIES_COOKIES |
static String |
TO |
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
appRes(String msgKey)
Get Resource bundle.
|
static String |
centerTrunc(String str,
int head,
int tail)
Truncates large Strings showing a portion of the String's head and tail
with the center cut out and replaced with '...'.
|
static void |
clearCacheOnUserPopup()
Clears cached user data on user profile popup.
|
static void |
clearUserProfilePopup()
Clear user profile popup.
|
static void |
displayFeedbackMessageInline(String parentId)
Display the feedback message inline instead of show on popup
|
static String |
getActivityID()
Get activity's id
|
static org.exoplatform.social.core.manager.ActivityManager |
getActivityManager()
Gets activityManager
|
static String |
getCookies(String key) |
static org.exoplatform.social.common.router.ExoRouter |
getExoRouter()
Gets ExoRouter
|
static String |
getHeader(String param)
Gets the header parameter
|
static org.exoplatform.social.core.manager.IdentityManager |
getIdentityManager()
Gets identityManager
|
static long |
getLastVisited(String key,
String mode) |
static List<org.exoplatform.social.core.identity.model.Identity> |
getOwnerFriends()
Gets list of friends of owner user
|
static org.exoplatform.social.core.identity.model.Identity |
getOwnerIdentity()
Gets identity of owner user.
|
static org.exoplatform.social.core.identity.model.Identity |
getOwnerIdentity(boolean loadProfile)
Gets identity of owner user.
|
static String |
getOwnerRemoteId()
Gets remote id of owner user (depends on URL: .../remoteId).
|
static org.exoplatform.social.core.identity.model.Identity |
getOwnerSpaceIdentity()
Gets space identity of the owner space (from remote id)
|
static org.exoplatform.social.core.relationship.model.Relationship |
getRelationship(org.exoplatform.social.core.identity.model.Identity identity) |
static org.exoplatform.social.core.manager.RelationshipManager |
getRelationshipManager()
Gets relationshipManager
|
static String |
getResolvedAppLabel(org.exoplatform.portal.mop.user.UserNode userNode)
Gets resolved application label by input user node.
|
static String |
getSelectedNode()
Gets selected node name.
|
static org.exoplatform.social.core.space.model.Space |
getSpaceByContext() |
static String |
getSpaceHomeURL(org.exoplatform.social.core.space.model.Space space)
Gets the space home url of a space.
|
static org.exoplatform.social.core.identity.model.Identity |
getSpaceIdentity(String spaceName,
boolean loadProfile)
Gets identity from the remote id (space name)
|
static org.exoplatform.social.core.space.spi.SpaceService |
getSpaceService()
Gets spaceService
|
static String |
getSpaceURL(org.exoplatform.portal.mop.user.UserNode node)
Get the space url.
|
static String |
getSpaceUrlByContext()
Gets the space url based on the current context.
|
static String |
getURI(String url)
Get the uri.
|
static org.exoplatform.social.core.identity.model.Identity |
getUserIdentity(String userName,
boolean loadProfile)
Gets identity from the remote id (user name)
|
static String |
getValueFromRefererURI(String param)
Gets query value from Referer URI in request header.
|
static String |
getValueFromRequestParam(String param) |
static List<org.exoplatform.social.core.identity.model.Identity> |
getViewerFriends()
Gets list of friends of viewer user
|
static org.exoplatform.social.core.identity.model.Identity |
getViewerIdentity()
Gets identity of viewer user (logged-in user).
|
static org.exoplatform.social.core.identity.model.Identity |
getViewerIdentity(boolean loadProfile)
Gets identity of viewer user (logged-in user).
|
static String |
getViewerRemoteId()
Gets remote id of viewer user.
|
static boolean |
hasCookies(String key) |
static void |
initUserProfilePopup(String uiActivityId)
Initializes user profile popup.
|
static boolean |
isExpandLikers()
Check the request param of url to verify if need expand all likers
|
static boolean |
isFocusCommentBox()
Check the request param of url to verify if need focus to comment box
|
static boolean |
isHomePage()
Determines current displayed page is Home or not base on selected node.
|
static boolean |
isOwner()
Checks if the owner user is the viewer user.
|
static boolean |
isRefreshPage()
Checks the page in refresh context or switch from other one to it.
|
static boolean |
isSpaceContext()
Check whether is being in a space context or not.
|
static String |
listToString(List<String> list,
String separator) |
static String |
normalizeString(String str)
Trim space characters at the beginning and end of string.
|
static void |
resizeHomePage()
Resizes the height of Home page.
|
static void |
setCookies(String key,
String value) |
static void |
setCurrentNavigationData(String siteType,
String siteName,
String path) |
static void |
setLastVisited(String mode) |
static String |
trunc(String str,
int head)
Truncates large Strings showing a portion of the String's head and tail
with the head cut out and replaced with '...'.
|
static void |
updateWorkingWorkSpace()
Updates working work space.
|
public static final String ACTIVITY_STREAM_TAB_SELECTED_COOKIED
public static final String ACTIVITY_STREAM_VISITED_PREFIX_COOKIED
public static final String LAST_UPDATED_ACTIVITIES_NUM
public static final String FROM
public static final String OLD_FROM
public static final String TO
public static final String NOT_SEEN_ACTIVITIES_COOKIES
public static final String SEEN_ACTIVITIES_COOKIES
public static String getOwnerRemoteId()
public static String getViewerRemoteId()
public static boolean isOwner()
public static org.exoplatform.social.core.identity.model.Identity getOwnerIdentity(boolean loadProfile)
loadProfile - public static org.exoplatform.social.core.identity.model.Identity getViewerIdentity(boolean loadProfile)
loadProfile - public static org.exoplatform.social.core.identity.model.Identity getOwnerIdentity()
public static org.exoplatform.social.core.identity.model.Identity getViewerIdentity()
public static org.exoplatform.social.core.identity.model.Identity getUserIdentity(String userName, boolean loadProfile)
userName - loadProfile - public static org.exoplatform.social.core.identity.model.Identity getSpaceIdentity(String spaceName, boolean loadProfile)
spaceName - loadProfile - public static org.exoplatform.social.core.identity.model.Identity getOwnerSpaceIdentity()
public static List<org.exoplatform.social.core.identity.model.Identity> getOwnerFriends() throws Exception
Exceptionpublic static List<org.exoplatform.social.core.identity.model.Identity> getViewerFriends() throws Exception
Exceptionpublic static void updateWorkingWorkSpace()
public static final org.exoplatform.social.core.manager.ActivityManager getActivityManager()
public static final org.exoplatform.social.core.manager.IdentityManager getIdentityManager()
public static final org.exoplatform.social.core.manager.RelationshipManager getRelationshipManager()
public static final org.exoplatform.social.core.relationship.model.Relationship getRelationship(org.exoplatform.social.core.identity.model.Identity identity)
throws Exception
identity - Exceptionpublic static final org.exoplatform.social.core.space.spi.SpaceService getSpaceService()
public static final org.exoplatform.social.common.router.ExoRouter getExoRouter()
public static String getActivityID()
public static boolean isFocusCommentBox()
public static boolean isExpandLikers()
public static String getHeader(String param)
param - public static String getValueFromRefererURI(String param)
param - public static void displayFeedbackMessageInline(String parentId)
public static String getSelectedNode()
public static String getSpaceURL(org.exoplatform.portal.mop.user.UserNode node)
node - public static String getSpaceHomeURL(org.exoplatform.social.core.space.model.Space space)
space - public static boolean hasCookies(String key)
public static void setLastVisited(String mode)
public static void setCurrentNavigationData(String siteType, String siteName, String path)
requestNavData - public static boolean isRefreshPage()
public static boolean isHomePage()
public static final String centerTrunc(String str, int head, int tail)
str - the string to truncatehead - the amount of the head to displaytail - the amount of the tail to displaypublic static final String trunc(String str, int head)
str - the string to truncatehead - the amount of the head to displaypublic static String normalizeString(String str)
str - public static boolean isSpaceContext()
public static String getSpaceUrlByContext()
public static void resizeHomePage()
public static void initUserProfilePopup(String uiActivityId)
uiActivityId - Id of activity component.public static void clearUserProfilePopup()
uiActivityId - Id of activity component.public static org.exoplatform.social.core.space.model.Space getSpaceByContext()
public static void clearCacheOnUserPopup()
public static String appRes(String msgKey)
msgKey - key to get resource bundlepublic static String getResolvedAppLabel(org.exoplatform.portal.mop.user.UserNode userNode)
userNode - user nodeCopyright © 2003–2015 eXo Platform SAS. All rights reserved.