Author: ekoneil
Date: Tue Jan 25 18:47:25 2005
New Revision: 126459

URL: http://svn.apache.org/viewcvs?view=rev&rev=126459
Log:
Data binding tag cleanup.

Delete the StructuredBaseTag, which supported rendering cooperating tags as a 
state machine.  This is only used in the RepeaterComponent base class, and the 
functionality has been absorbed there.

Also add RepeaterErrors to the "databinding" test suite.

BB: self
DRT: NetUI pass
BVT: NetUI pass



Removed:
   
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/base/StructuredBaseTag.java
Modified:
   
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/Repeater.java
   
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterComponent.java
   
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterFooter.java
   
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterHeader.java
   
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterItem.java
   
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/pad/Pad.java
   
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/pad/PadContext.java
   
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/script/GetData.java
   
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/xml/SerializeXML.java
   
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml

Deleted: 
/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/base/StructuredBaseTag.java
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/base/StructuredBaseTag.java?view=auto&rev=126458
==============================================================================

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/Repeater.java
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/Repeater.java?view=diff&rev=126459&p1=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/Repeater.java&r1=126458&p2=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/Repeater.java&r2=126459
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/Repeater.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/Repeater.java
 Tue Jan 25 18:47:25 2005
@@ -17,7 +17,9 @@
  */
 package org.apache.beehive.netui.tags.databinding.repeater;
 
-// java imports
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TryCatchFinally;
+import java.util.Iterator;
 
 import org.apache.beehive.netui.script.common.DataAccessProviderStack;
 import org.apache.beehive.netui.script.common.IDataAccessProvider;
@@ -27,12 +29,6 @@
 import 
org.apache.beehive.netui.util.exception.LocalizedUnsupportedOperationException;
 import org.apache.beehive.netui.util.iterator.IteratorFactory;
 import org.apache.beehive.netui.util.logging.Logger;
-
-import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.tagext.TryCatchFinally;
-import java.util.Iterator;
-
-// external imports
 
 /**
  * The <netui-data:repeater> tag is a markup-generic tag that repeats over 
a data set.

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterComponent.java
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterComponent.java?view=diff&rev=126459&p1=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterComponent.java&r1=126458&p2=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterComponent.java&r2=126459
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterComponent.java
        (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterComponent.java
        Tue Jan 25 18:47:25 2005
@@ -17,16 +17,12 @@
  */
 package org.apache.beehive.netui.tags.databinding.repeater;
 
-// java imports
-
 import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.Tag;
 
-// internal imports
-import org.apache.beehive.netui.tags.databinding.base.StructuredBaseTag;
-
+import org.apache.beehive.netui.tags.AbstractClassicTag;
 import org.apache.beehive.netui.util.Bundle;
-
-// external imports
+import org.apache.beehive.netui.util.logging.Logger;
 
 /**
  * The base class for tags that are part of the [EMAIL PROTECTED] Repeater} 
tag set
@@ -34,43 +30,135 @@
  * This class provides typed access to the [EMAIL PROTECTED] Repeater} tag and
  * enforces the basic JSP tag parenting requirements of tags that can
  * only be nested within the [EMAIL PROTECTED] Repeater} tag.
- *
- * @see StructuredBaseTag
  */
 public abstract class RepeaterComponent
-    extends StructuredBaseTag {
+    extends AbstractClassicTag {
+
+    private static final Logger LOGGER = 
Logger.getInstance(RepeaterComponent.class);
 
     private Repeater _repeater = null;
 
     /**
-     * Default implementation of this JSP lifecycle method.
+     * Starts a tag's lifecycle.  This method performs several operations 
before
+     * invoking the @see renderStartTag(int) method.  In order, these stages 
are:
+     * <ol>
+     * <li>@see verifyStructure()</li>
+     * <li>@see prepare()</li>
+     * <li>@see verifyAttributes()</li>
+     * <li>@see renderStartTag(int)</li>
+     * </ol>
+     * The benefit of this lifecycle is that it provides a structure for 
component
+     * tags that are immediately nested inside of repeating tags.
+     * <br/>
+     * <br/>
+     * Any errors that occur before calling @see renderStartTag(int) are 
reported
+     * in the page.
      *
-     * @return SKIP_BODY
+     * @return the value returned from calling @see renderStartTag(int), which 
can be
+     *         any value that can be returned from the @see 
javax.servlet.jsp.tagext.TagSupport
+     *         class.  If an error occurs, the tag returns SKIP_BODY.
      */
-    public int doAfterBody()
+    public int doStartTag()
         throws JspException {
-        return SKIP_BODY;
+        int ret = SKIP_BODY;
+        try {
+            Tag parent = getParent();
+            Class validContainer = Repeater.class;
+
+            if((validContainer != null && parent == null) ||
+                validContainer != null && 
!validContainer.isAssignableFrom(parent.getClass())) {
+                if(LOGGER.isErrorEnabled()) {
+                    LOGGER.error("A tag of type \"" + getClass().getName() + 
"\" must be nested within a tag of type \"" + Repeater.class.getName() + "\"");
+                }
+
+                String msg = 
Bundle.getString("Tags_StructuredBaseTag_invalidParent", new 
Object[]{getClass().getName(), Repeater.class.getName()});
+                registerTagError(msg, null);
+            }
+
+            if(LOGGER.isDebugEnabled())
+                LOGGER.debug("verifyStructure: hasErrors=" + hasErrors());
+
+            if(hasErrors()) {
+                reportErrors();
+                return SKIP_BODY;
+            }
+
+            /* the repeater property needs to be populated *before* 
verifyAttributes() is called */
+            _repeater = (Repeater)getParent();
+
+            verifyAttributes();
+
+            _repeater.registerChildTag(this);
+
+            if(LOGGER.isDebugEnabled())
+                LOGGER.debug("verifyAttributes: hasErrors=" + hasErrors());
+
+            if(hasErrors()) {
+                reportErrors();
+                return SKIP_BODY;
+            }
+
+            if(shouldRender())
+                ret = EVAL_BODY_BUFFERED;
+            else ret = SKIP_BODY;
+        } catch(Exception e) {
+            String msg = 
Bundle.getString("Tags_StructuredBaseTag_startTagError", new 
Object[]{getTagName(), e});
+
+            if(LOGGER.isErrorEnabled())
+                LOGGER.error("An error occurred rendering the startTag of the 
tag \"" + getTagName() + "\".  Cause: " + e, e);
+
+            registerTagError(msg, e);
+            reportErrors();
+            ret = SKIP_BODY;
+        }
+
+        return ret;
     }
 
     /**
-     * Reset all of the fields of this tag.
+     * Default implementation of this JSP lifecycle method.
+     *
+     * @return SKIP_BODY
      */
-    protected void localRelease() {
-        super.localRelease();
-        _repeater = null;
+    public int doAfterBody()
+        throws JspException {
+        assert _repeater != null;
+        _repeater.addContent(bodyContent.getString());
+        return SKIP_BODY;
     }
 
     /**
-     * Default implementation of [EMAIL PROTECTED] 
StructuredBaseTag#renderEndTag(int)}.
-     * This returns EVAL_PAGE.
+     * Ends a tag's lifecycle.  This call is a wrapper around the @see 
renderEndTag(int) call
+     * that allows a tag directly contained in a repeating tag to act based on 
the state
+     * of the parent.
      *
-     * @param state the current render state of the Repeater
      * @return EVAL_PAGE
-     * @throws JspException if an error occurs that can not be reported in the 
page
+     * @throws JspException if an error that occurred that could not be 
reported to the page
      */
-    protected int renderEndTag(int state)
+    public int doEndTag()
         throws JspException {
-        return EVAL_PAGE;
+        /*
+           note, this does not report errors because the <repeater> tag itself 
does
+           the error reporting
+         */
+        if(hasErrors()) {
+            localRelease();
+            return EVAL_PAGE;
+        }
+
+        int ret = EVAL_PAGE;
+        try {
+            int state = _repeater.getRenderState();
+            ret = renderEndTag(state);
+        } catch(Exception e) {
+            String msg = 
Bundle.getString("Tags_StructuredBaseTag_endTagError", new 
Object[]{getTagName(), e.toString()});
+            registerTagError(msg, e);
+            reportErrors();
+            ret = EVAL_PAGE;
+        }
+
+        localRelease();
+        return ret;
     }
 
     /**
@@ -83,32 +171,30 @@
     }
 
     /**
-     * Prepare data that is provided to subclasses of this tag.
+     * Reset all of the fields of this tag.
      */
-    protected void prepare() {
-        _repeater = (Repeater)getParent();
+    protected void localRelease() {
+        super.localRelease();
 
-        _repeater.registerChildTag(this);
-    }
+        // This is a work around in Tomcat where clearBody() throwns an 
internal exception
+        // because the BodyContent tag is pooled and under certain situtions 
the pooled object has been
+        // flushed.
+        try {
+            if(bodyContent != null)
+                bodyContent.clearBody();
+        } catch(Exception ignore) {}
 
-    /**
-     * Default implementation of [EMAIL PROTECTED] 
StructuredBaseTag#getValidContainerType} that
-     * enforces that the parent of this tag is the [EMAIL PROTECTED] Repeater} 
tag.  Subclasses
-     * may override this method to further specialize the required container 
type.
-     *
-     * @return the valid container type of a RepeaterComponent; the 
Repeater.class
-     */
-    protected Class getValidContainerType() {
-        return Repeater.class;
+        _repeater = null;
     }
 
-    /**
-     * Get the render state of the nearest structured tag.  For subclasses of 
this
-     * tag, the nearest structured tag is the [EMAIL PROTECTED] Repeater} tag.
-     *
-     * @return the current render state of the Repeater
-     */
-    protected int getCurrentRenderState() {
-        return _repeater.getRenderState();
+    protected abstract boolean shouldRender();
+
+    protected void verifyAttributes()
+        throws JspException
+    {}
+
+    protected int renderEndTag(int state)
+        throws JspException {
+        return  EVAL_PAGE;
     }
-}
+}
\ No newline at end of file

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterFooter.java
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterFooter.java?view=diff&rev=126459&p1=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterFooter.java&r1=126458&p2=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterFooter.java&r2=126459
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterFooter.java
   (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterFooter.java
   Tue Jan 25 18:47:25 2005
@@ -17,12 +17,6 @@
  */
 package org.apache.beehive.netui.tags.databinding.repeater;
 
-// java imports
-
-// internal imports
-
-// external imports
-
 /**
  * This tag is used to render the footer of a [EMAIL PROTECTED] Repeater}.  
This
  * header may contain any markup or tags that can be rendered to a page.  In
@@ -88,38 +82,7 @@
         return "RepeaterFooter";
     }
 
-    /**
-     * Render the start of this tag.  If the repeater render state is [EMAIL 
PROTECTED] Repeater#FOOTER},
-     * the body is evaluated.  Otherwise, the body is skipped.
-     *
-     * @return SKIP_BODY unless the repeater render state is [EMAIL PROTECTED] 
Repeater#FOOTER}, then EVAL_BODY_BUFFERED
-     */
-    public int renderStartTag(int state) {
-        if(state == Repeater.FOOTER)
-            return EVAL_BODY_BUFFERED;
-        else
-            return SKIP_BODY;
-    }
-
-    /**
-     * Render the content of the body to the Repeater tag.
-     *
-     * @return SKIP_BODY
-     */
-    public int doAfterBody() {
-        getRepeater().addContent(bodyContent.getString());
-        return SKIP_BODY;
-    }
-
-    protected void localRelease() {
-        super.localRelease();
-
-        // This is a work around in Tomcat where clearBody() throwns an 
internal exception
-        // because the BodyContent tag is pooled and under certain situtions 
the pooled object has been
-        // flushed.
-        try {
-            if(bodyContent != null) bodyContent.clearBody();
-        } catch(Exception ignore) {
-        }
+    public boolean shouldRender() {
+        return getRepeater().getRenderState() == Repeater.FOOTER;
     }
 }

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterHeader.java
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterHeader.java?view=diff&rev=126459&p1=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterHeader.java&r1=126458&p2=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterHeader.java&r2=126459
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterHeader.java
   (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterHeader.java
   Tue Jan 25 18:47:25 2005
@@ -17,12 +17,6 @@
  */
 package org.apache.beehive.netui.tags.databinding.repeater;
 
-// java imports
-
-// internal imports
-
-// external imports
-
 /**
  * This tag is used to render the header of a [EMAIL PROTECTED] Repeater}.  
This header may contain
  * any markup or tags that can be rendered to a page.  In the case of starting 
a
@@ -88,40 +82,7 @@
         return "RepeaterHeader";
     }
 
-    /**
-     * Render the start of this tag.  If the repeater render state is [EMAIL 
PROTECTED] Repeater#HEADER},
-     * the body is evaluated.  Otherwise, the body is skipped.
-     *
-     * @return SKIP_BODY unless the repeater render state is [EMAIL PROTECTED] 
Repeater#HEADER}, then EVAL_BODY_BUFFERED
-     */
-    public int renderStartTag(int state) {
-        if(state == Repeater.HEADER)
-            return EVAL_BODY_BUFFERED;
-        else
-            return SKIP_BODY;
-    }
-
-    /**
-     * Render the content of the body to the Repeater tag.
-     *
-     * @return SKIP_BODY
-     */
-    public int doAfterBody() {
-        getRepeater().addContent(bodyContent.getString());
-
-        return SKIP_BODY;
-    }
-
-    protected void localRelease() {
-        super.localRelease();
-
-        // This is a work around in Tomcat where clearBody() throwns an 
internal exception
-        // because the BodyContent tag is pooled and under certain situtions 
the pooled object has been
-        // flushed.
-        try {
-            if(bodyContent != null) bodyContent.clearBody();
-        } catch(Exception ignore) {
-        }
-
+    protected boolean shouldRender() {
+        return getRepeater().getRenderState() == Repeater.HEADER;
     }
 }

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterItem.java
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterItem.java?view=diff&rev=126459&p1=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterItem.java&r1=126458&p2=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterItem.java&r2=126459
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterItem.java
     (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterItem.java
     Tue Jan 25 18:47:25 2005
@@ -17,16 +17,6 @@
  */
 package org.apache.beehive.netui.tags.databinding.repeater;
 
-// java imports
-
-import javax.servlet.jsp.JspException;
-
-// internal imports
-
-// external imports
-import org.apache.beehive.netui.util.logging.Logger;
-
-
 /**
  * This tag is used to render each item in the data set.  The items in the 
data set are
  * provided by this tag's Repeater parent and are available for databinding 
using the
@@ -45,13 +35,6 @@
  * a &lt;netui-data:repeater> tag.</p>
  * <p>By default, the &lt;netui-data:repeaterItem> simply renders its body 
once for each of the items in the
  * &lt;netui-data:repeater> tag's data set.</p>
- * <p>A &lt;netui-data:repeaterItem> has the ability to render different HTML
- * markup for each of the items that
- * it renders. This is possible using the
- * [EMAIL PROTECTED] 
com.bea.wlw.netui.tags.databinding.repeater.choice.ChoiceMethod}
- * and [EMAIL PROTECTED] 
com.bea.wlw.netui.tags.databinding.repeater.choice.Choice} tags.
- * The &lt;netui-data:choiceMethod> tag decides which &lt;netui-data:choice>
- * tag to render.</p>
  * @example The following sample renders the data set as an HTML table.  The 
&lt;netui-data:repeaterItem> tag
  * renders a new row in the table for each item in the data set.
  * <p/>
@@ -83,8 +66,6 @@
 public class RepeaterItem
     extends RepeaterComponent {
 
-    private static final Logger LOGGER = 
Logger.getInstance(RepeaterItem.class);
-
     /**
      * Get the name of this tag.  This is used to identify the type of this tag
      * for reporting tag errors.
@@ -95,42 +76,7 @@
         return "RepeaterItem";
     }
 
-    /**
-     * Render the start of this tag.  If the repeater render state is [EMAIL 
PROTECTED] Repeater#ITEM},
-     * the body is evaluated.  Otherwise, the body is skipped.
-     *
-     * @return SKIP_BODY unless the repeater render state is [EMAIL PROTECTED] 
Repeater#ITEM}, then EVAL_BODY_BUFFERED
-     */
-    public int renderStartTag(int state) {
-        if(state == Repeater.ITEM)
-            return EVAL_BODY_BUFFERED;
-        else
-            return SKIP_BODY;
-    }
-
-    /**
-     * @return SKIP_BODY if the item has completed rendering; 
EVAL_BODY_BUFFERED if the body should render again.
-     */
-    public int doAfterBody()
-        throws JspException {
-        if(bodyContent != null)
-            getRepeater().addContent(bodyContent.getString());
-
-        return SKIP_BODY;
-    }
-
-    /**
-     * Reset all of the fields of this tag.
-     */
-    protected void localRelease() {
-        super.localRelease();
-
-        // This is a work around in Tomcat where clearBody() throwns an 
internal exception
-        // because the BodyContent tag is pooled and under certain situtions 
the pooled object has been
-        // flushed.
-        try {
-            if(bodyContent != null) bodyContent.clearBody();
-        } catch(Exception ignore) {
-        }
+    protected boolean shouldRender() {
+        return getRepeater().getRenderState() == Repeater.ITEM;
     }
 }

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/pad/Pad.java
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/pad/Pad.java?view=diff&rev=126459&p1=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/pad/Pad.java&r1=126458&p2=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/pad/Pad.java&r2=126459
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/pad/Pad.java
  (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/pad/Pad.java
  Tue Jan 25 18:47:25 2005
@@ -17,18 +17,12 @@
  */
 package org.apache.beehive.netui.tags.databinding.repeater.pad;
 
-// java imports
-
 import javax.servlet.jsp.JspException;
 
-// internal imports
 import org.apache.beehive.netui.tags.databinding.repeater.RepeaterComponent;
-
 import org.apache.beehive.netui.util.Bundle;
 import org.apache.beehive.netui.util.logging.Logger;
 
-// external imports
-
 /**
  * <p/>
  * A tag that affects the number of items that are rendered in a
@@ -48,7 +42,7 @@
  *
  * @jsptagref.tagdescription <p>
  * Sets the number of items rendered by a
- * [EMAIL PROTECTED] com.bea.wlw.netui.tags.databinding.repeater.Repeater} tag.
+ * [EMAIL PROTECTED] 
org.apache.beehive.netui.tags.databinding.repeater.Repeater} tag.
  * The &lt;netui-data:pad> tag has the ability to turn an irregular data set 
in the
  * &lt;netui-data:repeater> tag
  * into a regular data set through the use of the three attributes:
@@ -81,8 +75,6 @@
 
     private static final Logger LOGGER = Logger.getInstance(Pad.class);
 
-    private static final String EMPTY_STRING = "";
-
     private String _padText = null;
     private Integer _maxRepeat = null;
     private Integer _minRepeat = null;
@@ -150,16 +142,15 @@
         _minRepeat = new Integer(minRepeat);
     }
 
-    /**
-     * Render the body of this tag and buffer the output.  If
-     * the padText attribute is unset, the body content is used instead.
-     */
-    public int renderStartTag(int state)
-        throws JspException {
+    protected boolean shouldRender() {
         if(_padText == null)
-            return EVAL_BODY_BUFFERED;
-        else
-            return SKIP_BODY;
+            return true;
+        else return false;
+    }
+    
+    public int doAfterBody()
+        throws JspException {
+        return SKIP_BODY;
     }
 
     /**
@@ -170,12 +161,11 @@
      * @return EVAL_PAGE
      * @throws JspException if an error occurs that can not be reported on the 
page
      */
-    public int renderEndTag(int state)
+    protected int renderEndTag(int state)
         throws JspException {
+
         if(_padText == null) {
             _padText = bodyContent.getString();
-        } else {
-            _padText = _padText != null ? _padText : EMPTY_STRING;
         }
 
         if(hasErrors()) {
@@ -198,7 +188,8 @@
      */
     protected void localRelease() {
         super.localRelease();
-        if(bodyContent != null) bodyContent.clearBody();
+        if(bodyContent != null)
+            bodyContent.clearBody();
         _padText = null;
         _maxRepeat = null;
         _minRepeat = null;

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/pad/PadContext.java
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/pad/PadContext.java?view=diff&rev=126459&p1=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/pad/PadContext.java&r1=126458&p2=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/pad/PadContext.java&r2=126459
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/pad/PadContext.java
   (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/pad/PadContext.java
   Tue Jan 25 18:47:25 2005
@@ -17,12 +17,6 @@
  */
 package org.apache.beehive.netui.tags.databinding.repeater.pad;
 
-// java imports
-
-// internal imports
-
-// external imports
-
 /**
  * A JavaBean that encapsulates the data needed to pad a Repeater with
  * text.  The PadContext is needed if the given consttraints, the

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/script/GetData.java
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/script/GetData.java?view=diff&rev=126459&p1=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/script/GetData.java&r1=126458&p2=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/script/GetData.java&r2=126459
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/script/GetData.java
    (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/script/GetData.java
    Tue Jan 25 18:47:25 2005
@@ -17,17 +17,10 @@
  */
 package org.apache.beehive.netui.tags.databinding.script;
 
-// java imports
-
 import javax.servlet.jsp.JspException;
 
-// internal imports
 import org.apache.beehive.netui.tags.AbstractClassicTag;
-
-import org.apache.beehive.netui.util.Bundle;
 import org.apache.beehive.netui.util.logging.Logger;
-
-// external imports
 
 /**
  * <p/>

Modified: 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/xml/SerializeXML.java
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/xml/SerializeXML.java?view=diff&rev=126459&p1=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/xml/SerializeXML.java&r1=126458&p2=incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/xml/SerializeXML.java&r2=126459
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/xml/SerializeXML.java
  (original)
+++ 
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/xml/SerializeXML.java
  Tue Jan 25 18:47:25 2005
@@ -17,16 +17,10 @@
  */
 package org.apache.beehive.netui.tags.databinding.xml;
 
-// java imports
-
 import javax.servlet.jsp.JspException;
 
-// internal imports
 import org.apache.beehive.netui.tags.AbstractClassicTag;
-import org.apache.beehive.netui.util.Bundle;
 import org.apache.beehive.netui.util.logging.Logger;
-
-// external imports
 import org.apache.xmlbeans.XmlObject;
 
 /**
@@ -85,7 +79,8 @@
             write(buf.toString());
         } else {
             // @todo: write anything to the page?
-            if(LOGGER.isInfoEnabled()) LOGGER.info("The expression \"" + 
_source + "\" resulted in an object that was not an XMLBean");
+            if(LOGGER.isInfoEnabled())
+                LOGGER.info("The expression \"" + _source + "\" resulted in an 
object that was not an XMLBean");
         }
 
         localRelease();

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml?view=diff&rev=126459&p1=incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml&r1=126458&p2=incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml&r2=126459
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
   (original)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
   Tue Jan 25 18:47:25 2005
@@ -4730,6 +4730,7 @@
          <webapp>coreWeb</webapp>
          <categories>
             <category>bvt</category>
+            <category>databinding</category>
             <category>bvt.struts11</category>
             <category>errorTests</category>
          </categories>

Reply via email to