001
014
015 package com.liferay.portal.servlet.taglib.ui;
016
017 import com.liferay.portal.kernel.servlet.taglib.ui.FormNavigatorConstants;
018 import com.liferay.portal.kernel.spring.osgi.OSGiBeanProperties;
019 import com.liferay.portal.model.User;
020 import com.liferay.portal.service.ServiceContext;
021 import com.liferay.portal.service.ServiceContextThreadLocal;
022 import com.liferay.portal.theme.PortletDisplay;
023 import com.liferay.portal.theme.ThemeDisplay;
024 import com.liferay.portal.util.PortletKeys;
025
026
029 @OSGiBeanProperties(property = {"service.ranking:Integer=20"})
030 public class UserPersonalSiteFormNavigatorEntry
031 extends BaseUserFormNavigatorEntry {
032
033 @Override
034 public String getCategoryKey() {
035 return FormNavigatorConstants.CATEGORY_KEY_USER_USER_INFORMATION;
036 }
037
038 @Override
039 public String getKey() {
040 return "personal-site";
041 }
042
043 @Override
044 public boolean isVisible(User user, User selUser) {
045 ServiceContext serviceContext =
046 ServiceContextThreadLocal.getServiceContext();
047
048 ThemeDisplay themeDisplay = serviceContext.getThemeDisplay();
049
050 PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
051
052 String portletName = portletDisplay.getPortletName();
053
054 if ((selUser != null) && portletName.equals(PortletKeys.MY_ACCOUNT)) {
055 return false;
056 }
057
058 return true;
059 }
060
061 @Override
062 protected String getJspPath() {
063 return "/html/portlet/users_admin/user/personal_site.jsp";
064 }
065
066 }