You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tiles.apache.org by ap...@apache.org on 2007/06/09 13:09:57 UTC

svn commit: r545728 - in /tiles/framework/trunk: tiles-jsp/src/main/resources/META-INF/tld/ tiles-test/src/main/webapp/ tiles-test/src/test/selenium/

Author: apetrelli
Date: Sat Jun  9 04:09:55 2007
New Revision: 545728

URL: http://svn.apache.org/viewvc?view=rev&rev=545728
Log:
TILES-187
Fixed all JSP inconsistencies. Added a Selenium test for a runtime definition with a parameter.

Added:
    tiles/framework/trunk/tiles-test/src/main/webapp/testdef_preparer.jsp   (with props)
    tiles/framework/trunk/tiles-test/src/test/selenium/DefinitionTagPreparerTest.html   (with props)
Modified:
    tiles/framework/trunk/tiles-jsp/src/main/resources/META-INF/tld/tiles-jsp.tld
    tiles/framework/trunk/tiles-test/src/main/webapp/index.jsp
    tiles/framework/trunk/tiles-test/src/test/selenium/TestSuite.html

Modified: tiles/framework/trunk/tiles-jsp/src/main/resources/META-INF/tld/tiles-jsp.tld
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/resources/META-INF/tld/tiles-jsp.tld?view=diff&rev=545728&r1=545727&r2=545728
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/resources/META-INF/tld/tiles-jsp.tld (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/resources/META-INF/tld/tiles-jsp.tld Sat Jun  9 04:09:55 2007
@@ -251,6 +251,7 @@
          <name>value</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
+         <type>java.lang.Object</type>
          <description>
          <![CDATA[
          <p>Attribute object to render directly. If it specified, the <code>name</code>
@@ -310,12 +311,11 @@
       <body-content>JSP</body-content>
       <description>
          <![CDATA[
-         <p><strong>Create a template definition bean.
+         <p><strong>Create a definition at runtime.
          </strong></p>
-         <p>Create a template definition as a bean.
-         Newly created bean will be saved under specified "id", in the requested "scope".
-         Definition tag has same syntax as <code>insert</code></p>
-         ]]>
+         <p>Create a new definition at runtime.
+         Newly created definition will be available across the entire request.
+         </p>]]>
          </description>
       <attribute>
          <name>name</name>
@@ -329,18 +329,6 @@
          </description>
       </attribute>
       <attribute>
-         <name>scope</name>
-         <required>false</required>
-         <rtexprvalue>false</rtexprvalue>
-         <description>
-         <![CDATA[
-         <p>Specifies the variable scope into which the newly defined bean 
-         will be created. 
-         If not specified, the bean will be created in page scope.</p>
-         ]]>
-         </description>
-      </attribute>
-      <attribute>
          <name>template</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
@@ -374,6 +362,17 @@
          ]]>
          </description>
       </attribute>
+      <attribute>
+         <name>preparer</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+         <description>
+         <![CDATA[
+         <p>Specifies the preparer name to use. The specified preparer will
+         be executed before rendering this newly created definition.</p>
+         ]]>
+         </description>
+      </attribute>
    </tag>
    <tag>
       <name>putAttribute</name>
@@ -434,6 +433,7 @@
          <name>value</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
+         <type>java.lang.Object</type>
          <description>
          <![CDATA[
          <p>Attribute value. Could be a String or an Object.
@@ -522,6 +522,7 @@
          <name>value</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
+         <type>java.lang.Object</type>
          <description>
          <![CDATA[
          <p>Attribute value. Can be a String or Object.</p>

Modified: tiles/framework/trunk/tiles-test/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/webapp/index.jsp?view=diff&rev=545728&r1=545727&r2=545728
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/webapp/index.jsp (original)
+++ tiles/framework/trunk/tiles-test/src/main/webapp/index.jsp Sat Jun  9 04:09:55 2007
@@ -55,6 +55,7 @@
     <a href="testinitcontainer.jsp">Test Initialize Container</a><br/>
     <a href="testdef.jsp">Test Definition Tag</a><br/>
     <a href="testdef_extend.jsp">Test Definition Tag extending configured and custom definitions</a><br/>
+    <a href="testdef_preparer.jsp">Test Definition Tag with Preparer</a><br/>
     <a href="testinsertdefinition_composite_tags_includes_configured.jsp">Test Insert Definition that contains another definition inside (configured via tiles-defs.xml) using JSP tags</a><br/>
     <a href="testinsertdefinition_composite_tags.jsp">Test Insert Definition that contains another definition inside using JSP tags</a><br/>
     <a href="testinsertdefinition_composite_tags_includes_configured_notype.jsp">Test Insert Definition that contains another definition inside (configured via tiles-defs.xml) using JSP tags without types</a><br/>

Added: tiles/framework/trunk/tiles-test/src/main/webapp/testdef_preparer.jsp
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/webapp/testdef_preparer.jsp?view=auto&rev=545728
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/webapp/testdef_preparer.jsp (added)
+++ tiles/framework/trunk/tiles-test/src/main/webapp/testdef_preparer.jsp Sat Jun  9 04:09:55 2007
@@ -0,0 +1,31 @@
+<%--
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+--%>
+<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
+
+<tiles:definition name="templateDefinition" template="/layout.jsp" preparer="org.apache.tiles.test.preparer.TestViewPreparer">
+  <tiles:putAttribute name="title"  value="This is the title." />
+  <tiles:putAttribute name="header" value="/header.jsp" />
+  <tiles:putAttribute name="body"   value="/body.jsp" />
+</tiles:definition>
+<tiles:insertDefinition name="templateDefinition" />
\ No newline at end of file

Propchange: tiles/framework/trunk/tiles-test/src/main/webapp/testdef_preparer.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tiles/framework/trunk/tiles-test/src/main/webapp/testdef_preparer.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: tiles/framework/trunk/tiles-test/src/test/selenium/DefinitionTagPreparerTest.html
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/test/selenium/DefinitionTagPreparerTest.html?view=auto&rev=545728
==============================================================================
--- tiles/framework/trunk/tiles-test/src/test/selenium/DefinitionTagPreparerTest.html (added)
+++ tiles/framework/trunk/tiles-test/src/test/selenium/DefinitionTagPreparerTest.html Sat Jun  9 04:09:55 2007
@@ -0,0 +1,62 @@
+<!--
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Definition Tag with Preparer Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Definition Tag with Preparer Test</td></tr>
+</thead><tbody>
+<tr>
+	<td>open</td>
+	<td>/tiles-test/index.jsp</td>
+	<td></td>
+</tr>
+<tr>
+	<td>clickAndWait</td>
+	<td>link=Test Definition Tag with Preparer</td>
+	<td></td>
+</tr>
+<tr>
+	<td>assertTextPresent</td>
+	<td>This is the title.</td>
+	<td></td>
+</tr>
+<tr>
+	<td>assertTextPresent</td>
+	<td>This is the header</td>
+	<td></td>
+</tr>
+<tr>
+	<td>assertTextPresent</td>
+	<td>This is the value added by the ViewPreparer</td>
+	<td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>

Propchange: tiles/framework/trunk/tiles-test/src/test/selenium/DefinitionTagPreparerTest.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tiles/framework/trunk/tiles-test/src/test/selenium/DefinitionTagPreparerTest.html
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Modified: tiles/framework/trunk/tiles-test/src/test/selenium/TestSuite.html
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/test/selenium/TestSuite.html?view=diff&rev=545728&r1=545727&r2=545728
==============================================================================
--- tiles/framework/trunk/tiles-test/src/test/selenium/TestSuite.html (original)
+++ tiles/framework/trunk/tiles-test/src/test/selenium/TestSuite.html Sat Jun  9 04:09:55 2007
@@ -94,6 +94,9 @@
         <td><a href="DefinitionTagExtendTest.html">Definition Tag Extend Test</a></td>
     </tr>
     <tr>
+        <td><a href="DefinitionTagPreparerTest.html">Definition Tag with Preparer Test</a></td>
+    </tr>
+    <tr>
         <td><a href="CompositeDefinitionWithInnerConfiguredDefinitionTest.html">Composite Definition with inner Configured Definition Test</a></td>
     </tr>
     <tr>