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/02/28 12:24:08 UTC
svn commit: r512709 - in
/tiles/examples/trunk/tiles-showcase/src/main/webapp: WEB-INF/ common/
tutorial/ tutorial/basic/ tutorial/common/menu/ tutorial/layout/
Author: apetrelli
Date: Wed Feb 28 03:24:06 2007
New Revision: 512709
URL: http://svn.apache.org/viewvc?view=rev&rev=512709
Log:
TILESSHOW-7
Some bug fixing and cleaning up.
Added:
tiles/examples/trunk/tiles-showcase/src/main/webapp/common/directSubmenu.jsp (with props)
Modified:
tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-tutorial-defs.xml
tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-tutorial-defs_de.xml
tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-tutorial-defs_fr.xml
tiles/examples/trunk/tiles-showcase/src/main/webapp/common/submenu.jsp
tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/basic/myFramesetLayout.jsp
tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/basicFramesetPage.jsp
tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/common/menu/menuLinks.jsp
tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/common/menu/menuSrc.jsp
tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/layout/vboxLayout.jsp
Modified: tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-tutorial-defs.xml
URL: http://svn.apache.org/viewvc/tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-tutorial-defs.xml?view=diff&rev=512709&r1=512708&r2=512709
==============================================================================
--- tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-tutorial-defs.xml (original)
+++ tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-tutorial-defs.xml Wed Feb 28 03:24:06 2007
@@ -84,7 +84,7 @@
<!-- Documentation menu -->
<!-- Old style menu. Check module 'examples' for new style -->
-<definition name="menu.documentation" template="/common/submenu.jsp" >
+<definition name="menu.documentation" template="/common/directSubmenu.jsp" >
<put-attribute name="title" value="Tiles" />
<put-list-attribute name="items" >
<add-list-attribute>
@@ -205,15 +205,15 @@
<put-list-attribute name="items" >
<add-list-attribute>
<add-attribute value="Français" />
- <add-attribute value="/tutorial/lang.do?language=FR" />
+ <add-attribute value="/lang.do?language=FR" />
</add-list-attribute>
<add-list-attribute>
<add-attribute value="English" />
- <add-attribute value="/tutorial/lang.do?language=UK" />
+ <add-attribute value="/lang.do?language=UK" />
</add-list-attribute>
<add-list-attribute>
<add-attribute value="Deutsch" />
- <add-attribute value="/tutorial/lang.do?language=DE" />
+ <add-attribute value="/lang.do?language=DE" />
</add-list-attribute>
</put-list-attribute>
</definition>
Modified: tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-tutorial-defs_de.xml
URL: http://svn.apache.org/viewvc/tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-tutorial-defs_de.xml?view=diff&rev=512709&r1=512708&r2=512709
==============================================================================
--- tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-tutorial-defs_de.xml (original)
+++ tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-tutorial-defs_de.xml Wed Feb 28 03:24:06 2007
@@ -32,24 +32,26 @@
<tiles-definitions>
<!-- Main Layout Definition description -->
- <definition name="mainLayout">
+ <definition name="mainLayout" template="/tutorial/layout/classicLayout.jsp">
<put-attribute name="title" value="World Financial Online - Deutsche Version" />
- <!--<put-attribute name="header" value="/tutorial/common/header.jsp"/>-->
+ <put-attribute name="header" value="/tutorial/common/header.jsp" />
<put-attribute name="footer" value="/tutorial/de/common/footer.jsp" />
- <!--<put-attribute name="menu" value="menu.main"/>
- <put-attribute name="body" value="main.portal.body"/>-->
+ <put-attribute name="menu" value="menu.main" />
+ <put-attribute name="body" value="main.portal.body" />
</definition>
<!-- select language menu -->
<definition name="menu.lang" template="/common/submenu.jsp" >
<put-attribute name="title" value="Sprache" />
<put-list-attribute name="items" >
- <add-attribute value="Englisch" />
- <add-attribute value="Französisch" />
- </put-list-attribute>
- <put-list-attribute name="links" >
- <add-attribute value="/tutorial/lang.do?language=UK" />
- <add-attribute value="/tutorial/lang.do?language=FR" />
+ <add-list-attribute>
+ <add-attribute value="Englisch" />
+ <add-attribute value="/lang.do?language=UK" />
+ </add-list-attribute>
+ <add-list-attribute>
+ <add-attribute value="Französisch" />
+ <add-attribute value="/lang.do?language=FR" />
+ </add-list-attribute>
</put-list-attribute>
</definition>
Modified: tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-tutorial-defs_fr.xml
URL: http://svn.apache.org/viewvc/tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-tutorial-defs_fr.xml?view=diff&rev=512709&r1=512708&r2=512709
==============================================================================
--- tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-tutorial-defs_fr.xml (original)
+++ tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-tutorial-defs_fr.xml Wed Feb 28 03:24:06 2007
@@ -32,24 +32,26 @@
<tiles-definitions>
<!-- Main Layout Definition description -->
- <definition name="mainLayout" >
+ <definition name="mainLayout" template="/tutorial/layout/classicLayout.jsp">
<put-attribute name="title" value="Le Monde Financier En Ligne" />
- <!-- <put-attribute name="header" value="/tutorial/common/header.jsp" /> -->
+ <put-attribute name="header" value="/tutorial/common/header.jsp" />
<put-attribute name="footer" value="/tutorial/fr/common/footer.jsp" />
- <!-- <put-attribute name="menu" value="menu.main" /> -->
- <!-- <put-attribute name="body" value="main.portal.body" /> -->
+ <put-attribute name="menu" value="menu.main" />
+ <put-attribute name="body" value="main.portal.body" />
</definition>
<!-- select language menu -->
<definition name="menu.lang" template="/common/submenu.jsp" >
<put-attribute name="title" value="Langue" />
<put-list-attribute name="items" >
- <add-attribute value="English" />
- <add-attribute value="Deutch" />
- </put-list-attribute>
- <put-list-attribute name="links" >
- <add-attribute value="/tutorial/lang.do?language=UK" />
- <add-attribute value="/tutorial/lang.do?language=DE" />
+ <add-list-attribute>
+ <add-attribute value="English" />
+ <add-attribute value="/lang.do?language=UK" />
+ </add-list-attribute>
+ <add-list-attribute>
+ <add-attribute value="Deutsch" />
+ <add-attribute value="/lang.do?language=DE" />
+ </add-list-attribute>
</put-list-attribute>
</definition>
Added: tiles/examples/trunk/tiles-showcase/src/main/webapp/common/directSubmenu.jsp
URL: http://svn.apache.org/viewvc/tiles/examples/trunk/tiles-showcase/src/main/webapp/common/directSubmenu.jsp?view=auto&rev=512709
==============================================================================
--- tiles/examples/trunk/tiles-showcase/src/main/webapp/common/directSubmenu.jsp (added)
+++ tiles/examples/trunk/tiles-showcase/src/main/webapp/common/directSubmenu.jsp Wed Feb 28 03:24:06 2007
@@ -0,0 +1,83 @@
+<%--
+/*
+ * $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://struts.apache.org/tags-logic" prefix="logic" %>
+<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
+<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
+<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
+<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
+
+
+<%-- Push component attributes in page context --%>
+<tiles:importAttribute />
+
+<table>
+<logic:present name="title">
+<tr>
+ <th colspan=2>
+ <div align="left"><strong><bean:write name="title"/></strong></div>
+ </th>
+</tr>
+</logic:present>
+
+<%-- Check if selected exist. --%>
+<logic:notPresent name="selected" >
+ <% pageContext.setAttribute( "selected", "" ); %>
+</logic:notPresent>
+
+<c:forEach var="iterateItem" items="${items}" >
+<tr>
+ <td width="10" valign="top" ></td>
+ <td valign="top" >
+ <%-- check if selected --%>
+ <logic:notEqual name="selected" value="${iterateItem.value[0].value}">
+ <font size="-1"><html:link module="" page="${iterateItem.value[1].value}">${iterateItem.value[0].value}</html:link></font>
+ </logic:notEqual>
+ <logic:equal name="selected" value="${iterateItem.value[0].value}">
+ <font size="-1" color="fuchsia">${iterateItem.value[0].value}</font>
+ </logic:equal>
+ </td>
+</tr>
+</c:forEach>
+
+</table>
+
+<%-- Following are some code example using this submenu
+<tiles:insertTemplate template="/common/submenu.jsp" flush="true">
+ <tiles:putAttribute name="title" value="Main Menu" />
+ <tiles:putListAttribute name="items" >
+ <tiles:addAttribute value="Home" />
+ <tiles:addAttribute value="Edit Customer" />
+ <tiles:addAttribute value="Invoice" />
+ </tiles:putListAttribute>
+ <tiles:putListAttribute name="links" >
+ <tiles:addAttribute value="index.jsp" />
+ <tiles:addAttribute value="invoice/index.jsp" />
+ <tiles:addAttribute value="invoice/index.jsp" />
+ </tiles:putListAttribute>
+</tiles:insertTemplate>
+
+<tiles:insertDefinition name="mainSubMenu" flush="true">
+ <tiles:putAttribute name="selected" value="Home" />
+</tiles:insertDefinition>
+--%>
Propchange: tiles/examples/trunk/tiles-showcase/src/main/webapp/common/directSubmenu.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tiles/examples/trunk/tiles-showcase/src/main/webapp/common/directSubmenu.jsp
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Modified: tiles/examples/trunk/tiles-showcase/src/main/webapp/common/submenu.jsp
URL: http://svn.apache.org/viewvc/tiles/examples/trunk/tiles-showcase/src/main/webapp/common/submenu.jsp?view=diff&rev=512709&r1=512708&r2=512709
==============================================================================
--- tiles/examples/trunk/tiles-showcase/src/main/webapp/common/submenu.jsp (original)
+++ tiles/examples/trunk/tiles-showcase/src/main/webapp/common/submenu.jsp Wed Feb 28 03:24:06 2007
@@ -26,7 +26,6 @@
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
-<%@ page import="java.util.Iterator" %>
<%-- Push component attributes in page context --%>
Modified: tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/basic/myFramesetLayout.jsp
URL: http://svn.apache.org/viewvc/tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/basic/myFramesetLayout.jsp?view=diff&rev=512709&r1=512708&r2=512709
==============================================================================
--- tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/basic/myFramesetLayout.jsp (original)
+++ tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/basic/myFramesetLayout.jsp Wed Feb 28 03:24:06 2007
@@ -29,13 +29,13 @@
<html>
<head>
- <title><tiles:get name="title"/></title>
+ <title><tiles:getAsString name="title"/></title>
</head>
<frameset rows="73, *, 73">
- <frame src="<%=request.getContextPath()%><tiles:get name="header" />" name="header" >
- <frame src="<%=request.getContextPath()%><tiles:get name="body" />" name="body" >
- <frame src="<%=request.getContextPath()%><tiles:get name="footer" />" name="footer" >
+ <frame src="<%=request.getContextPath()%><tiles:getAsString name="header" />" name="header" >
+ <frame src="<%=request.getContextPath()%><tiles:getAsString name="body" />" name="body" >
+ <frame src="<%=request.getContextPath()%><tiles:getAsString name="footer" />" name="footer" >
</frameset>
Modified: tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/basicFramesetPage.jsp
URL: http://svn.apache.org/viewvc/tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/basicFramesetPage.jsp?view=diff&rev=512709&r1=512708&r2=512709
==============================================================================
--- tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/basicFramesetPage.jsp (original)
+++ tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/basicFramesetPage.jsp Wed Feb 28 03:24:06 2007
@@ -24,9 +24,9 @@
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<tiles:insertTemplate template="/tutorial/basic/myFramesetLayout.jsp" >
- <tiles:putAttribute name="title" content="My first frameset page" direct="true" />
- <tiles:putAttribute name="header" content="/tutorial/common/header.jsp" direct="true"/>
- <tiles:putAttribute name="footer" content="/tutorial/common/footer.jsp" direct="true"/>
- <tiles:putAttribute name="menu" content="/tutorial/basic/menu.jsp" direct="true"/>
- <tiles:putAttribute name="body" content="/tutorial/basic/helloBody.jsp" direct="true"/>
+ <tiles:putAttribute name="title" value="My first frameset page" type="string" />
+ <tiles:putAttribute name="header" value="/tutorial/common/header.jsp" type="string"/>
+ <tiles:putAttribute name="footer" value="/tutorial/common/footer.jsp" type="string"/>
+ <tiles:putAttribute name="menu" value="/tutorial/basic/menu.jsp" type="string"/>
+ <tiles:putAttribute name="body" value="/tutorial/basic/helloBody.jsp" type="string"/>
</tiles:insertTemplate>
Modified: tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/common/menu/menuLinks.jsp
URL: http://svn.apache.org/viewvc/tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/common/menu/menuLinks.jsp?view=diff&rev=512709&r1=512708&r2=512709
==============================================================================
--- tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/common/menu/menuLinks.jsp (original)
+++ tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/common/menu/menuLinks.jsp Wed Feb 28 03:24:06 2007
@@ -28,15 +28,15 @@
<tiles:putListAttribute name="items" >
<tiles:addListAttribute>
<tiles:addAttribute value="Home" />
- <tiles:addAttribute value="/tutorial/index.jsp" />
+ <tiles:addAttribute value="/index.jsp" />
</tiles:addListAttribute>
<tiles:addListAttribute>
<tiles:addAttribute value="Basic Page" />
- <tiles:addAttribute value="/tutorial/basicPage.jsp" />
+ <tiles:addAttribute value="/basicPage.jsp" />
</tiles:addListAttribute>
<tiles:addListAttribute>
<tiles:addAttribute value="First Portal" />
- <tiles:addAttribute value="/tutorial/portalPage.jsp" />
+ <tiles:addAttribute value="/portalPage.jsp" />
</tiles:addListAttribute>
</tiles:putListAttribute>
</tiles:insertTemplate>
Modified: tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/common/menu/menuSrc.jsp
URL: http://svn.apache.org/viewvc/tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/common/menu/menuSrc.jsp?view=diff&rev=512709&r1=512708&r2=512709
==============================================================================
--- tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/common/menu/menuSrc.jsp (original)
+++ tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/common/menu/menuSrc.jsp Wed Feb 28 03:24:06 2007
@@ -25,13 +25,13 @@
<tiles:insertTemplate template="/tutorial/common/menuViewSrc.jsp" flush="true" >
<tiles:putListAttribute name="list" >
- <tiles:addAttribute value="/tutorial/basicPage.jsp" />
- <tiles:addAttribute value="/tutorial/portalPage.jsp" />
- <tiles:addAttribute value="/tutorial/portal/portalBody.jsp" />
- <tiles:addAttribute value="/tutorial/common/header.jsp" />
- <tiles:addAttribute value="/tutorial/common/menu.jsp" />
- <tiles:addAttribute value="/tutorial/common/footer.jsp" />
- <tiles:addAttribute value="/layout/classicLayout.jsp" />
- <tiles:addAttribute value="/layout/vboxLayout.jsp" />
+ <tiles:addAttribute value="/basicPage.jsp" />
+ <tiles:addAttribute value="/portalPage.jsp" />
+ <tiles:addAttribute value="/portal/portalBody.jsp" />
+ <tiles:addAttribute value="/common/header.jsp" />
+ <tiles:addAttribute value="/common/menu.jsp" />
+ <tiles:addAttribute value="/common/footer.jsp" />
+ <tiles:addAttribute value="/classicLayout.jsp" />
+ <tiles:addAttribute value="/vboxLayout.jsp" />
</tiles:putListAttribute>
</tiles:insertTemplate>
Modified: tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/layout/vboxLayout.jsp
URL: http://svn.apache.org/viewvc/tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/layout/vboxLayout.jsp?view=diff&rev=512709&r1=512708&r2=512709
==============================================================================
--- tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/layout/vboxLayout.jsp (original)
+++ tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/layout/vboxLayout.jsp Wed Feb 28 03:24:06 2007
@@ -44,16 +44,8 @@
--%>
<%-- For now, do iteration manually : --%>
-<%
-Iterator i=list.iterator();
-while( i.hasNext() )
- {
- String comp=(String)i.next();
-%>
-<tiles:insertAttribute name="<%=comp%>" flush="true" />
+<c:forEach var="item" items="${list}">
+<tiles:insertAttribute value="${item}" flush="true" />
<br>
-
-<%
- } // end loop
-%>
+</c:forEach>