public class VaadinPortletSession extends VaadinSession
VaadinSession
for JSR-286 portlet environments.
This is automatically registered as a HttpSessionBindingListener
when
PortletSession#setAttribute()
is called with the context as value.
Only the documented parts of this class should be considered as stable public
API.
Note also that some methods and/or nested interfaces might move to
VaadinPortletService
in future minor or major versions of Vaadin. In
these cases, a deprecated redirection for backwards compatibility will be
used in VaadinPortletSession for a transition period.Modifier and Type | Class and Description |
---|---|
static interface |
VaadinPortletSession.PortletListener
Listener interface for the various types of JSR-286 portlet requests.
|
VaadinSession.FutureAccess, VaadinSession.State
browser, UI_PARAMETER
Constructor and Description |
---|
VaadinPortletSession(VaadinPortletService service)
Create a portlet service session for the given portlet service
|
Modifier and Type | Method and Description |
---|---|
void |
addPortletListener(VaadinPortletSession.PortletListener listener)
Adds a listener for various types of portlet requests.
|
void |
firePortletActionRequest(UI uI,
ActionRequest request,
ActionResponse response)
For internal use by the framework only - API subject to change.
|
void |
firePortletEventRequest(UI uI,
EventRequest request,
EventResponse response)
For internal use by the framework only - API subject to change.
|
void |
firePortletRenderRequest(UI uI,
RenderRequest request,
RenderResponse response)
For internal use by the framework only - API subject to change.
|
void |
firePortletResourceRequest(UI uI,
ResourceRequest request,
ResourceResponse response)
For internal use by the framework only - API subject to change.
|
PortletURL |
generateActionURL(String action)
Creates a new action URL.
|
PortletConfig |
getPortletConfig()
Returns the JSR-286 portlet configuration that provides access to the
portlet context and init parameters.
|
PortletSession |
getPortletSession()
Returns the underlying portlet session.
|
void |
removePortletListener(VaadinPortletSession.PortletListener listener)
Removes a portlet request listener registered with
addPortletListener(PortletListener) . |
void |
sendPortletEvent(UI uI,
QName name,
Serializable value)
Sends a portlet event to the indicated destination.
|
void |
setPortletMode(UI uI,
PortletMode portletMode)
Sets the portlet mode.
|
void |
setSharedRenderParameter(UI uI,
String name,
String value)
Sets a shared portlet parameter.
|
access, accessSynchronously, addBootstrapListener, addRequestHandler, addUI, addUIProvider, close, createConnectorId, getAllSessions, getAttribute, getAttribute, getBrowser, getCommunicationManager, getConfiguration, getConverterFactory, getCsrfToken, getCumulativeRequestDuration, getCurrent, getDragAndDropService, getErrorHandler, getForSession, getGlobalResourceHandler, getLastRequestDuration, getLastRequestTimestamp, getLocale, getLockInstance, getNextUIid, getPendingAccessQueue, getPushId, getRequestHandlers, getService, getSession, getState, getUIByEmbedId, getUIById, getUIProviders, getUIs, hasLock, hasLock, isClosing, lock, modifyBootstrapResponse, refreshTransients, removeBootstrapListener, removeFromSession, removeRequestHandler, removeUI, removeUIProvider, setAttribute, setAttribute, setCommunicationManager, setConfiguration, setConverterFactory, setCurrent, setErrorHandler, setLastRequestDuration, setLastRequestTimestamp, setLocale, setState, storeInSession, unlock, valueBound, valueUnbound
public VaadinPortletSession(VaadinPortletService service)
service
- the portlet service to which the new session belongspublic PortletSession getPortletSession()
public PortletConfig getPortletConfig()
public void addPortletListener(VaadinPortletSession.PortletListener listener)
listener
- to addpublic void removePortletListener(VaadinPortletSession.PortletListener listener)
addPortletListener(PortletListener)
.listener
- to removepublic void firePortletRenderRequest(UI uI, RenderRequest request, RenderResponse response)
public void firePortletActionRequest(UI uI, ActionRequest request, ActionResponse response)
public void firePortletEventRequest(UI uI, EventRequest request, EventResponse response)
public void firePortletResourceRequest(UI uI, ResourceRequest request, ResourceResponse response)
public PortletURL generateActionURL(String action)
action
- the action parameter (javax.portlet.action parameter value in
JSR-286)public void sendPortletEvent(UI uI, QName name, Serializable value) throws IllegalStateException
uI
- a window in which a temporary action URL can be opened if
necessaryname
- event namevalue
- event value object that is Serializable and, if appropriate,
has a valid JAXB annotationIllegalStateException
public void setSharedRenderParameter(UI uI, String name, String value) throws IllegalStateException
uI
- a window in which a temporary action URL can be opened if
necessaryname
- parameter identifiervalue
- parameter valueIllegalStateException
public void setPortletMode(UI uI, PortletMode portletMode) throws IllegalStateException, PortletModeException
StateAwareResponse
(an action request or an event request).
Portlet mode change in background threads is not supported.
Portlet modes used by a portlet need to be declared in portlet.xml .uI
- a window in which the render URL can be opened if necessaryportletMode
- the portlet mode to switch toPortletModeException
- if the portlet mode is not allowed for some reason
(configuration, permissions etc.)IllegalStateException
- if not processing a request of the correct typeCopyright © 2019 Vaadin Ltd. All rights reserved.