Class GenerateURLTag
- java.lang.Object
-
- javax.servlet.jsp.tagext.TagSupport
-
- org.gatein.pc.portlet.impl.jsr168.taglib.PortletTag
-
- org.gatein.pc.portlet.impl.jsr168.taglib.GenerateURLTag
-
- All Implemented Interfaces:
Serializable,javax.servlet.jsp.tagext.IterationTag,javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.tagext.Tag
- Direct Known Subclasses:
ActionURLTag,GenerateURL286Tag,RenderURLTag
public abstract class GenerateURLTag extends PortletTag
Superclass of the actionURL and renderURL tags for the JSR 168 Portlet specification. Creates a URL that must point to the current portlet and must trigger a render or action request with the supplied parameters.- Version:
- $Revision: 5448 $
- Author:
- Sherman Wood
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GenerateURLTag()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddParameter(String name, String value)Add a named parameter.protected voidclearPreviousTag()intdoEndTag()Generate the URLintdoStartTag()Process the body, which may contain portlet:param tagsprotected javax.portlet.BaseURLgenerateURL()protected javax.portlet.BaseURLgetBasePortletEnvironmentAndURL()Set up the environment for generating the PortletURL and get the base PortletURL to decorate.StringgetPortletMode()Indicates the portlet mode that the portlet must have when this link is executed.StringgetSecure()Indicates whether the resulting URL should be a secure or insecure connection.protected abstract StringgetTypeValue()Get the type - action or render - from the implementing subclassprotected MapgetURLParameters()Convert working parameters to what is needed by PortletURL - a map with String[] values.StringgetVar()StringgetWindowState()Indicates the window state that the portlet should have when this link is executed.voidsetPortletMode(String portletMode)protected voidsetPortletMode(javax.portlet.PortletURL portletURL)Set the portlet mode for the URL to be what was given in the tag.voidsetSecure(String secure)protected voidsetSecure(javax.portlet.BaseURL portletURL)Set the secure/unsecure state for the URL to be what was given in the tag.voidsetVar(String var)voidsetWindowState(String windowState)protected voidsetWindowState(javax.portlet.PortletURL portletURL)Set the window state for the URL to be what was given in the tag.protected voidwriteURL(javax.portlet.BaseURL portletURL)-
Methods inherited from class org.gatein.pc.portlet.impl.jsr168.taglib.PortletTag
getActionRequest, getActionResponse, getConfig, getDispatchedRequest, getEventRequest, getEventResponse, getInvocation, getPortletPreferences, getPortletPreferenceValues, getPortletRequest, getPortletResponse, getPortletSessionScope, getRenderRequest, getRenderResponse, getResourceRequest, getResourceResponse, getSession
-
-
-
-
Method Detail
-
getPortletMode
public String getPortletMode()
Indicates the portlet mode that the portlet must have when this link is executed. Predefined states: edit, view, help Optional. Defaults to same as the portlet mode for the current request, by not being included as a parameter in the URL.- Returns:
- Returns the portletMode.
-
setPortletMode
public void setPortletMode(String portletMode)
- Parameters:
portletMode- The portletMode to set.
-
getSecure
public String getSecure()
Indicates whether the resulting URL should be a secure or insecure connection. "true" or "false" Optional. Defaults to security setting for the current request, by not being included as a parameter in the URL.- Returns:
- Returns the secure connection value.
-
setSecure
public void setSecure(String secure)
- Parameters:
secure- The secure connection value to set.
-
getVar
public String getVar()
- Returns:
- Returns the var - name of the exported scope variable.
-
setVar
public void setVar(String var)
- Parameters:
var- The var to set.
-
getWindowState
public String getWindowState()
Indicates the window state that the portlet should have when this link is executed. Predefined states: minimized, maximized, normal Optional. Defaults to same as the window state for the current request, by not being included as a parameter in the URL.- Returns:
- Returns the windowState.
-
setWindowState
public void setWindowState(String windowState)
- Parameters:
windowState- The windowState to set.
-
getURLParameters
protected Map getURLParameters()
Convert working parameters to what is needed by PortletURL - a map with String[] values.- Returns:
- Returns the parameters.
-
addParameter
public void addParameter(String name, String value)
Add a named parameter. Cater for multiple parameters with the same name by storing them in a list.- Parameters:
name-value-
-
getBasePortletEnvironmentAndURL
protected javax.portlet.BaseURL getBasePortletEnvironmentAndURL()
Set up the environment for generating the PortletURL and get the base PortletURL to decorate. Includes setting the "type" parameter from the implementing subclass.- Returns:
- The PortelURL to decorate
-
setWindowState
protected void setWindowState(javax.portlet.PortletURL portletURL) throws javax.portlet.WindowStateExceptionSet the window state for the URL to be what was given in the tag. If not given, default to what was there previously- Parameters:
portletURL-- Throws:
javax.portlet.WindowStateException
-
setPortletMode
protected void setPortletMode(javax.portlet.PortletURL portletURL) throws javax.portlet.PortletModeExceptionSet the portlet mode for the URL to be what was given in the tag. If not given, default to what was there previously- Parameters:
portletURL-- Throws:
javax.portlet.PortletModeException
-
setSecure
protected void setSecure(javax.portlet.BaseURL portletURL) throws javax.portlet.PortletSecurityExceptionSet the secure/unsecure state for the URL to be what was given in the tag. If not given, default to what was there previously- Parameters:
portletURL-- Throws:
javax.portlet.PortletSecurityException
-
clearPreviousTag
protected void clearPreviousTag()
-
getTypeValue
protected abstract String getTypeValue()
Get the type - action or render - from the implementing subclass- Returns:
- the value for the "type" portal parameter
-
doStartTag
public int doStartTag() throws javax.servlet.jsp.JspExceptionProcess the body, which may contain portlet:param tags- Specified by:
doStartTagin interfacejavax.servlet.jsp.tagext.Tag- Overrides:
doStartTagin classjavax.servlet.jsp.tagext.TagSupport- Throws:
javax.servlet.jsp.JspException
-
writeURL
protected void writeURL(javax.portlet.BaseURL portletURL) throws Exception- Throws:
Exception
-
doEndTag
public int doEndTag() throws javax.servlet.jsp.JspExceptionGenerate the URL- Specified by:
doEndTagin interfacejavax.servlet.jsp.tagext.Tag- Overrides:
doEndTagin classjavax.servlet.jsp.tagext.TagSupport- Throws:
javax.servlet.jsp.JspException
-
-