BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs.

com.bea.wlw.netui.tags
Class AbstractBaseTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by com.bea.wlw.netui.tags.AbstractBaseTag
All Implemented Interfaces:
HtmlConstants, Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag
Direct Known Subclasses:
AbstractCallMethod, Anchor, Attribute, Base, BindingUpdateErrors, Body, Button, CheckBoxOption, Content, DataSourceTag, DeclareBundle, DeclareControl, DeclarePageInput, Error, Errors, Form, FormatTag, GetData, GetNetuiTagName, Image, ImageButton, IncludeSection, Label, Message, MessageArg, MethodParameter, Node, Parameter, ParameterMap, RadioButtonOption, RewriteName, RewriteURL, ScriptContainer, Section, SelectOption, SetAttribute, StructuredBaseTag, Template, Visible

public abstract class AbstractBaseTag
extends javax.servlet.jsp.tagext.BodyTagSupport
implements HtmlConstants

Abstract tag class that most netui tags are based from. AbstractBaseTag provides the following functionality:

  • Error registration and display
  • NetUI Expression handling
  • Base attribute rendering
  • See Also:
    Serialized Form

    Field Summary
    protected static int ATTR_GENERAL
               
    protected static int ATTR_GENERAL_EXPRESSION
               
    protected static int ATTR_JAVASCRIPT
               
    protected static int ATTR_STYLE
               
    static String JAVASCRIPT_STATUS
               
    static String NETUI_UNIQUE_CNT
               
     
    Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
    bodyContent
     
    Fields inherited from class javax.servlet.jsp.tagext.TagSupport
    id, pageContext
     
    Fields inherited from interface com.bea.wlw.netui.tags.html.HtmlConstants
    ACCEPT, ACCESSKEY, ACTION, ALIGN, ALINK, ALT, ANCHOR, BACKGROUND, BASE, BGCOLOR, BODY, BORDER, BR, CAPTION, CELLPADDING, CELLSPACING, CHAR, CHAROFF, CHARSET, CHECKED, CLASS, COLS, COORDS, DIR, DISABLED, DIV, ENCTYPE, FOR, FORM, FORM_GET, FORM_POST, FRAME, HEIGHT, HREF, HREFLANG, HSPACE, HTML, ID, IMAGE, INPUT, INPUT_BUTTON, INPUT_CHECKBOX, INPUT_FILE, INPUT_HIDDEN, INPUT_IMAGE, INPUT_PASSWORD, INPUT_RADIO, INPUT_RESET, INPUT_SUBMIT, INPUT_TEXT, ISMAP, LABEL, LANG, LINK, LONGDESC, MAXLENGTH, METHOD, NAME, ONBLUR, ONCHANGE, ONCLICK, ONDBLCLICK, ONFOCUS, ONKEYDOWN, ONKEYPRESS, ONKEYUP, ONLOAD, ONMOUSEDOWN, ONMOUSEMOVE, ONMOUSEOUT, ONMOUSEOVER, ONMOUSEUP, ONRESET, ONSELECT, ONSUBMIT, ONUNLOAD, OPTION, READONLY, REL, REV, ROWS, RULES, SELECT, SHAPE, SIZE, SPAN, SRC, STYLE, SUMMARY, TABINDEX, TABLE, TARGET, TD, TEXT, TEXTAREA, TITLE, TR, TYPE, USEMAP, VALIGN, VALUE, VLINK, VSPACE, WIDTH
     
    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
    AbstractBaseTag()
               
     
    Method Summary
    protected  String addTagIdMapping(String tagId, String value)
              This method will add a tagId and value to the ScriptRepoter TagId map.
    protected  boolean containsExpression(String expression)
               
    protected  String evaluateAttributeToString(String expression, String attrName)
              This method will evaluate an attribute and return the real value or null.
    protected  Object evaluateExpression(String expression, String attrName)
               
    protected  String filter(String value)
               
    protected  String filter(String value, boolean markupHTMLSpaceReturn)
              Filter the specified string for characters that are senstive to HTML interpreters, returning the string with these characters replaced by the corresponding character entities.
    protected  String formatErrorString(String key, Object[] values)
               
    protected  String formatString(String key, Object[] values)
               
    protected  String getAttribute(int type, String key)
              Deprecated.  
    protected  String getErrorsReport()
               
    protected  ExpressionEvaluator getExpressionEvaluator()
               
    protected  JavaScriptUtils getJavaScriptUtils(javax.servlet.http.HttpServletRequest request)
              This method will return the javaScriptUtils that is assocated with this request.
     Form getNearestForm()
              Returns the closest parent form tag, or null if there is none.
    protected  int getNextId(javax.servlet.http.HttpServletRequest req)
              This method will generate the next unique int within the HTML tag.
    protected  String getQualifiedBundleName(String bundleName)
              Qualify the given bundle name with the current module path.
    protected  ScriptReporter getScriptReporter()
               
    abstract  String getTagName()
               
    protected  Locale getUserLocale()
               
    protected  boolean hasErrors()
               
    protected  boolean isExpression(String expression)
               
    protected  void localRelease()
              This is a method that will initialize all temp state on a tag and should be called in the doEndTag method.
    protected  void prepForRendering(AbstractAttributeState state)
              This method will return a string representing all of the expression based attributes.
    protected  void registerAttribute(int type, String key, String value)
              Deprecated.  
     void registerError(EvalErrorInfo error)
              This method will add an error to the errors begin tracked by this tag.
     String registerTagError(String message)
              This will report an error from a tag.
     void release()
               
    protected  void removeAttribute(int type, String key)
              Deprecated.  
    protected  void renderAttribute(weblogic.utils.UnsyncStringBuffer buf, String name, String value)
              Deprecated.  
    protected  String renderAttributes(int type)
              Deprecated.  
    protected  void reportErrors()
              This will report an expression error.
    protected  String rewriteName(String name)
              This method will rewrite the name (id) by passing it to the URL Rewritter and getting back a value.
     void setPageContext(javax.servlet.jsp.PageContext pc)
               
    protected  void updateExpression(String expr, Object value)
               
    protected  void write(String string)
              This mehod will write the passed string to the response.
     
    Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
    doAfterBody, doEndTag, doInitBody, doStartTag, getBodyContent, getPreviousOut, setBodyContent
     
    Methods inherited from class javax.servlet.jsp.tagext.TagSupport
    findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setParent, setValue
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     
    Methods inherited from interface javax.servlet.jsp.tagext.Tag
    getParent, setParent
     

    Field Detail

    JAVASCRIPT_STATUS

    public static final String JAVASCRIPT_STATUS
    See Also:
    Constant Field Values

    NETUI_UNIQUE_CNT

    public static final String NETUI_UNIQUE_CNT
    See Also:
    Constant Field Values

    ATTR_GENERAL

    protected static final int ATTR_GENERAL
    See Also:
    Constant Field Values

    ATTR_STYLE

    protected static final int ATTR_STYLE
    See Also:
    Constant Field Values

    ATTR_JAVASCRIPT

    protected static final int ATTR_JAVASCRIPT
    See Also:
    Constant Field Values

    ATTR_GENERAL_EXPRESSION

    protected static final int ATTR_GENERAL_EXPRESSION
    See Also:
    Constant Field Values
    Constructor Detail

    AbstractBaseTag

    public AbstractBaseTag()
    Method Detail

    getTagName

    public abstract String getTagName()

    setPageContext

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

    localRelease

    protected void localRelease()
    This is a method that will initialize all temp state on a tag and should be called in the doEndTag method.


    release

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

    registerTagError

    public String registerTagError(String message)
    This will report an error from a tag. The error will contain a message. If error reporting is turned off, the message will be returned and the caller should throw a JspException to report the error.

    Parameters:
    message - - the message to register with the error
    Returns:
    null

    getExpressionEvaluator

    protected final ExpressionEvaluator getExpressionEvaluator()
    Exclude:

    registerAttribute

    protected void registerAttribute(int type,
                                     String key,
                                     String value)
    Deprecated. 

    Exclude:

    removeAttribute

    protected void removeAttribute(int type,
                                   String key)
    Deprecated. 

    Exclude:

    getAttribute

    protected String getAttribute(int type,
                                  String key)
    Deprecated. 

    Exclude:

    renderAttributes

    protected String renderAttributes(int type)
    Deprecated. 

    renderers.

    Exclude:

    write

    protected final void write(String string)
    This mehod will write the passed string to the response.

    Parameters:
    string - to be written to the response.

    filter

    protected final String filter(String value)

    filter

    protected String filter(String value,
                            boolean markupHTMLSpaceReturn)
    Filter the specified string for characters that are senstive to HTML interpreters, returning the string with these characters replaced by the corresponding character entities.

    Parameters:
    value - The string to be filtered and returned
    markupHTMLSpaceReturn - convert space characters and return characters to &nbsp; and <br /> marketup for html.

    formatString

    protected String formatString(String key,
                                  Object[] values)
    Exclude:

    formatErrorString

    protected String formatErrorString(String key,
                                       Object[] values)
    Exclude:

    evaluateExpression

    protected Object evaluateExpression(String expression,
                                        String attrName)
    Exclude:

    evaluateAttributeToString

    protected String evaluateAttributeToString(String expression,
                                               String attrName)
    This method will evaluate an attribute and return the real value or null. If the attribute contains an expression the expression will be evaluted and the object found returned as a String. If the attributres contains an expression and doesn't return a value then null will be returned. if the attribute doesn't contain an expresion it will be returned unchanged.


    isExpression

    protected boolean isExpression(String expression)
    Exclude:

    containsExpression

    protected boolean containsExpression(String expression)
    Exclude:

    hasErrors

    protected boolean hasErrors()
    Exclude:

    getErrorsReport

    protected String getErrorsReport()
    Exclude:

    reportErrors

    protected void reportErrors()
                         throws javax.servlet.jsp.JspException
    This will report an expression error.

    Throws:
    javax.servlet.jsp.JspException
    Exclude:

    rewriteName

    protected String rewriteName(String name)
    This method will rewrite the name (id) by passing it to the URL Rewritter and getting back a value.


    registerError

    public void registerError(EvalErrorInfo error)
    This method will add an error to the errors begin tracked by this tag.

    Exclude:

    updateExpression

    protected void updateExpression(String expr,
                                    Object value)
                             throws ExpressionUpdateException,
                                    javax.servlet.jsp.JspException
    Throws:
    ExpressionUpdateException
    javax.servlet.jsp.JspException

    renderAttribute

    protected final void renderAttribute(weblogic.utils.UnsyncStringBuffer buf,
                                         String name,
                                         String value)
    Deprecated. 

    This method will write append an attribute value to a StringBuffer. The method assumes that the attr is not null. If the value is null the attribute will not be appended to the StringBuffer.


    getNearestForm

    public Form getNearestForm()
    Returns the closest parent form tag, or null if there is none.


    addTagIdMapping

    protected String addTagIdMapping(String tagId,
                                     String value)
    This method will add a tagId and value to the ScriptRepoter TagId map. The a ScriptContainer tag will create a JavaScript table that allows the container, such as a portal, to rewrite the id so it's unique. The real name may be looked up based upon the tagId. If the no ScriptReporter is found, a script string will be returned to the caller so they can output the script block.


    getNextId

    protected int getNextId(javax.servlet.http.HttpServletRequest req)
    This method will generate the next unique int within the HTML tag.

    Exclude:

    getScriptReporter

    protected ScriptReporter getScriptReporter()

    getJavaScriptUtils

    protected JavaScriptUtils getJavaScriptUtils(javax.servlet.http.HttpServletRequest request)
    This method will return the javaScriptUtils that is assocated with this request. If this doesn't exist, it will be created before it is returned.

    Parameters:
    request - the HttpServletRequest associated with this request
    Returns:
    a JavaScriptUtils assocated with the request

    getQualifiedBundleName

    protected String getQualifiedBundleName(String bundleName)
    Qualify the given bundle name with the current module path.

    Exclude:

    getUserLocale

    protected Locale getUserLocale()
    Returns:
    the Locale object to use when rendering this tag

    prepForRendering

    protected void prepForRendering(AbstractAttributeState state)
                             throws javax.servlet.jsp.JspException
    This method will return a string representing all of the expression based attributes.

    Throws:
    javax.servlet.jsp.JspException

    BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs.