beehive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ekon...@apache.org
Subject svn commit: rev 43612 - in incubator/beehive/trunk/netui: src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid test/webapps/drt/testRecorder/config test/webapps/drt/testRecorder/tests
Date Thu, 09 Sep 2004 16:41:09 GMT
Author: ekoneil
Date: Thu Sep  9 09:41:08 2004
New Revision: 43612

Added:
   incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridCustomTagAttributes.xml
Modified:
   incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractColumn.java
   incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AnchorColumn.java
   incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ImageColumn.java
   incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/LiteralColumn.java
   incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
Log:
Add <netui:attribute> support for adding user-defined attributes to the data grid tags.

Fixup the TLDX generation to define the nested tags are that allowed to be contained inside
the column tags.

BB: self
DRT: NetUI pass / data grid pass
BVT: NetUI pass



Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractColumn.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractColumn.java
(original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AbstractColumn.java
Thu Sep  9 09:41:08 2004
@@ -105,9 +105,6 @@
                 cm.setSortable(_sortable);
             cm.setSortExpression(_sortExpression);
 
-            // allow subclasses to apply attributes to their ColumnModel objects
-            applyAttributes();
-
             cm.setRenderState(columnsRenderState);
 
             StringBuffer buf = new StringBuffer();
@@ -132,6 +129,11 @@
                 fragment.invoke(sw);
                 bodyContent = sw.toString();
             }
+
+            // allow subclasses to apply attributes to their ColumnModel objects
+            // this needs to happen after the JspBody is rendered in
+            // case there are cooperating tags that need to be applied as attributes
+            applyAttributes();
 
             if (renderState == ColumnModel.HEADER_RENDER_STATE)
             {

Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AnchorColumn.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AnchorColumn.java
(original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/AnchorColumn.java
Thu Sep  9 09:41:08 2004
@@ -36,6 +36,7 @@
  * @netui.tldx:tag whitespace="indent" 
  *                 netuiexpressioninfo=""
  *                 renderer="workshop.netui.jspdesigner.tldx.AnchorColumnRenderer"
+ *                 requiredchild="parameter formatDate formatNumber formatString attrobite"
  */
 public class AnchorColumn
     extends AbstractHtmlColumn

Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ImageColumn.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ImageColumn.java
(original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ImageColumn.java
Thu Sep  9 09:41:08 2004
@@ -26,8 +26,9 @@
 /**
  * 
  * @netui:tag name="imageColumn" description="Renders a column of images in a NetUI data
grid" body-content="scriptless"
- * @netui.tldx:tag renderer="workshop.netui.jspdesigner.tldx.ImageColumnRenderer" whitespace="indent"
netuiexpressioninfo=""
- * @netui:attribute name="value" required="false"
+ * @netui.tldx:tag renderer="workshop.netui.jspdesigner.tldx.ImageColumnRenderer"
+ *                 whitespace="indent" netuiexpressioninfo=""
+ *                 requiredchild="attribute"
  */
 public class ImageColumn
     extends AbstractHtmlColumn

Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/LiteralColumn.java
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/LiteralColumn.java
(original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/LiteralColumn.java
Thu Sep  9 09:41:08 2004
@@ -29,6 +29,7 @@
  * @netui.tldx:tag whitespace="indent"
  *                 renderer="workshop.netui.jspdesigner.tldx.LiteralColumnRenderer"
  *                 netuiexpressioninfo=""
+ *                 requiredchild="formatDate formatNumber formatString attribute"
  */
 public class LiteralColumn
     extends AbstractHtmlColumn

Modified: incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
==============================================================================
--- 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
Thu Sep  9 09:41:08 2004
@@ -2090,6 +2090,21 @@
          </features>
       </test>
       <test>
+         <name>DataGridCustomTagAttributes</name>
+         <description>DataGridCustomTagAttributes</description>
+         <webapp>coreWeb</webapp>
+         <categories>
+            <category>bvt</category>
+            <category>drt</category>
+            <category>datagrid</category>
+            <category>databinding</category>
+         </categories>
+         <features>
+            <feature>Databinding</feature>
+            <feature>Data Grid</feature>
+         </features>
+      </test>
+      <test>
          <name>DataGridEmptyColumnsTag</name>
          <description>DataGridEmptyColumnsTag</description>
          <webapp>coreWeb</webapp>

Added: incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridCustomTagAttributes.xml
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridCustomTagAttributes.xml
Thu Sep  9 09:41:08 2004
@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ses:recorderSession xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session">
+   <ses:sessionName>DataGridCustomTagAttributes</ses:sessionName>
+   <ses:tester>ekoneil</ses:tester>
+   <ses:startDate>08 Sep 2004, 05:41:54.265 PM MDT</ses:startDate>
+   <ses:description>Test the application of custom tag attributes to data grid columns.</ses:description>
+   <ses:tests>
+      <ses:test>
+         <ses:testNumber>1</ses:testNumber>
+         <ses:request>
+            <ses:protocol>HTTP</ses:protocol>
+            <ses:protocolVersion>1.1</ses:protocolVersion>
+            <ses:host>localhost</ses:host>
+            <ses:port>8080</ses:port>
+            <ses:uri>/coreWeb/databinding/datagrid/misc/userAttributes.jsp</ses:uri>
+            <ses:method>GET</ses:method>
+            <ses:parameters/>
+            <ses:cookies>
+               <ses:cookie>
+                  <ses:name>JSESSIONID</ses:name>
+                  <ses:value>F2CBF595D028FFB4545A497BA01CA51B</ses:value>
+               </ses:cookie>
+            </ses:cookies>
+            <ses:headers>
+               <ses:header>
+                  <ses:name>accept</ses:name>
+                  <ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-charset</ses:name>
+                  <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-encoding</ses:name>
+                  <ses:value>gzip,deflate</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-language</ses:name>
+                  <ses:value>en-us,en;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>connection</ses:name>
+                  <ses:value>keep-alive</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>cookie</ses:name>
+                  <ses:value>JSESSIONID=F2CBF595D028FFB4545A497BA01CA51B</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>host</ses:name>
+                  <ses:value>localhost:8080</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>keep-alive</ses:name>
+                  <ses:value>300</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>user-agent</ses:name>
+                  <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7)
Gecko/20040614 Firefox/0.9</ses:value>
+               </ses:header>
+            </ses:headers>
+         </ses:request>
+         <ses:response>
+            <ses:statusCode>200</ses:statusCode>
+            <ses:reason/>
+            <ses:responseBody><![CDATA[<!DOCTYPE HTML PUBLIC "//W3C//DTD HTML
4.01 Transitional//EN"
+	"http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+<head>
+    <title>NetUI Data Grid Samples</title>
+    <link rel="stylesheet" href="/coreWeb/databinding/datagrid/site/css/default.css" type="text/css"/>
+  </head>
+  <base href="http://localhost:8080/coreWeb/databinding/datagrid/misc/userAttributes.jsp">
+  <body>
+    <p>
+    <b>Basic Data Grid</b>
+    <table width="100%">
+    <tr><td></td></tr>
+    <tr><td>
+        
+    <script language="javascript">
+function doAlert(node, index)
+{
+  alert("hello from item: " + index);
+}
+    </script>
+    <p>
+    
+ 
+
+
+    Page 1 of 1&nbsp;&nbsp;&nbsp;
+<table class="datagrid">
+<caption>
+
+        
+    
+</caption>
+
+        
+<thead>
+<tr class="datagrid-header">
+            <th class="datagrid-header-cell">Symbol</th>
+
+
+            <th class="datagrid-header-cell">Price</th>
+
+
+            <th class="datagrid-header-cell">Web</th>
+
+
+        </tr>
+</thead>
+
+<tr class="datagrid-even">
+            <td class="datagrid-data-cell"><span attr-test-symbol="BEAS" onclick="javascript:alert(this)">BEAS</span></td>
+
+            <td class="datagrid-data-cell"><span attr-index="1">14.35</span></td>
+
+            <td class="datagrid-data-cell"><a href="http://www.bea.com?rowid=1&amp;symbol=BEAS"
onmouseover='doAlert(this, 1)'><span>BEA Systems</span></a></td>
+
+        </tr>
+<tr class="datagrid-odd">
+            <td class="datagrid-data-cell"><span attr-test-symbol="CSCO" onclick="javascript:alert(this)">CSCO</span></td>
+
+            <td class="datagrid-data-cell"><span attr-index="2" attr-onlyeven="foo">19.42</span></td>
+
+            <td class="datagrid-data-cell"><a href="http://www.cisco.com?rowid=2&amp;symbol=CSCO"
onmouseover='doAlert(this, 2)'><span>Cisco Systems</span></a></td>
+
+        </tr>
+<tr class="datagrid-even">
+            <td class="datagrid-data-cell"><span attr-test-symbol="GE" onclick="javascript:alert(this)">GE</span></td>
+
+            <td class="datagrid-data-cell"><span attr-index="3">59.42</span></td>
+
+            <td class="datagrid-data-cell"><a href="http://www.ge.com?rowid=3&amp;symbol=GE"
onmouseover='doAlert(this, 3)'><span>General Electric</span></a></td>
+
+        </tr>
+<tr class="datagrid-odd">
+            <td class="datagrid-data-cell"><span attr-test-symbol="RHAT" onclick="javascript:alert(this)">RHAT</span></td>
+
+            <td class="datagrid-data-cell"><span attr-index="4" attr-onlyeven="foo">18.2</span></td>
+
+            <td class="datagrid-data-cell"><a href="http://www.redhat.com?rowid=4&amp;symbol=RHAT"
onmouseover='doAlert(this, 4)'><span>RedHat Systems</span></a></td>
+
+        </tr>
+<tr class="datagrid-even">
+            <td class="datagrid-data-cell"><span attr-test-symbol="YHOO" onclick="javascript:alert(this)">YHOO</span></td>
+
+            <td class="datagrid-data-cell"><span attr-index="5">48.16</span></td>
+
+            <td class="datagrid-data-cell"><a href="http://www.yahoo.com?rowid=5&amp;symbol=YHOO"
onmouseover='doAlert(this, 5)'><span>Yahoo Inc</span></a></td>
+
+        </tr>
+    
+<tr class="datagrid-footer">
+        
+    
+</tr></table>
+
+    
+    </td></tr>
+    </p>
+    <table>
+    <tr><td><a href="/netuiDRT/databinding/datagrid/basic/index.jsp">Home</a></td></tr>
+    </table>
+    </p>
+  </body>
+</html>]]></ses:responseBody>
+         </ses:response>
+      </ses:test>
+   </ses:tests>
+   <ses:endDate>08 Sep 2004, 05:42:00.554 PM MDT</ses:endDate>
+   <ses:testCount>1</ses:testCount>
+</ses:recorderSession>

Mime
View raw message