org.jboss.portal.portlet.impl.jsr168.taglib
Class GenerateURLTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by org.jboss.portal.portlet.impl.jsr168.taglib.PortletTag
          extended by org.jboss.portal.portlet.impl.jsr168.taglib.GenerateURLTag
All Implemented Interfaces:
java.io.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

Field Summary
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
GenerateURLTag()
           
 
Method Summary
 void addParameter(java.lang.String name, java.lang.String value)
          Add a named parameter.
protected  void clearPreviousTag()
           
 int doEndTag()
          Generate the URL
 int doStartTag()
          Process the body, which may contain portlet:param tags
protected  javax.portlet.BaseURL generateURL()
           
protected  javax.portlet.BaseURL getBasePortletEnvironmentAndURL()
          Set up the environment for generating the PortletURL and get the base PortletURL to decorate.
 java.lang.String getPortletMode()
          Indicates the portlet mode that the portlet must have when this link is executed.
 java.lang.String getSecure()
          Indicates whether the resulting URL should be a secure or insecure connection.
protected abstract  java.lang.String getTypeValue()
          Get the type - action or render - from the implementing subclass
protected  java.util.Map getURLParameters()
          Convert working parameters to what is needed by PortletURL - a map with String[] values.
 java.lang.String getVar()
           
 java.lang.String getWindowState()
          Indicates the window state that the portlet should have when this link is executed.
protected  void setPortletMode(PortletURL portletURL)
          Set the portlet mode for the URL to be what was given in the tag.
 void setPortletMode(java.lang.String portletMode)
           
protected  void setSecure(javax.portlet.BaseURL portletURL)
          Set the secure/unsecure state for the URL to be what was given in the tag.
 void setSecure(java.lang.String secure)
           
 void setVar(java.lang.String var)
           
protected  void setWindowState(PortletURL portletURL)
          Set the window state for the URL to be what was given in the tag.
 void setWindowState(java.lang.String windowState)
           
protected  void writeURL(javax.portlet.BaseURL portletURL)
           
 
Methods inherited from class org.jboss.portal.portlet.impl.jsr168.taglib.PortletTag
getActionRequest, getActionResponse, getConfig, getDispatchedRequest, getEventRequest, getEventResponse, getInvocation, getPortletPreferences, getPortletPreferenceValues, getPortletRequest, getPortletResponse, getPortletSessionScope, getRenderRequest, getRenderResponse, getResourceRequest, getResourceResponse, getSession
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenerateURLTag

public GenerateURLTag()
Method Detail

getPortletMode

public java.lang.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(java.lang.String portletMode)
Parameters:
portletMode - The portletMode to set.

getSecure

public java.lang.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(java.lang.String secure)
Parameters:
secure - The secure connection value to set.

getVar

public java.lang.String getVar()
Returns:
Returns the var - name of the exported scope variable.

setVar

public void setVar(java.lang.String var)
Parameters:
var - The var to set.

getWindowState

public java.lang.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(java.lang.String windowState)
Parameters:
windowState - The windowState to set.

getURLParameters

protected java.util.Map getURLParameters()
Convert working parameters to what is needed by PortletURL - a map with String[] values.

Returns:
Returns the parameters.

addParameter

public void addParameter(java.lang.String name,
                         java.lang.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(PortletURL portletURL)
                       throws 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:
WindowStateException

setPortletMode

protected void setPortletMode(PortletURL portletURL)
                       throws 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:
PortletModeException

setSecure

protected void setSecure(javax.portlet.BaseURL portletURL)
                  throws 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:
PortletSecurityException

clearPreviousTag

protected void clearPreviousTag()

getTypeValue

protected abstract java.lang.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.JspException
Process the body, which may contain portlet:param tags

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException

generateURL

protected javax.portlet.BaseURL generateURL()
                                     throws java.lang.Exception
Throws:
java.lang.Exception

writeURL

protected void writeURL(javax.portlet.BaseURL portletURL)
                 throws java.lang.Exception
Throws:
java.lang.Exception

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Generate the URL

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException


Copyright © 2008. All Rights Reserved.