nl.gx.webmanager.taglib
Class LinkTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.SimpleTagSupport
      extended by nl.gx.webmanager.taglib.LinkTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.DynamicAttributes, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.SimpleTag

public class LinkTag
extends javax.servlet.jsp.tagext.SimpleTagSupport
implements javax.servlet.jsp.tagext.DynamicAttributes

Implements the wm:link tag. Using this tag, link objects can be constructed that refer to pages, downloads, etc. This tag supports dynamic attributes (i.e. you can specify your own attributes) which are passed on to the Link object that is created.
Example of usage (1): *

 < wm:link var="aLinkObject" linkText="clickme" foo="bar" target="_top" />
 ${aLinkObject.htmlTag}
 
In the example above a new link object is created referencing the current page. It is assigned to 'aLinkObject'. Using dynamic attributes a custom attribute 'foo' is defined. The link is opened in the '_top' section of the window.
Example of usage (2):
 < wm:link var="homepage" reference="${presentationcontext.website.homePage}" linkText="to the homepage" />
 Click here to go ${homepage.htmlTag}.
 

See Also:
Link

Constructor Summary
LinkTag()
           
 
Method Summary
 void doTag()
          
protected  java.lang.String getClassName()
          Return the class name to be used in the 'class=�...�' attribute of the resulting HTML link.
protected  java.lang.String getLinkText()
          Return the text to use when displaying the HTML link.
protected  java.lang.String getMouseOverText()
          Return the text to be used in the 'title=�...�' attribute of the resulting HTML link.
protected  java.lang.String getPassOn()
          Return the comma separated list of all URL parameters of the current request that need to be included in the link that is built.
protected  java.lang.String getPresentationName()
          Return the WebManager presentation object by which the link is rendered.
protected  Wrapper getReference()
          Return the page to link to.
protected  java.lang.String getTarget()
          Return the target to be used in the 'target=�...�' attribute of the resulting HTML link..
protected  java.lang.String getVar()
          Return the JSP variable to store the result in.
protected  boolean isAddElementHolder()
          Returns true if the elementholder parameter should be added to a ssi link.
protected  boolean isPassOnAllParameters()
          Return whether all URL parameters of the current request are included in the link that is built.
 void setAddElementHolder(boolean addElementHolder)
          Set whether the elementholder parameter should be added to a ssi link.
 void setClassName(java.lang.String className)
          Specifies the class name to be used in the 'class=�...�' attribute of the resulting HTML link.
 void setDynamicAttribute(java.lang.String uri, java.lang.String localName, java.lang.Object value)
          
 void setLinkText(java.lang.String linkText)
          Sets the text to use when displaying the HTML link.
 void setMouseOverText(java.lang.String mouseOverText)
          Specifies the text to be used in the 'title=�...�' attribute of the resulting HTML link.
 void setPassOn(java.lang.String passOn)
          Specifies a comma separated list of all URL parameters of the current request that need to be included in the link that is built.
 void setPassOnAllParameters(boolean passOnAllParameters)
          Specifies whether all URL parameters of the current request are included in the link that is built.
 void setPresentationName(java.lang.String presentationName)
          Specifies a WebManager presentation object.
 void setReference(Wrapper reference)
          Page to link to.
 void setTarget(java.lang.String target)
          Specifies the target to be used in the 'target=�...�' attribute of the resulting HTML link.
 void setVar(java.lang.String var)
          Specifies the JSP variable to store the result in.
 
Methods inherited from class javax.servlet.jsp.tagext.SimpleTagSupport
findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkTag

public LinkTag()
Method Detail

setReference

public void setReference(Wrapper reference)
Page to link to. If not set, the current page will be used.

Parameters:
reference -

getReference

protected Wrapper getReference()
Return the page to link to.

Returns:
reference for the link.

setVar

public void setVar(java.lang.String var)
Specifies the JSP variable to store the result in.

Parameters:
var - name of the jsp variable to which the Link object will be assigned.

getVar

protected java.lang.String getVar()
Return the JSP variable to store the result in.

Returns:
variable name to which the Link object will be assigned.

setPassOnAllParameters

public void setPassOnAllParameters(boolean passOnAllParameters)
Specifies whether all URL parameters of the current request are included in the link that is built. Default value is false (don't include). Multiple parameters with the same name will all be included.

Parameters:
passOnAllParameters - if true all parameters in the link are passed on so the href will contain them in the querystring

isPassOnAllParameters

protected boolean isPassOnAllParameters()
Return whether all URL parameters of the current request are included in the link that is built. Default value is false (don't include).

Returns:
true if all parameters in the link are passed on so the href will contain them in the querystring.

setPassOn

public void setPassOn(java.lang.String passOn)
Specifies a comma separated list of all URL parameters of the current request that need to be included in the link that is built.

Parameters:
passOn - comma separated list of request parameters that need to be passed on in the querystring of the link.

getPassOn

protected java.lang.String getPassOn()
Return the comma separated list of all URL parameters of the current request that need to be included in the link that is built.

Returns:
comma separated list of parameters

setLinkText

public void setLinkText(java.lang.String linkText)
Sets the text to use when displaying the HTML link. Default value is the title of the page that is linked to. You may also use this to create buttons. Simply make sure the img url is used as the link text.

Parameters:
linkText - link text that will appear between the <a> and </a>

getLinkText

protected java.lang.String getLinkText()
Return the text to use when displaying the HTML link.

Returns:
link text that will appear between the <a> and </a>.

setPresentationName

public void setPresentationName(java.lang.String presentationName)
Specifies a WebManager presentation object. The link is rendered by this presentation.

Parameters:
presentationName - the name of the WebManager presentation object

getPresentationName

protected java.lang.String getPresentationName()
Return the WebManager presentation object by which the link is rendered.

Returns:
the name of the WebManager presentation object by which the link is rendered

setClassName

public void setClassName(java.lang.String className)
Specifies the class name to be used in the 'class=�...�' attribute of the resulting HTML link.

Parameters:
className - the class name to be used in the 'class=�...�' attribute of the resulting HTML link

getClassName

protected java.lang.String getClassName()
Return the class name to be used in the 'class=�...�' attribute of the resulting HTML link.

Returns:
the class name to be used in the 'class=�...�' attribute of the resulting HTML link.

setTarget

public void setTarget(java.lang.String target)
Specifies the target to be used in the 'target=�...�' attribute of the resulting HTML link. Using this attribute links can be opened in a new browser window. Default value is empty: the link will open in the current window.

Parameters:
target - the target to be used in the 'target=�...�' attribute of the resulting HTML link

getTarget

protected java.lang.String getTarget()
Return the target to be used in the 'target=�...�' attribute of the resulting HTML link..

Returns:
the target to be used in the 'target=�...�' attribute of the resulting HTML link

setMouseOverText

public void setMouseOverText(java.lang.String mouseOverText)
Specifies the text to be used in the 'title=�...�' attribute of the resulting HTML link. This text is usually shown as a tooltip if the mouse cursor is placed over the link.

Parameters:
mouseOverText - the text to be used in the 'title=�...�' attribute of the resulting HTML link

getMouseOverText

protected java.lang.String getMouseOverText()
Return the text to be used in the 'title=�...�' attribute of the resulting HTML link. This text is usually shown as a tooltip if the mouse cursor is placed over the link.

Returns:
the text to be used in the 'title=�...�' attribute of the resulting HTML link

setAddElementHolder

public void setAddElementHolder(boolean addElementHolder)
Set whether the elementholder parameter should be added to a ssi link. Only use in case of building a ssi link.

Parameters:
addElementHolder - boolean, when true the elementholder should be added to a ssi link.

isAddElementHolder

protected boolean isAddElementHolder()
Returns true if the elementholder parameter should be added to a ssi link. This method is only called when building an ssi link.

Returns:
True if the elementholder parameter should be added to a ssi link. This method is only called when building an ssi link.

setDynamicAttribute

public void setDynamicAttribute(java.lang.String uri,
                                java.lang.String localName,
                                java.lang.Object value)

Specified by:
setDynamicAttribute in interface javax.servlet.jsp.tagext.DynamicAttributes

doTag

public void doTag()

Specified by:
doTag in interface javax.servlet.jsp.tagext.SimpleTag
Overrides:
doTag in class javax.servlet.jsp.tagext.SimpleTagSupport


Copyright © 2007-2011 GX Software BV. All Rights Reserved.