com.tonbeller.wcf.component
Class RendererTag

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended bycom.tonbeller.wcf.component.RendererTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.IterationTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag

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

renders a Component via xsl stylesheet. The following stylesheet parameters are provided automatically (w/o nested parameter tag):

Parameters may occur in xsl (as usual) and in the Document created by the Component

Searches for <param name=".."/> elements and creates a corresponding attribute in its parent. For example, if a Components render() method returns the following Document

 <myelem>
   <param name="abc" attr="bcd"/>
 </myelem>
 
it will become
 <myelem bcd="efg">
   <param name="abc" attr="bcd"/>
 </myelem>
 
where efg is the value of the abc parameter. If the parameter abc does not exsist, the attribute bcd is removed.

This may be used to configure the page flow from a jsp, e.g.

   <button label="OK" action="validate" handler="...">
     <param name="successPage" attr="forward"/>
   </button>
 
will create a forward attribute to the button element whose value is supplied by the jsp author.

Author:
av
See Also:
Serialized Form

Field Summary
 
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
RendererTag()
           
 
Method Summary
 int doEndTag()
          renders the component
 int doStartTag()
           
 java.lang.String getRef()
          Returns the ref.
 java.lang.String getXslUri()
          Returns the xslUri.
 boolean isXslCache()
          Returns the xslCache.
 void removeParameter(java.lang.String name)
          removes a parameter that is defined globally for this transformation
 void setRef(java.lang.String ref)
          Sets the ref.
protected  void setXmlParameters(org.w3c.dom.Document document)
          sets the parameters to the xml document.
protected  void setXmlParameters(org.w3c.dom.NodeList list)
           
 void setXslCache(boolean xslCache)
          Sets the xslCache.
 void setXslUri(java.lang.String xslUri)
          Sets the xslUri.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RendererTag

public RendererTag()
Method Detail

removeParameter

public void removeParameter(java.lang.String name)
removes a parameter that is defined globally for this transformation

Parameters:
name -

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Throws:
javax.servlet.jsp.JspException

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
renders the component

Throws:
javax.servlet.jsp.JspException

setXmlParameters

protected void setXmlParameters(org.w3c.dom.Document document)
sets the parameters to the xml document. Searches for <param name=".."/> elements and creates a corresponding attribute in its parent. For example,
 <myelem>
   <param name="abc" attr="bcd"/>
 </myelem>
 
will become
 <myelem bcd="efg">
   <param name="abc" attr="bcd"/>
 </myelem>
 
where efg is the value of the abc parameter. If the parameter abc does not exsist, the attribute bcd is removed.


setXmlParameters

protected void setXmlParameters(org.w3c.dom.NodeList list)

getRef

public java.lang.String getRef()
Returns the ref.

Returns:
String

isXslCache

public boolean isXslCache()
Returns the xslCache.

Returns:
boolean

getXslUri

public java.lang.String getXslUri()
Returns the xslUri.

Returns:
String

setRef

public void setRef(java.lang.String ref)
Sets the ref.

Parameters:
ref - The ref to set

setXslCache

public void setXslCache(boolean xslCache)
Sets the xslCache.

Parameters:
xslCache - The xslCache to set

setXslUri

public void setXslUri(java.lang.String xslUri)
Sets the xslUri.

Parameters:
xslUri - The xslUri to set