Class LinkProvider

java.lang.Object
org.exoplatform.social.core.service.LinkProvider

public class LinkProvider extends Object
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 Details

  • Method Details

    • getSpaceUri

      public static String getSpaceUri(String prettyName)
      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

      public static String getProfileUri(String username)
      Gets URI to a user profile by username.
      Parameters:
      username - The name of user (remoteId).
      Returns:
      The URI.
      eXo level API
      Platform
    • getProfileUri

      public static String getProfileUri(String username, String portalOwner)
      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

      public static String getProfileLink(String username)
      Gets a link to the user profile.
      Parameters:
      username - The name of user (remoteId).
      Returns:
      The link.
      eXo level API
      Platform
    • getProfileLink

      public static String getProfileLink(String username, String portalOwner)
      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

      public static String getGroupRoleLink(String role, String identityId, Locale locale)
    • getGroupRoleLabel

      public static String getGroupRoleLabel(String role, Locale locale)
    • 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

      public static String getUserActivityUri(String remoteId)
      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

      public static String getUserProfileUri(String remoteId)
      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

      public static String getActivityUri(String providerId, String remoteId)
      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

      public static String getSingleActivityUrl(String activityId)
      Parameters:
      activityId -
      Returns:
    • getActivityUriForSpace

      public static String getActivityUriForSpace(String remoteId, String groupId)
      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

      public static String getUserNotificationSettingUri()
      Returns:
      the link of notification settings page
    • getRedirectUri

      public static String getRedirectUri(String type)
      Gets the link of all spaces page
      Returns:
    • 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

      public static String buildAvatarURL(String providerId, String remoteId, Long lastModifiedDate)
      Builds the avatar URL for a given profile
      Parameters:
      providerId -
      remoteId -
      lastModifiedDate - last modified date of avatar
      Returns:
    • buildAvatarURL

      public static String buildAvatarURL(String providerId, String id, boolean byId, Long lastModifiedDate)
    • buildBannerURL

      public static String buildBannerURL(String providerId, String id, Long lastModifiedDate)
      Builds the banner URL for a given profile
      Parameters:
      providerId -
      id -
      lastModifiedDate - last modified date of avatar
      Returns:
    • buildBannerURL

      public static String buildBannerURL(String providerId, String id, boolean byId, Long lastModifiedDate)
    • generateAttachmentToken

      public static String generateAttachmentToken(String providerId, String remoteId, String attachmentType, String lastModifiedDate)
    • isAttachmentTokenValid

      public static boolean isAttachmentTokenValid(String token, String providerId, String remoteId, String attachmentType, String lastModifiedDate)
    • getPortalOwner

      public static String getPortalOwner(String portalOwner)
      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

      public static String getPortalName(String portalName)
      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

      public static String getBaseURLSocialSpaceRest()
    • getBaseURLSocialUserRest

      public static String getBaseURLSocialUserRest()
    • getBaseURLSocialRest

      public static String getBaseURLSocialRest()
    • getCurrentUserLanguage

      public static String getCurrentUserLanguage(String userId)
      Gets platform language of current user. In case of any errors return null.
      Returns:
      the platform language
    • getResourceBundleLabel

      public static String getResourceBundleLabel(Locale locale, String label)
      Gets the resource bundle label.
      Returns:
      the label
    • getDefaultLocale

      public static Locale getDefaultLocale()
    • getBaseURLSiteRest

      public static String getBaseURLSiteRest()
    • buildSiteBannerUrl

      public static String buildSiteBannerUrl(String siteName, long bannerFileId)