/** * Returns the user's display URL based on the theme display, discounting * the URL of the user's default intranet site home page. * * <p> * The logic for the display URL to return is as follows: * </p> * * <ol> * <li> * If the user is the guest user, return an empty string. * </li> * <li> * Else, if a friendly URL is available for the user's profile, return that * friendly URL. * </li> * <li> * Otherwise, return the URL of the user's default extranet site home page. * </li> * </ol> * * @param themeDisplay the theme display * @return the user's display URL */ @Override public String getDisplayURL( com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay) throws com.liferay.portal.kernel.exception.PortalException { return _user.getDisplayURL(themeDisplay); }
boolean privateLayout) throws com.liferay.portal.kernel.exception.PortalException { return _user.getDisplayURL(themeDisplay, privateLayout);
public String getDisplayURL(String portalURL, String mainPath) throws com.liferay.portal.kernel.exception.PortalException { return _user.getDisplayURL(portalURL, mainPath);
boolean privateLayout) throws com.liferay.portal.kernel.exception.PortalException { return _user.getDisplayURL(portalURL, mainPath, privateLayout);
/** * Returns the complete URL of this service context's current user's profile * page. * * @return the complete URL of this service context's current user's profile * page */ public String getUserDisplayURL() { if (_userDisplayURL == null) { ThemeDisplay themeDisplay = getThemeDisplay(); if (themeDisplay == null) { return null; } User user = themeDisplay.getUser(); try { _userDisplayURL = user.getDisplayURL(themeDisplay); } catch (PortalException pe) { ReflectionUtil.throwException(pe); } } return _userDisplayURL; }
public String getUserNameLink(long userId, ThemeDisplay themeDisplay) { try { if (userId <= 0) { return StringPool.BLANK; } User user = UserLocalServiceUtil.getUserById(userId); String userName = user.getFullName(); String userDisplayURL = user.getDisplayURL(themeDisplay); return StringBundler.concat( "<a href=\"", userDisplayURL, "\">", HtmlUtil.escape(userName), "</a>"); } catch (Exception e) { return StringPool.BLANK; } }
/** * @deprecated As of Wilberforce (7.0.x), replaced by {@link * #getUserName(long, ServiceContext)} */ @Deprecated protected String getUserName(long userId, ThemeDisplay themeDisplay) { try { if (userId <= 0) { return StringPool.BLANK; } User user = UserLocalServiceUtil.getUserById(userId); if (user.getUserId() == themeDisplay.getUserId()) { return HtmlUtil.escape(user.getFirstName()); } String userName = user.getFullName(); Group group = user.getGroup(); if (group.getGroupId() == themeDisplay.getScopeGroupId()) { return HtmlUtil.escape(userName); } String userDisplayURL = user.getDisplayURL(themeDisplay); userName = StringBundler.concat( "<a class=\"user\" href=\"", userDisplayURL, "\">", HtmlUtil.escape(userName), "</a>"); return userName; } catch (Exception e) { return StringPool.BLANK; } }
public String getUserName(long userId, ThemeDisplay themeDisplay) { try { if (userId <= 0) { return StringPool.BLANK; } User user = UserLocalServiceUtil.getUserById(userId); if (user.getUserId() == themeDisplay.getUserId()) { return HtmlUtil.escape(user.getFirstName()); } String userName = user.getFullName(); Group group = user.getGroup(); if (group.getGroupId() == themeDisplay.getScopeGroupId()) { return HtmlUtil.escape(userName); } String userDisplayURL = user.getDisplayURL(themeDisplay); return StringBundler.concat( "<a href=\"", userDisplayURL, "\">", HtmlUtil.escape(userName), "</a>"); } catch (Exception e) { return StringPool.BLANK; } }
protected String getUserName(long userId, ServiceContext serviceContext) { try { if (userId <= 0) { return StringPool.BLANK; } User user = UserLocalServiceUtil.getUserById(userId); if (user.getUserId() == serviceContext.getUserId()) { return HtmlUtil.escape(user.getFirstName()); } String userName = user.getFullName(); Group group = user.getGroup(); if (group.getGroupId() == serviceContext.getScopeGroupId()) { return HtmlUtil.escape(userName); } String userDisplayURL = user.getDisplayURL( serviceContext.getThemeDisplay()); userName = StringBundler.concat( "<a class=\"user\" href=\"", userDisplayURL, "\">", HtmlUtil.escape(userName), "</a>"); return userName; } catch (Exception e) { return StringPool.BLANK; } }