edu.internet2.middleware.grouper.ui.tags
Class GrouperMessageTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by org.apache.taglibs.standard.tag.common.fmt.MessageSupport
              extended by org.apache.taglibs.standard.tag.el.fmt.MessageTag
                  extended by edu.internet2.middleware.grouper.ui.tags.GrouperMessageTag
All Implemented Interfaces:
Serializable, BodyTag, IterationTag, JspTag, Tag

public class GrouperMessageTag
extends org.apache.taglibs.standard.tag.el.fmt.MessageTag

A handler for <message> that accepts attributes as Strings and evaluates them as expressions at runtime. Substitutes keywords into underlined tooltips. The default bundle is "${nav}". If the value is provided, use that instead of looking up in a properties file, and perhaps do a tooltip lookup

Author:
Chris Hyzer
See Also:
Serialized Form

Field Summary
static String TOOLTIP_PREFIX
          in the nav.properties, tooltips must start with this prefix.
static String TOOLTIP_TARGETTED_PREFIX
          target a tooltip on a certain message
static String TOOLTIP_TARGETTED_REF_PREFIX
          target a tooltip on a certain message, and make the value of the tooltip a reference to another tooltip
 
Fields inherited from class org.apache.taglibs.standard.tag.common.fmt.MessageSupport
UNDEFINED_KEY
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
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
GrouperMessageTag()
           
 
Method Summary
 int doEndTag()
          this is overridden to put the tooltips in the text
 int doStartTag()
           
 String getTooltipDisable()
          if we should not do tooltips for this tag
 void release()
           
 void setEscapeHtml(boolean escapeHtml1)
           
 void setEscapeSingleQuotes(String escapeSingleQuotes1)
          if we should escape single quotes with \' for javascript
 void setIgnoreTooltipStyle(String ignoreTooltipStyle1)
           
 void setTooltipDisable(String tooltipDisable1)
          if we should not do tooltips for this tag
 void setTooltipRef(String tooltipRef1)
          for a tooltip on this message (similar to a targetted tooltip), this is name from nav.properties
 void setUseNewTermContext(String useNewTermContext1)
          terms only display once per page.
 void setValue(String value1)
          if specified use this value and not lookup in resource file
 void setValueTooltip(String valueTooltip1)
          if directly putting in the tooltip, do so here
 void setValueTooltipKey(String valueTooltipKey1)
          set value tooltip
 String substituteTooltips(String message, boolean isIgnoreTooltipStyle)
          substitute tooltips
 boolean tooltipDisable()
          see if disabled (and validate the boolean, default to false if not set)
 boolean useNewTermContext()
          see if use new term context (and validate the boolean, default to false if not set)
 
Methods inherited from class org.apache.taglibs.standard.tag.el.fmt.MessageTag
setBundle, setKey
 
Methods inherited from class org.apache.taglibs.standard.tag.common.fmt.MessageSupport
addParam, setScope, setVar
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, getBodyContent, getPreviousOut, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Field Detail

TOOLTIP_PREFIX

public static final String TOOLTIP_PREFIX
in the nav.properties, tooltips must start with this prefix. there should be one and only one tooltip for a term. tooltips and terms are linked by the common name, which is the suffix of the nav.properties key. e.g. tooltip.group=A group is a collection term.group=Group term.group=group these are linked because they all end in "group"

See Also:
Constant Field Values

TOOLTIP_TARGETTED_PREFIX

public static final String TOOLTIP_TARGETTED_PREFIX
target a tooltip on a certain message

See Also:
Constant Field Values

TOOLTIP_TARGETTED_REF_PREFIX

public static final String TOOLTIP_TARGETTED_REF_PREFIX
target a tooltip on a certain message, and make the value of the tooltip a reference to another tooltip

See Also:
Constant Field Values
Constructor Detail

GrouperMessageTag

public GrouperMessageTag()
Method Detail

release

public void release()
Specified by:
release in interface Tag
Overrides:
release in class org.apache.taglibs.standard.tag.el.fmt.MessageTag
See Also:
MessageTag.release()

setValueTooltip

public void setValueTooltip(String valueTooltip1)
if directly putting in the tooltip, do so here

Parameters:
valueTooltip1 -

useNewTermContext

public boolean useNewTermContext()
see if use new term context (and validate the boolean, default to false if not set)

Returns:
if use new term context

setEscapeHtml

public void setEscapeHtml(boolean escapeHtml1)
Parameters:
escapeHtml1 - the escapeHtml to set

tooltipDisable

public boolean tooltipDisable()
see if disabled (and validate the boolean, default to false if not set)

Returns:
if disabled

doEndTag

public int doEndTag()
             throws JspException
this is overridden to put the tooltips in the text

Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class org.apache.taglibs.standard.tag.common.fmt.MessageSupport
Throws:
JspException

substituteTooltips

public String substituteTooltips(String message,
                                 boolean isIgnoreTooltipStyle)
substitute tooltips

Parameters:
message -
isIgnoreTooltipStyle - true if should ignore tooltip style
Returns:
the substituted strings

getTooltipDisable

public String getTooltipDisable()
if we should not do tooltips for this tag

Returns:
the tooltipDisable

setTooltipDisable

public void setTooltipDisable(String tooltipDisable1)
if we should not do tooltips for this tag

Parameters:
tooltipDisable1 - the tooltipDisable to set

setUseNewTermContext

public void setUseNewTermContext(String useNewTermContext1)
terms only display once per page. but if a term is in something hidden (e.g. infodot target), then it might be used on page, but user cant see unless they open that infodot. So this will reset the context so that in this text it will use all terms and they can be used later in page as well.

Parameters:
useNewTermContext1 - the useNewTermContext to set

doStartTag

public int doStartTag()
               throws JspException
Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class org.apache.taglibs.standard.tag.el.fmt.MessageTag
Throws:
JspException
See Also:
MessageTag.doStartTag()

setEscapeSingleQuotes

public void setEscapeSingleQuotes(String escapeSingleQuotes1)
if we should escape single quotes with \' for javascript

Parameters:
escapeSingleQuotes1 - the escapeSingleQuotes to set

setTooltipRef

public void setTooltipRef(String tooltipRef1)
for a tooltip on this message (similar to a targetted tooltip), this is name from nav.properties

Parameters:
tooltipRef1 - the tooltipRef to set

setIgnoreTooltipStyle

public void setIgnoreTooltipStyle(String ignoreTooltipStyle1)
Parameters:
ignoreTooltipStyle1 - the ignoreTooltipStyle to set

setValue

public void setValue(String value1)
if specified use this value and not lookup in resource file

Parameters:
value1 -

setValueTooltipKey

public void setValueTooltipKey(String valueTooltipKey1)
set value tooltip

Parameters:
valueTooltipKey1 -