public final class LiferayPortletHelperUtil extends Object
LiferayPortletHelper
.Modifier and Type | Method and Description |
---|---|
static void |
checkUserPortletPermission(javax.faces.context.FacesContext facesContext,
String actionId)
Checks to see if the current user has permission to execute the specified actionId (which, in turn, is assumed to
be an action defined for the current portlet).
|
static void |
checkUserPortletPermission(String actionId)
Checks to see if the current user has permission to execute the specified actionId (which, in turn, is assumed to
be an action defined for the current portlet).
|
static int |
getBuildNumber()
Returns the build identifier for the running version of Liferay Portal.
|
static int |
getBuildNumber(javax.faces.context.FacesContext facesContext)
Returns the build identifier for the running version of Liferay Portal.
|
static long |
getCompanyId()
Returns the company Id associated with the community that is hosting the portlet associated with the current
faces context.
|
static long |
getCompanyId(javax.faces.context.FacesContext facesContext)
Returns the company Id associated with the community that is hosting the portlet associated with the current
faces context.
|
static String |
getDocumentLibraryURL()
Returns an absolute URL to the Liferay document library, which is the main part of different struts action paths.
|
static String |
getDocumentLibraryURL(javax.faces.context.FacesContext facesContext)
Returns an absolute URL to the Liferay document library, which is the main part of different struts action paths.
|
static long |
getHostGroupId()
Returns the "group Id" associated with the community that is hosting the portlet associated with the current
faces context.
|
static long |
getHostGroupId(javax.faces.context.FacesContext facesContext)
Returns the "group Id" associated with the community that is hosting the portlet associated with the current
faces context.
|
static String |
getImageGalleryURL()
Returns an absolute URL to the Liferay image gallery, which is the main part of different struts action paths.
|
static String |
getImageGalleryURL(javax.faces.context.FacesContext facesContext)
Returns an absolute URL to the Liferay image gallery, which is the main part of different struts action paths.
|
static com.liferay.portal.kernel.model.Layout |
getLayout()
Returns the layout being displayed in the current context.
|
static com.liferay.portal.kernel.model.Layout |
getLayout(javax.faces.context.FacesContext facesContext)
Returns the layout being displayed in the current context.
|
static com.liferay.portal.kernel.security.permission.PermissionChecker |
getPermissionChecker()
Returns the Liferay PermissionChecker associated with the request.
|
static com.liferay.portal.kernel.security.permission.PermissionChecker |
getPermissionChecker(javax.faces.context.FacesContext facesContext)
Returns the Liferay PermissionChecker associated with the request.
|
static long |
getPlid()
Returns the "Plid" (the "portal layout id"), which is the identifier of the specific "page" the portlet exists
on.
|
static long |
getPlid(javax.faces.context.FacesContext facesContext)
Returns the "Plid" (the "portal layout id"), which is the identifier of the specific "page" the portlet exists
on.
|
static String |
getPortalURL()
Returns an absolute URL which is the context-path of the portal webapp.
|
static String |
getPortalURL(javax.faces.context.FacesContext facesContext)
Returns an absolute URL which is the context-path of the portal webapp.
|
static com.liferay.portal.kernel.model.Portlet |
getPortlet()
Returns the
com.liferay.portal.model.Portlet object for the portlet associated with the current
request. |
static com.liferay.portal.kernel.model.Portlet |
getPortlet(javax.faces.context.FacesContext facesContext)
Returns the
com.liferay.portal.model.Portlet object for the portlet associated with the current
request. |
static String |
getPortletInstanceId()
Returns the "portlet instance Id" of the currently running portlet.
|
static String |
getPortletInstanceId(javax.faces.context.FacesContext facesContext)
Returns the "portlet instance Id" of the currently running portlet.
|
static String |
getPortletRootId()
Returns the "portlet root Id" of the currently running portlet.
|
static String |
getPortletRootId(javax.faces.context.FacesContext facesContext)
Returns the "portlet root Id" of the currently running portlet.
|
static com.liferay.portal.kernel.model.Group |
getScopeGroup()
Returns the group (Liferay community) associated with the layout (portal page) that the portlet resides on.
|
static com.liferay.portal.kernel.model.Group |
getScopeGroup(javax.faces.context.FacesContext facesContext)
Returns the group (Liferay community) associated with the layout (portal page) that the portlet resides on.
|
static long |
getScopeGroupId()
Returns the unique id of the group (Liferay community) associated with the layout (portal page) that the portlet
resides on.
|
static long |
getScopeGroupId(javax.faces.context.FacesContext facesContext)
Returns the unique id of the group (Liferay community) associated with the layout (portal page) that the portlet
resides on.
|
static com.liferay.portal.kernel.model.User |
getScopeGroupUser()
Returns the user associated with the group (Liferay community) associated with the layout (portal page) that the
portlet resides on.
|
static com.liferay.portal.kernel.model.User |
getScopeGroupUser(javax.faces.context.FacesContext facesContext)
Returns the user associated with the group (Liferay community) associated with the layout (portal page) that the
portlet resides on.
|
static com.liferay.portal.kernel.service.ServiceContext |
getServiceContext()
Returns an instance of a ServiceContext associated with the specified className.
|
static com.liferay.portal.kernel.service.ServiceContext |
getServiceContext(javax.faces.context.FacesContext facesContext)
Returns an instance of a ServiceContext associated with the specified className.
|
static com.liferay.portal.kernel.model.Theme |
getTheme()
Returns the theme being displayed in the current context.
|
static com.liferay.portal.kernel.model.Theme |
getTheme(javax.faces.context.FacesContext facesContext)
Returns the theme being displayed in the current context.
|
static com.liferay.portal.kernel.theme.ThemeDisplay |
getThemeDisplay()
Returns the
com.liferay.portal.kernel.theme.ThemeDisplay object, which contains a variety methods
for rendering theme specific look and feels. |
static com.liferay.portal.kernel.theme.ThemeDisplay |
getThemeDisplay(javax.faces.context.FacesContext facesContext)
Returns the
com.liferay.portal.kernel.theme.ThemeDisplay object, which contains a variety methods
for rendering theme specific look and feels. |
static String |
getThemeImagesURL()
Returns an absolute URL which is the path to the images of the theme associated with the current Layout.
|
static String |
getThemeImagesURL(javax.faces.context.FacesContext facesContext)
Returns an absolute URL which is the path to the images of the theme associated with the current Layout.
|
static com.liferay.portal.kernel.model.User |
getUser()
Returns the user record of the user associated with the current faces context.
|
static com.liferay.portal.kernel.model.User |
getUser(javax.faces.context.FacesContext facesContext)
Returns the user record of the user associated with the specified faces context.
|
static long |
getUserId()
Returns the user Id of the user associated with the current faces context.
|
static long |
getUserId(javax.faces.context.FacesContext facesContext)
Returns the user Id of the user associated with the specified faces context.
|
static List<com.liferay.portal.kernel.model.Role> |
getUserRoles()
Returns a list of all of the roles played by the user associated with the current faces context.
|
static List<com.liferay.portal.kernel.model.Role> |
getUserRoles(javax.faces.context.FacesContext facesContext)
Returns a list of all of the roles played by the user associated with the specified faces context.
|
static boolean |
userHasPortletPermission(javax.faces.context.FacesContext facesContext,
String actionId)
Returns
true if the current user has permission to execute the specified actionId (which, in turn,
is assumed to be an action defined for the current portlet). |
static boolean |
userHasPortletPermission(String actionId)
Returns
true if the current user has permission to execute the specified actionId (which, in turn,
is assumed to be an action defined for the current portlet). |
static boolean |
userHasRole(javax.faces.context.FacesContext facesContext,
String roleName)
Returns
true if the current user has the specified role name. |
static boolean |
userHasRole(String roleName)
Returns
true if the current user has the specified role name. |
public static void checkUserPortletPermission(String actionId) throws AuthorizationException
AuthorizationException
- If the user does not have the portlet permission associated with the specified
actionId.LiferayPortletHelper.userHasPortletPermission(String)
public static void checkUserPortletPermission(javax.faces.context.FacesContext facesContext, String actionId) throws AuthorizationException
AuthorizationException
- If the user does not have the portlet permission associated with the specified
actionId.LiferayPortletHelper.userHasPortletPermission(String)
public static int getBuildNumber()
public static int getBuildNumber(javax.faces.context.FacesContext facesContext)
public static long getCompanyId()
public static long getCompanyId(javax.faces.context.FacesContext facesContext)
public static String getDocumentLibraryURL()
public static String getDocumentLibraryURL(javax.faces.context.FacesContext facesContext)
public static long getHostGroupId()
public static long getHostGroupId(javax.faces.context.FacesContext facesContext)
public static String getImageGalleryURL()
public static String getImageGalleryURL(javax.faces.context.FacesContext facesContext)
public static com.liferay.portal.kernel.model.Layout getLayout()
public static com.liferay.portal.kernel.model.Layout getLayout(javax.faces.context.FacesContext facesContext)
public static com.liferay.portal.kernel.security.permission.PermissionChecker getPermissionChecker()
public static com.liferay.portal.kernel.security.permission.PermissionChecker getPermissionChecker(javax.faces.context.FacesContext facesContext)
public static long getPlid()
public static long getPlid(javax.faces.context.FacesContext facesContext)
public static String getPortalURL()
public static String getPortalURL(javax.faces.context.FacesContext facesContext)
public static com.liferay.portal.kernel.model.Portlet getPortlet()
com.liferay.portal.model.Portlet
object for the portlet associated with the current
request.public static com.liferay.portal.kernel.model.Portlet getPortlet(javax.faces.context.FacesContext facesContext)
com.liferay.portal.model.Portlet
object for the portlet associated with the current
request.public static String getPortletInstanceId()
PortletHelper.getPortletName()
public static String getPortletInstanceId(javax.faces.context.FacesContext facesContext)
PortletHelper.getPortletName()
public static String getPortletRootId()
PortletHelper.getPortletName()
public static String getPortletRootId(javax.faces.context.FacesContext facesContext)
PortletHelper.getPortletName()
public static com.liferay.portal.kernel.model.Group getScopeGroup()
public static com.liferay.portal.kernel.model.Group getScopeGroup(javax.faces.context.FacesContext facesContext)
public static long getScopeGroupId()
public static long getScopeGroupId(javax.faces.context.FacesContext facesContext)
public static com.liferay.portal.kernel.model.User getScopeGroupUser()
public static com.liferay.portal.kernel.model.User getScopeGroupUser(javax.faces.context.FacesContext facesContext)
public static com.liferay.portal.kernel.service.ServiceContext getServiceContext()
public static com.liferay.portal.kernel.service.ServiceContext getServiceContext(javax.faces.context.FacesContext facesContext)
public static com.liferay.portal.kernel.model.Theme getTheme()
public static com.liferay.portal.kernel.model.Theme getTheme(javax.faces.context.FacesContext facesContext)
public static com.liferay.portal.kernel.theme.ThemeDisplay getThemeDisplay()
com.liferay.portal.kernel.theme.ThemeDisplay
object, which contains a variety methods
for rendering theme specific look and feels.public static com.liferay.portal.kernel.theme.ThemeDisplay getThemeDisplay(javax.faces.context.FacesContext facesContext)
com.liferay.portal.kernel.theme.ThemeDisplay
object, which contains a variety methods
for rendering theme specific look and feels.public static String getThemeImagesURL()
public static String getThemeImagesURL(javax.faces.context.FacesContext facesContext)
public static com.liferay.portal.kernel.model.User getUser()
public static com.liferay.portal.kernel.model.User getUser(javax.faces.context.FacesContext facesContext)
public static long getUserId()
public static long getUserId(javax.faces.context.FacesContext facesContext)
public static List<com.liferay.portal.kernel.model.Role> getUserRoles() throws com.liferay.portal.kernel.exception.SystemException
com.liferay.portal.kernel.exception.SystemException
public static List<com.liferay.portal.kernel.model.Role> getUserRoles(javax.faces.context.FacesContext facesContext) throws com.liferay.portal.kernel.exception.SystemException
com.liferay.portal.kernel.exception.SystemException
public static boolean userHasPortletPermission(String actionId)
true
if the current user has permission to execute the specified actionId (which, in turn,
is assumed to be an action defined for the current portlet). Any errors that occur will be caught and re-thrown,
wrapped in a PortletRuntimeException.public static boolean userHasPortletPermission(javax.faces.context.FacesContext facesContext, String actionId)
true
if the current user has permission to execute the specified actionId (which, in turn,
is assumed to be an action defined for the current portlet). Any errors that occur will be caught and re-thrown,
wrapped in a PortletRuntimeException.LiferayPortletHelper.checkUserPortletPermission(String)
public static boolean userHasRole(String roleName)
true
if the current user has the specified role name.public static boolean userHasRole(javax.faces.context.FacesContext facesContext, String roleName)
true
if the current user has the specified role name.Copyright © 2019 Liferay, Inc.. All rights reserved.