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 2008/03/02 20:27:34 UTC
svn commit: r632811 - in /tiles/framework/trunk:
tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/
tiles-jsp/src/main/resources/META-INF/tld/ tiles-test/src/main/webapp/
tiles-test/src/test/selenium/
Author: apetrelli
Date: Sun Mar 2 11:27:33 2008
New Revision: 632811
URL: http://svn.apache.org/viewvc?rev=632811&view=rev
Log:
TILES-259
Added "template" attribute to "tiles:insertDefinition" tag and added Selenium test.
Simplified InsertTemplateTag rendering, removing unnecessary code.
Added:
tiles/framework/trunk/tiles-test/src/main/webapp/layout_override.jsp (with props)
tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionOverrideTemplateTest.html (with props)
Modified:
tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertTemplateTag.java
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/java/org/apache/tiles/jsp/taglib/InsertTemplateTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertTemplateTag.java?rev=632811&r1=632810&r2=632811&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertTemplateTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertTemplateTag.java Sun Mar 2 11:27:33 2008
@@ -85,12 +85,6 @@
protected void renderContext() throws JspException, TilesException,
IOException {
JspUtil.setForceInclude(pageContext, true);
- try {
- attributeContext.setTemplate(template);
- container.renderContext(pageContext);
- } catch (TilesException e) {
- throw new JspException("Error during rendering of template '"
- + template + "'", e);
- }
+ container.renderContext(pageContext);
}
}
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?rev=632811&r1=632810&r2=632811&view=diff
==============================================================================
--- 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 Sun Mar 2 11:27:33 2008
@@ -168,6 +168,18 @@
</description>
</attribute>
<attribute>
+ <name>template</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <description>
+ <![CDATA[
+ <p>A string representing the URI of a template (for example, a JSP
+ page) that will override the one used by the definition itself.
+ </p>
+ ]]>
+ </description>
+ </attribute>
+ <attribute>
<name>flush</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
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?rev=632811&r1=632810&r2=632811&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/webapp/index.jsp (original)
+++ tiles/framework/trunk/tiles-test/src/main/webapp/index.jsp Sun Mar 2 11:27:33 2008
@@ -39,6 +39,7 @@
<a href="testinsertdefinition_preparer_configured.jsp">Test Insert Configured Definition with Preparer configured in the definition itself</a><br/>
<a href="testinsertdefinition_classpath.jsp">Test Insert Configured Classpath Definition</a><br/>
<a href="testinsertdefinition_override.jsp">Test Insert Configured Definition with an overridden content</a><br/>
+ <a href="testinsertdefinition_override_template.jsp">Test Insert Configured Definition with an overridden template</a><br/>
<a href="testinsertdefinition_override_and_not.jsp">Test Insert Configured Definition with an overridden content and one with original content</a><br/>
<a href="testinsertdefinition_inline.jsp">Test Insert Configured Definition with an inline content</a><br/>
<a href="testinsertdefinition_composite.jsp">Test Insert Configured Definition that contains another definition inside</a><br/>
Added: tiles/framework/trunk/tiles-test/src/main/webapp/layout_override.jsp
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/webapp/layout_override.jsp?rev=632811&view=auto
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/webapp/layout_override.jsp (added)
+++ tiles/framework/trunk/tiles-test/src/main/webapp/layout_override.jsp Sun Mar 2 11:27:33 2008
@@ -0,0 +1,40 @@
+<%@ page session="false" %>
+<%--
+/*
+ * $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" %>
+
+<table border="2" width="300" bordercolor="Gray">
+ <tr>
+ <td bgcolor="Green"><strong>This is the overridden template.</strong></td>
+ </tr>
+ <tr>
+ <td bgcolor="Blue"><strong><tiles:getAsString name="title"/></strong></td>
+ </tr>
+ <tr>
+ <td><tiles:insertAttribute name="header"/></td>
+ </tr>
+ <tr>
+ <td><tiles:insertAttribute name="body"/></td>
+ </tr>
+</table>
\ No newline at end of file
Propchange: tiles/framework/trunk/tiles-test/src/main/webapp/layout_override.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tiles/framework/trunk/tiles-test/src/main/webapp/layout_override.jsp
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionOverrideTemplateTest.html
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionOverrideTemplateTest.html?rev=632811&view=auto
==============================================================================
--- tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionOverrideTemplateTest.html (added)
+++ tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionOverrideTemplateTest.html Sun Mar 2 11:27:33 2008
@@ -0,0 +1,66 @@
+<!--
+/*
+ * $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>Configured Definition with Overridden Template Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Configured Definition with Overridden Template 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 Insert Configured Definition with an overridden template</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertTextPresent</td>
+ <td>This is the overridden template.</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 a body</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
Propchange: tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionOverrideTemplateTest.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionOverrideTemplateTest.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?rev=632811&r1=632810&r2=632811&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-test/src/test/selenium/TestSuite.html (original)
+++ tiles/framework/trunk/tiles-test/src/test/selenium/TestSuite.html Sun Mar 2 11:27:33 2008
@@ -52,6 +52,9 @@
<td><a href="ConfiguredDefinitionOverrideTest.html">Configured Definition with Overridden Content Test</a></td>
</tr>
<tr>
+ <td><a href="ConfiguredDefinitionOverrideTemplateTest.html">Configured Definition with Overridden Template Test</a></td>
+ </tr>
+ <tr>
<td><a href="ConfiguredDefinitionOverrideAndNotTest.html">Configured Definition with Overridden and Original Content Test</a></td>
</tr>
<tr>