Class LinkProvider
java.lang.Object
org.exoplatform.social.core.service.LinkProvider
Builds and provides default links and links of users, spaces and activities.
Links are built basing on provided information as name or Id of the target user or space.
In case something is wrong when building, the default links will be returned.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final longstatic 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 String -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbuildAvatarURL(String providerId, String remoteId) Deprecated.static StringbuildAvatarURL(String providerId, String id, boolean byId, Long lastModifiedDate) static StringbuildAvatarURL(String providerId, String remoteId, Long lastModifiedDate) Builds the avatar URL for a given profilestatic StringbuildBannerURL(String providerId, String id) Deprecated.userbuildBannerURL(String, String, boolean, Long)to use browser cachestatic StringbuildBannerURL(String providerId, String id, boolean byId, Long lastModifiedDate) static StringbuildBannerURL(String providerId, String id, Long lastModifiedDate) Builds the banner URL for a given profilestatic StringbuildSiteBannerUrl(String siteName, long bannerFileId) static StringgenerateAttachmentToken(String providerId, String remoteId, String attachmentType, String lastModifiedDate) static StringgetAbsoluteProfileUrl(String userName, String portalName, String portalOwner, String host) Gets an absolute profile URL of a user.static StringgetActivityUri(String providerId, String remoteId) Gets URI to an activity stream of space or user.static StringgetActivityUriForSpace(String remoteId, String groupId) Gets an activity URI of the space.static Stringstatic Stringstatic Stringstatic Stringstatic StringgetCurrentUserLanguage(String userId) Gets platform language of current user.static Localestatic StringgetGroupRoleLabel(String role, Locale locale) static StringgetGroupRoleLink(String role, String identityId, Locale locale) static org.exoplatform.social.core.manager.IdentityManagerGets an IdentityManager instance.static StringgetPortalName(String portalName) Gets a portal name.static StringgetPortalOwner(String portalOwner) Gets a portal owner.static StringgetProfileLink(String username) Gets a link to the user profile.static StringgetProfileLink(String username, String portalOwner) Gets a link to the user profile on a portal.static StringgetProfileUri(String username) Gets URI to a user profile by username.static StringgetProfileUri(String username, String portalOwner) Gets URI to a user profile by username and owner portal.static StringgetRedirectSpaceUri(String type) static StringgetRedirectUri(String type) Gets the link of all spaces pagestatic StringgetResourceBundleLabel(Locale locale, String label) Gets the resource bundle label.static StringgetSingleActivityUrl(String activityId) static org.exoplatform.social.core.space.spi.SpaceServicestatic StringgetSpaceUri(String prettyName) Gets URI to a space profile by its pretty name.static StringgetUserActivityUri(String remoteId) Gets the activity URI of a user.static StringgetUserNotificationSettingUri(String remoteId) Gets the link of notification settings pagestatic StringgetUserProfileUri(String remoteId) Gets URI to a user profile.static booleanisAttachmentTokenValid(String token, String providerId, String remoteId, String attachmentType, String lastModifiedDate)
-
Field Details
-
RESOURCE_URL
- See Also:
-
JAVASCRIPT_RESOURCE_URL
- See Also:
-
PROFILE_DEFAULT_AVATAR_URL
- See Also:
-
SPACE_DEFAULT_AVATAR_URL
- See Also:
-
HAS_CONNECTION_ICON
- See Also:
-
WAITING_CONFIRMATION_ICON
- See Also:
-
SPACE_MANAGER_ICON
- See Also:
-
SPACE_MEMBER_ICON
- See Also:
-
SPACE_WAITING_CONFIRM_ICON
- See Also:
-
STARTER_ACTIVITY_AVATAR
- See Also:
-
STARTER_ACTIVITY_IMAGE
- See Also:
-
ROUTE_DELIMITER
- See Also:
-
DEFAULT_IMAGES_LAST_MODIFED
public static final long DEFAULT_IMAGES_LAST_MODIFED -
DEFAULT_IMAGE_REMOTE_ID
- See Also:
-
TYPE
- See Also:
-
BASE_URL_SITE_REST_API
- See Also:
-
ATTACHMENT_BANNER_TYPE
- See Also:
-
-
Method Details
-
getSpaceUri
Gets URI to a space profile by its pretty name.- Parameters:
prettyName- The pretty name of space.- Returns:
- The URI.
- Since:
- 1.2.0 GA
- eXo level API
- Platform
-
getProfileUri
Gets URI to a user profile by username.- Parameters:
username- The name of user (remoteId).- Returns:
- The URI.
- eXo level API
- Platform
-
getProfileUri
Gets URI to a user profile by username and owner portal.- Parameters:
username- The name of user (remoteId).portalOwner- The portal owner (for example, classic or public).- Returns:
- The URI.
- eXo level API
- Platform
-
getProfileLink
Gets a link to the user profile.- Parameters:
username- The name of user (remoteId).- Returns:
- The link.
- eXo level API
- Platform
-
getProfileLink
Gets a link to the user profile on a portal.- Parameters:
username- The name of user (remoteId).portalOwner- The portal owner (for example, classic or public).- Returns:
- The link.
- eXo level API
- Platform
-
getGroupRoleLink
-
getGroupRoleLabel
-
getAbsoluteProfileUrl
public static String getAbsoluteProfileUrl(String userName, String portalName, String portalOwner, String host) Gets an absolute profile URL of a user.- Parameters:
userName- The name of user (remoteId).portalName- The name of current portal.portalOwner- The portal owner (for example, classic or public).host- The name of the provided host.- Returns:
- The absolute profile URL.
- eXo level API
- Platform
-
getUserActivityUri
Gets the activity URI of a user.- Parameters:
remoteId- Name of the user, for example root.- Returns:
- The activity link.
- eXo level API
- Platform
-
getUserProfileUri
Gets URI to a user profile.- Parameters:
remoteId- The name of user (remoteId), for example root.- Returns:
- The link to profile of provided user.
- eXo level API
- Platform
-
getActivityUri
Gets URI to an activity stream of space or user.- Parameters:
providerId- The provider information.remoteId- Id of the target identity, for example organization:root or space:abc_def.- Returns:
- The link to activity of provided user on the provided provider.
- eXo level API
- Platform
-
getSingleActivityUrl
- Parameters:
activityId-- Returns:
-
getActivityUriForSpace
Gets an activity URI of the space.- Parameters:
remoteId- The Id of target space.groupId- The group Id of target space.- Returns:
- The URI.
- Since:
- 1.2.8
- eXo level API
- Platform
-
getUserNotificationSettingUri
Gets the link of notification settings page- Parameters:
remoteId-- Returns:
-
getRedirectUri
Gets the link of all spaces page- Returns:
-
getRedirectSpaceUri
-
getIdentityManager
public static org.exoplatform.social.core.manager.IdentityManager getIdentityManager()Gets an IdentityManager instance.- Returns:
- The IdentityManager.
-
getSpaceService
public static org.exoplatform.social.core.space.spi.SpaceService getSpaceService() -
buildAvatarURL
Deprecated.userbuildAvatarURL(String, String, boolean, Long)to use browser cacheBuilds the avatar URL for a given profile- Parameters:
providerId-remoteId-- Returns:
-
buildAvatarURL
Builds the avatar URL for a given profile- Parameters:
providerId-remoteId-lastModifiedDate- last modified date of avatar- Returns:
-
buildAvatarURL
-
buildBannerURL
Deprecated.userbuildBannerURL(String, String, boolean, Long)to use browser cacheBuilds the banner URL for a given profile- Parameters:
providerId-id-- Returns:
-
buildBannerURL
Builds the banner URL for a given profile- Parameters:
providerId-id-lastModifiedDate- last modified date of avatar- Returns:
-
buildBannerURL
-
generateAttachmentToken
-
isAttachmentTokenValid
-
getPortalOwner
Gets a portal owner. If the parameter is null or "", the method returns a default portal owner.- Parameters:
portalOwner- The owner of portal (for example, classic or public).- Returns:
- The portal owner.
-
getPortalName
Gets a portal name. If the parameter is null or "", the method returns a default portal name.- Parameters:
portalName- The name of portal.- Returns:
- The portal name.
-
getBaseURLSocialSpaceRest
-
getBaseURLSocialUserRest
-
getBaseURLSocialRest
-
getCurrentUserLanguage
Gets platform language of current user. In case of any errors return null.- Returns:
- the platform language
-
getResourceBundleLabel
Gets the resource bundle label.- Returns:
- the label
-
getDefaultLocale
-
getBaseURLSiteRest
-
buildSiteBannerUrl
-
buildAvatarURL(String, String, boolean, Long)to use browser cache