it.eng.spagobi.presentation.tags
Class SpagoBIMessageTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by it.eng.spagobi.presentation.tags.SpagoBIMessageTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

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

Custom tag that retrieves message using spago facilities

Author:
zoppello
See Also:
Serialized Form

Field Summary
protected  java.lang.String args
          The arguments.
protected  java.lang.String bundle
          The servlet context attribute key for our resources.
private static java.lang.String DEFAULT_BUNDLE
           
protected  java.lang.String key
          The message key of the message to be retrieved.
 
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
SpagoBIMessageTag()
           
 
Method Summary
 int doStartTag()
          Process the start tag.
 java.lang.String getArgs()
           
 java.lang.String getBundle()
           
 java.lang.String getKey()
           
 java.lang.String getMessage(javax.portlet.PortletRequest portReq, java.lang.String code)
          A methd useful to call messages directly into code.
 void release()
          Release any acquired resources.
protected  java.lang.String replace(java.lang.String messageFormat, int iParameter, java.lang.Object value)
          Substitutes the message value to the placeholders.
 void setArgs(java.lang.String args)
           
 void setBundle(java.lang.String bundle)
           
 void setKey(java.lang.String key)
           
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, 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

DEFAULT_BUNDLE

private static final java.lang.String DEFAULT_BUNDLE
See Also:
Constant Field Values

args

protected java.lang.String args
The arguments.


key

protected java.lang.String key
The message key of the message to be retrieved.


bundle

protected java.lang.String bundle
The servlet context attribute key for our resources.

Constructor Detail

SpagoBIMessageTag

public SpagoBIMessageTag()
Method Detail

getArgs

public java.lang.String getArgs()
Returns:
The arguments

setArgs

public void setArgs(java.lang.String args)
Parameters:
args - The arguments to set

getBundle

public java.lang.String getBundle()
Returns:
The servlet context attribute key

setBundle

public void setBundle(java.lang.String bundle)
Parameters:
bundle - The servlet context attribute key to set

getKey

public java.lang.String getKey()
Returns:
The reference key

setKey

public void setKey(java.lang.String key)
Parameters:
key - The key to set

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Process the start tag.

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException - if a JSP exception has occurred

release

public void release()
Release any acquired resources.

Specified by:
release in interface javax.servlet.jsp.tagext.Tag
Overrides:
release in class javax.servlet.jsp.tagext.TagSupport

replace

protected java.lang.String replace(java.lang.String messageFormat,
                                   int iParameter,
                                   java.lang.Object value)
Substitutes the message value to the placeholders.

Parameters:
messageFormat - The String representing the message format
iParameter - The numeric value defining the replacing string
value - Input object containing parsing information
Returns:
The parsed string

getMessage

public java.lang.String getMessage(javax.portlet.PortletRequest portReq,
                                   java.lang.String code)
A methd useful to call messages directly into code.

Parameters:
portReq - The portlet request object
code - The message code
Returns:
The message string matching to code