public class PortletURLWrapper extends BaseURLWrapper implements PortletURL
PortletURLWrapper
provides a convenient
implementation of the PortletURL
interface
that can be subclassed by developers.
This class implements the Wrapper or Decorator pattern.
Methods default to calling through to the wrapped request object.
wrapped
Constructor and Description |
---|
PortletURLWrapper(PortletURL wrapped) |
Modifier and Type | Method and Description |
---|---|
MutableRenderParameters |
getRenderParameters()
Gets the render parameters.
|
PortletURL |
getWrapped()
Gets the wrapped object.
|
void |
removePublicRenderParameter(String name)
Deprecated.
|
void |
setBeanParameter(PortletSerializable bean)
Sets the value of a @RenderStateScoped bean on an action or
render URL.
|
void |
setPortletMode(PortletMode portletMode)
Sets the portlet mode of a portlet to the given portlet mode.
|
void |
setWindowState(WindowState windowState)
Sets the window state of a portlet to the given window state.
|
void |
setWrapped(PortletURL wrapped)
Sets the wrapped object.
|
addProperty, append, append, getParameterMap, setParameter, setParameter, setParameters, setProperty, setSecure, setWrapped, toString, write, write
getPortletMode, getWindowState, setWrapped
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addProperty, append, append, getParameterMap, setParameter, setParameter, setParameters, setProperty, setSecure, toString, write, write
getPortletMode, getWindowState
public PortletURLWrapper(PortletURL wrapped)
wrapped
- the wrapped object to set.IllegalArgumentException
- if the PortletURL is null.public PortletURL getWrapped()
getWrapped
in class BaseURLWrapper
public void setWrapped(PortletURL wrapped)
wrapped
- the wrapped object to set.IllegalArgumentException
- if the PortletURL is null.public MutableRenderParameters getRenderParameters()
RenderState
getRenderParameters
in interface MutableRenderState
getRenderParameters
in interface RenderState
getRenderParameters
in class RenderStateWrapper
RenderParameters
object representing
the private and public render parametersPortletParameters
,
RenderParameters
public void setWindowState(WindowState windowState) throws WindowStateException
MutableRenderState
Possible values are the standard window states and any custom window states supported by the portal and the portlet. Standard window states are:
Not more than one window state can be set. If more than one window state is set, only the last one set is valid.
setWindowState
in interface MutableRenderState
windowState
- the new portlet window stateWindowStateException
- if the portlet cannot switch to this state,
because the portal does not support this state, the portlet has not
declared in its deployment descriptor that it supports this state, or the current
user is not allowed to switch to this state.
The PortletRequest.isWindowStateAllowed()
method can be used
to check if the portlet can set a given window state.public void setPortletMode(PortletMode portletMode) throws PortletModeException
MutableRenderState
Possible values are the standard portlet modes and any custom portlet modes supported by the portal and the portlet. Portlets must declare in the deployment descriptor the portlet modes they support for each markup type. Standard portlet modes are:
Not more than one portlet mode can be set. If more than one portlet mode is set, only the last one set is valid.
Note: The portlet may still be called in a different portlet mode in the next render call, depending on the portlet container / portal.
setPortletMode
in interface MutableRenderState
portletMode
- the new portlet modePortletModeException
- if the portlet cannot switch to this mode,
because the portal does not support this mode, the portlet has not
declared in its deployment descriptor that it supports this mode for the current markup,
or the current user is not allowed to switch to this mode.
The PortletRequest.isPortletModeAllowed()
method can be used
to check if the portlet can set a given portlet mode.@Deprecated public void removePublicRenderParameter(String name)
PortletURL
public-render-parameter
element with the
identifier
mapping to the parameter name.removePublicRenderParameter
in interface PortletURL
name
- a String
specifying
the name of the public render parameter to be removedpublic void setBeanParameter(PortletSerializable bean)
PortletURL
Calling this method copies the bean state to the URL so that the values are available to the portlet when the URL is activated.
setBeanParameter
in interface PortletURL
bean
- The @RenderStateScoped beanRenderStateScoped
Java Portlet 3.0 API Specification. See the Copyright and License provided with this distribution. Use is subject to license terms.