Class GenerateURLTag

java.lang.Object
jakarta.servlet.jsp.tagext.TagSupport
org.gatein.pc.portlet.impl.jsr168.taglib.PortletTag
org.gatein.pc.portlet.impl.jsr168.taglib.GenerateURLTag
All Implemented Interfaces:
jakarta.servlet.jsp.tagext.IterationTag, jakarta.servlet.jsp.tagext.JspTag, jakarta.servlet.jsp.tagext.Tag, Serializable
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:
  • Constructor Details

    • GenerateURLTag

      public GenerateURLTag()
  • Method Details

    • 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.WindowStateException
      Set 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.PortletModeException
      Set 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.PortletSecurityException
      Set 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 jakarta.servlet.jsp.JspException
      Process the body, which may contain portlet:param tags
      Specified by:
      doStartTag in interface jakarta.servlet.jsp.tagext.Tag
      Overrides:
      doStartTag in class jakarta.servlet.jsp.tagext.TagSupport
      Throws:
      jakarta.servlet.jsp.JspException
    • generateURL

      protected javax.portlet.BaseURL generateURL() throws Exception
      Throws:
      Exception
    • writeURL

      protected void writeURL(javax.portlet.BaseURL portletURL) throws Exception
      Throws:
      Exception
    • doEndTag

      public int doEndTag() throws jakarta.servlet.jsp.JspException
      Generate the URL
      Specified by:
      doEndTag in interface jakarta.servlet.jsp.tagext.Tag
      Overrides:
      doEndTag in class jakarta.servlet.jsp.tagext.TagSupport
      Throws:
      jakarta.servlet.jsp.JspException