public abstract class BasePanelApp extends java.lang.Object implements PanelApp
PanelApp
to minimize the
effort required to implement this interface.
To implement an application, this class should be extended and include(HttpServletRequest, HttpServletResponse)
should be overridden. The
include
override method should return true
when the
application view successfully renders and false
otherwise.
PanelApp
Modifier and Type | Field and Description |
---|---|
protected GroupProvider |
groupProvider |
Constructor and Description |
---|
BasePanelApp() |
Modifier and Type | Method and Description |
---|---|
protected com.liferay.portal.kernel.portlet.ControlPanelEntry |
getControlPanelEntry() |
protected com.liferay.portal.kernel.model.Group |
getGroup(javax.servlet.http.HttpServletRequest request) |
java.lang.String |
getKey()
Returns the panel entry's key.
|
java.lang.String |
getLabel(java.util.Locale locale)
Returns the label that is displayed in the user interface when the panel
entry is included.
|
int |
getNotificationsCount(com.liferay.portal.kernel.model.User user)
Returns the number of notifications for the user.
|
com.liferay.portal.kernel.model.Portlet |
getPortlet()
Returns the portlet associated with the application.
|
javax.portlet.PortletURL |
getPortletURL(javax.servlet.http.HttpServletRequest request)
Returns the URL used to render a portlet based on the servlet request
attributes.
|
boolean |
include(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Returns
true if the application successfully renders. |
boolean |
isShow(com.liferay.portal.kernel.security.permission.PermissionChecker permissionChecker,
com.liferay.portal.kernel.model.Group group)
Returns
true if the panel entry should be displayed in the
group's context. |
void |
setGroupProvider(GroupProvider groupProvider)
Sets the
GroupProvider associated with the application. |
void |
setPortlet(com.liferay.portal.kernel.model.Portlet portlet)
Sets the portlet associated with the application.
|
protected void |
setUserNotificationEventLocalService(com.liferay.portal.kernel.service.UserNotificationEventLocalService userNotificationEventLocalService) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPortletId
protected GroupProvider groupProvider
public java.lang.String getKey()
PanelEntry
getKey
in interface PanelEntry
public java.lang.String getLabel(java.util.Locale locale)
PanelEntry
getLabel
in interface PanelEntry
locale
- the label's retrieved localepublic int getNotificationsCount(com.liferay.portal.kernel.model.User user)
PanelApp
getNotificationsCount
in interface PanelApp
user
- the user from which notifications are retrievedpublic com.liferay.portal.kernel.model.Portlet getPortlet()
PanelApp
getPortlet
in interface PanelApp
public javax.portlet.PortletURL getPortletURL(javax.servlet.http.HttpServletRequest request) throws com.liferay.portal.kernel.exception.PortalException
PanelApp
getPortletURL
in interface PanelApp
request
- the servlet request used to create a portlet's URLcom.liferay.portal.kernel.exception.PortalException
- if a portal exception occurredpublic boolean include(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
PanelApp
true
if the application successfully renders.include
in interface PanelApp
request
- the servlet request used in the rendering processresponse
- the servlet response used in the rendering processtrue
if the application successfully renders;
false
otherwisejava.io.IOException
- if an IO exception occurredpublic boolean isShow(com.liferay.portal.kernel.security.permission.PermissionChecker permissionChecker, com.liferay.portal.kernel.model.Group group) throws com.liferay.portal.kernel.exception.PortalException
PanelEntry
true
if the panel entry should be displayed in the
group's context.isShow
in interface PanelEntry
permissionChecker
- the permission checkergroup
- the group for which permissions are checkedtrue
if the Control Menu entry should be displayed
in the request's context; false
otherwisecom.liferay.portal.kernel.exception.PortalException
- if a portal exception occurredpublic void setGroupProvider(GroupProvider groupProvider)
PanelApp
GroupProvider
associated with the application.setGroupProvider
in interface PanelApp
groupProvider
- the group provider associated with the applicationpublic void setPortlet(com.liferay.portal.kernel.model.Portlet portlet)
PanelApp
setPortlet
in interface PanelApp
portlet
- the portlet associated with the applicationprotected com.liferay.portal.kernel.portlet.ControlPanelEntry getControlPanelEntry()
protected com.liferay.portal.kernel.model.Group getGroup(javax.servlet.http.HttpServletRequest request)
protected void setUserNotificationEventLocalService(com.liferay.portal.kernel.service.UserNotificationEventLocalService userNotificationEventLocalService)