javax.portlet
Interface PortletURL

All Superinterfaces:
BaseURL

public interface PortletURL
extends BaseURL

The PortletURL interface represents a URL that references the portlet itself.

A PortletURL is created using RenderResponse or ResourceResponse.

A portlet mode, a window state and a security level can be added to PortletURL objects.

There are two types of PortletURLs:

The string representation of a PortletURL does not need to be a valid URL at the time the portlet is generating its content. It may contain special tokens that will be converted to a valid URL, by the portal, before the content is returned to the client.


Method Summary
 PortletMode getPortletMode()
Returns the currently set portlet mode on this PortletURL.
 WindowState getWindowState()
Returns the currently set window state on this PortletURL.
 void removePublicRenderParameter(java.lang.String name)
Removes the specified public render parameter.
 void javax.portlet.PortletMode)">setPortletMode(PortletMode portletMode)
Indicates the portlet mode the portlet must be in, if this portlet URL triggers a request.
 void javax.portlet.WindowState)">setWindowState(WindowState windowState)
Indicates the window state the portlet should be in, if this portlet URL triggers a request.
 
Methods inherited from interface javax.portlet.BaseURL
addProperty, getParameterMap, setParameter, setParameter, setParameters, setProperty, setSecure, toString, write, write
 

Method Detail
javax.portlet.WindowState)">

setWindowState

void setWindowState(WindowState windowState)
                    throws WindowStateException
Indicates the window state the portlet should be in, if this portlet URL triggers a request.

A URL can not have more than one window state attached to it. If more than one window state is set only the last one set is attached to the URL.

Parameters:
windowState - the portlet window state
Throws:
WindowStateException - 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.
See Also:
javax.portlet.WindowState)">PortletRequest.isWindowStateAllowed(javax.portlet.WindowState)

javax.portlet.PortletMode)">

setPortletMode

void setPortletMode(PortletMode portletMode)
                    throws PortletModeException
Indicates the portlet mode the portlet must be in, if this portlet URL triggers a request.

A URL can not have more than one portlet mode attached to it. If more than one portlet mode is set only the last one set is attached to the URL.

Parameters:
portletMode - the portlet mode
Throws:
PortletModeException - 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.
See Also:
javax.portlet.PortletMode)">PortletRequest.isPortletModeAllowed(javax.portlet.PortletMode)

getPortletMode

PortletMode getPortletMode()
Returns the currently set portlet mode on this PortletURL.

Returns:
the portlet mode, or null if none is set
Since:
2.0

getWindowState

WindowState getWindowState()
Returns the currently set window state on this PortletURL.

Returns:
the window state, or null if none is set
Since:
2.0

removePublicRenderParameter

void removePublicRenderParameter(java.lang.String name)
Removes the specified public render parameter. The name must reference a public render parameter defined in the portlet deployment descriptor under the public-render-parameter element with the identifier mapping to the parameter name.

Note that calling this method on a PortletURL of type Action URL does not have any effect.

Parameters:
name - a String specifying the name of the public render parameter to be removed
Throws:
java.lang.IllegalArgumentException - if name is null.
Since:
2.0


Copyright © 2003-2008 Apache Software Foundation. All Rights Reserved.