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 |
---|---|
Registration |
addPortletListener(VaadinPortletSession.PortletListener listener)
Adds a listener for various types of portlet requests.
|
void |
firePortletActionRequest(UI uI,
javax.portlet.ActionRequest request,
javax.portlet.ActionResponse response)
For internal use by the framework only - API subject to change.
|
void |
firePortletEventRequest(UI uI,
javax.portlet.EventRequest request,
javax.portlet.EventResponse response)
For internal use by the framework only - API subject to change.
|
void |
firePortletRenderRequest(UI uI,
javax.portlet.RenderRequest request,
javax.portlet.RenderResponse response)
For internal use by the framework only - API subject to change.
|
void |
firePortletResourceRequest(UI uI,
javax.portlet.ResourceRequest request,
javax.portlet.ResourceResponse response)
For internal use by the framework only - API subject to change.
|
javax.portlet.PortletURL |
generateActionURL(String action)
Creates a new action URL.
|
javax.portlet.PortletConfig |
getPortletConfig()
Returns the JSR-286 portlet configuration that provides access to the
portlet context and init parameters.
|
javax.portlet.PortletSession |
getPortletSession()
Returns the underlying portlet session.
|
void |
removePortletListener(VaadinPortletSession.PortletListener listener)
Deprecated.
Use a
Registration object returned by
addPortletListener(PortletListener) to remove a
listener |
void |
sendPortletEvent(UI uI,
QName name,
Serializable value)
Sends a portlet event to the indicated destination.
|
void |
setPortletMode(UI uI,
javax.portlet.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, getNextConnectorId, 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 javax.portlet.PortletSession getPortletSession()
public javax.portlet.PortletConfig getPortletConfig()
public Registration addPortletListener(VaadinPortletSession.PortletListener listener)
listener
- to add@Deprecated public void removePortletListener(VaadinPortletSession.PortletListener listener)
Registration
object returned by
addPortletListener(PortletListener)
to remove a
listeneraddPortletListener(PortletListener)
.listener
- to removepublic void firePortletRenderRequest(UI uI, javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
public void firePortletActionRequest(UI uI, javax.portlet.ActionRequest request, javax.portlet.ActionResponse response)
public void firePortletEventRequest(UI uI, javax.portlet.EventRequest request, javax.portlet.EventResponse response)
public void firePortletResourceRequest(UI uI, javax.portlet.ResourceRequest request, javax.portlet.ResourceResponse response)
public javax.portlet.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, javax.portlet.PortletMode portletMode) throws IllegalStateException, javax.portlet.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 tojavax.portlet.PortletModeException
- if the portlet mode is not allowed for some reason
(configuration, permissions etc.)IllegalStateException
- if not processing a request of the correct typeCopyright © 2018 Vaadin Ltd. All rights reserved.