info.magnolia.cms.taglibs.util
Class SimpleNavigationTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by info.magnolia.cms.taglibs.util.SimpleNavigationTag
All Implemented Interfaces:
Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

public class SimpleNavigationTag
extends javax.servlet.jsp.tagext.TagSupport

Draws a simple, css based, navigation menu. The menu layout can then be customized using css, and the default menu should be enough for most uses. Two following page properties will also be used in the menu:

Version:
$Revision: 41137 $ ($Author: gjoseph $)
Author:
Fabrizio Giustina
See Also:
Serialized Form

Field Summary
static String DEFAULT_HIDEINNAV_NODEDATA
          Default name for "hide in nav" nodeData.
static String DEFAULT_OPENMENU_NODEDATA
          Default name for "open menu" nodeData.
static String DEFAULT_WRAPPERELEMENT_NODEDATA
          Default name for "wrapperElement" nodeData.
static String EXPAND_ALL
          Expand all expand all the nodes.
static String EXPAND_NONE
          Do not use expand functions.
static String EXPAND_SHOW
          Expand all expand only page that should be displayed in navigation.
static String NODEDATA_ACCESSKEY
          Page property: access key.
 String wrapperElement
          html element to wrap the anchortext.
 
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
SimpleNavigationTag()
           
 
Method Summary
 int doEndTag()
           
 void release()
           
 void setClassProperty(String classProperty)
          Name for a page property that will hold a css class name which will be added to the html class attribute.
 void setContentFilter(String contentFilter)
          A variable in the pageContext that contains a content filter, determining if a given page should be drawn or not.
 void setEndLevel(int endLevel)
          The end level for navigation, defaults to 0.
 void setExpandAll(String expandAll)
          Sitemap mode.
 void setHideInNav(String hideInNav)
          Name for the "hide in nav" nodeData.
 void setMarkFirstAndLastElement(boolean flag)
          If set to true, a "first" or "last" css class will be added to the list of css classes of the first and the last li in each ul.
 void setNofollow(String nofollow)
          Name for the "nofollow" nodeData.
 void setOpenMenu(String openMenu)
          Name for the "open menu" nodeData.
 void setRelativeLevels(boolean relativeLevels)
          If set to true, the startLevel and endLevel values are treated relatively to the current active page.
 void setStartLevel(int startLevel)
          The start level for navigation, defaults to 0.
 void setStyle(String style)
          The css class to be applied to the first ul.
 void setWrapperElement(String wrapperElement)
          When specified, all links will have the anchortext wrapped in the supplied element.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doStartTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NODEDATA_ACCESSKEY

public static final String NODEDATA_ACCESSKEY
Page property: access key.

See Also:
Constant Field Values

DEFAULT_OPENMENU_NODEDATA

public static final String DEFAULT_OPENMENU_NODEDATA
Default name for "open menu" nodeData.

See Also:
Constant Field Values

DEFAULT_HIDEINNAV_NODEDATA

public static final String DEFAULT_HIDEINNAV_NODEDATA
Default name for "hide in nav" nodeData.

See Also:
Constant Field Values

DEFAULT_WRAPPERELEMENT_NODEDATA

public static final String DEFAULT_WRAPPERELEMENT_NODEDATA
Default name for "wrapperElement" nodeData.

See Also:
Constant Field Values

EXPAND_ALL

public static final String EXPAND_ALL
Expand all expand all the nodes.

See Also:
Constant Field Values

EXPAND_SHOW

public static final String EXPAND_SHOW
Expand all expand only page that should be displayed in navigation.

See Also:
Constant Field Values

EXPAND_NONE

public static final String EXPAND_NONE
Do not use expand functions.

See Also:
Constant Field Values

wrapperElement

public String wrapperElement
html element to wrap the anchortext. (i.e. <a><wrapper>...</wrapper></a>)

Constructor Detail

SimpleNavigationTag

public SimpleNavigationTag()
Method Detail

setStartLevel

public void setStartLevel(int startLevel)
The start level for navigation, defaults to 0.


setEndLevel

public void setEndLevel(int endLevel)
The end level for navigation, defaults to 0.


setStyle

public void setStyle(String style)
The css class to be applied to the first ul. Default is empty.


setHideInNav

public void setHideInNav(String hideInNav)
Name for the "hide in nav" nodeData. If a page contains a boolean property with this name and it is set to true, the page is not shown in navigation. Defaults to "hideInNav".


setOpenMenu

public void setOpenMenu(String openMenu)
Name for the "open menu" nodeData. If a page contains a boolean property with this name and it is set to true, subpages are always shown also if the page is not selected. Defaults to "openMenu".


setNofollow

public void setNofollow(String nofollow)
Name for the "nofollow" nodeData. If a page contains a boolean property with this name and it is set to true, rel="nofollow" will be added to the generated link (for links the should be ignored by search engines).


setContentFilter

public void setContentFilter(String contentFilter)
A variable in the pageContext that contains a content filter, determining if a given page should be drawn or not.


setExpandAll

public void setExpandAll(String expandAll)
Sitemap mode. Can be assigned the "show" value. Only showable pages will be displayed. Any other value will result in displaying all pages.


setRelativeLevels

public void setRelativeLevels(boolean relativeLevels)
If set to true, the startLevel and endLevel values are treated relatively to the current active page. The default value is false.


setClassProperty

public void setClassProperty(String classProperty)
Name for a page property that will hold a css class name which will be added to the html class attribute.


setWrapperElement

public void setWrapperElement(String wrapperElement)
When specified, all links will have the anchortext wrapped in the supplied element. (such as "span")

Parameters:
wrapperElement - name of an html element that will be included in the anchor, wrapping the anchortext

setMarkFirstAndLastElement

public void setMarkFirstAndLastElement(boolean flag)
If set to true, a "first" or "last" css class will be added to the list of css classes of the first and the last li in each ul.


doEndTag

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

release

public void release()
Specified by:
release in interface javax.servlet.jsp.tagext.Tag
Overrides:
release in class javax.servlet.jsp.tagext.TagSupport


Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.