rave-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jc...@apache.org
Subject svn commit: r1199564 - in /incubator/rave/trunk: ./ rave-components/rave-web/src/main/java/org/apache/rave/portal/web/util/ rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/ rave-portal-dependencies/ rave-portal-resources/ r...
Date Wed, 09 Nov 2011 00:25:46 GMT
Author: jcian
Date: Wed Nov  9 00:25:45 2011
New Revision: 1199564

URL: http://svn.apache.org/viewvc?rev=1199564&view=rev
Log:
Adding initial tiles integration -- currently just for the "home" view but will expand to cover other views as well.  Supports RAVE-343.

Added:
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/common/
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/common/footer.jsp
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/common/header.jsp
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/includes/
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/includes/taglibs.jsp
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/templates/
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/templates/base_layout.jsp
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tiles-defs.xml
Modified:
    incubator/rave/trunk/pom.xml
    incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/util/ViewNames.java
    incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/PageControllerTest.java
    incubator/rave/trunk/rave-portal-dependencies/pom.xml
    incubator/rave/trunk/rave-portal-resources/pom.xml
    incubator/rave/trunk/rave-portal-resources/src/main/resources/messages.properties
    incubator/rave/trunk/rave-portal-resources/src/main/resources/messages_nl.properties
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/dispatcher-servlet.xml
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/home.jsp

Modified: incubator/rave/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/pom.xml?rev=1199564&r1=1199563&r2=1199564&view=diff
==============================================================================
--- incubator/rave/trunk/pom.xml (original)
+++ incubator/rave/trunk/pom.xml Wed Nov  9 00:25:45 2011
@@ -68,6 +68,7 @@
         <guice.version>3.0</guice.version>
         <cobertura.version>2.5.1</cobertura.version>
         <org.hamcrest.version>1.1</org.hamcrest.version>
+        <tiles.version>2.2.2</tiles.version>
 
 		  <!-- The location of Rave's H2 file DB. No trailing / -->
 		  <portal.datasource.url>/tmp/rave_portal_data</portal.datasource.url>
@@ -338,6 +339,11 @@
                 <version>${project.version}</version>
                 <type>war</type>
             </dependency>
+            <dependency>
+                <groupId>org.apache.tiles</groupId>
+                <artifactId>tiles-jsp</artifactId>
+                <version>${tiles.version}</version>
+            </dependency>
 
             <!-- Test -->
             <dependency>

Modified: incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/util/ViewNames.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/util/ViewNames.java?rev=1199564&r1=1199563&r2=1199564&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/util/ViewNames.java (original)
+++ incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/util/ViewNames.java Wed Nov  9 00:25:45 2011
@@ -24,7 +24,9 @@ package org.apache.rave.portal.web.util;
  */
 public class ViewNames {
     private ViewNames() {}
-    public static final String HOME = "home";
+    private static final String USER_PREFIX = "templates.user.";
+
+    public static final String HOME = USER_PREFIX + "home";
     public static final String STORE = "store";
     public static final String WIDGET = "widget";
     public static final String ADD_WIDGET_FORM = "addwidget";

Modified: incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/PageControllerTest.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/PageControllerTest.java?rev=1199564&r1=1199563&r2=1199564&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/PageControllerTest.java (original)
+++ incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/PageControllerTest.java Wed Nov  9 00:25:45 2011
@@ -25,6 +25,7 @@ import org.apache.rave.portal.model.User
 import org.apache.rave.portal.service.PageService;
 import org.apache.rave.portal.service.UserService;
 import org.apache.rave.portal.web.util.ModelKeys;
+import org.apache.rave.portal.web.util.ViewNames;
 import org.junit.Before;
 import org.junit.Test;
 import org.springframework.ui.ExtendedModelMap;
@@ -49,7 +50,6 @@ public class PageControllerTest {
     private final Long DEFAULT_PAGE_ID = 99L;
     private final Long OTHER_PAGE_ID = 22L;
     private final Long USER_ID = 1L;
-    private final String HOME_VIEW = "home";
     private final String VALID_PAGE_LAYOUT_CODE = "layout98";
     private User validUser;
     private PageLayout validPageLayout;
@@ -85,7 +85,7 @@ public class PageControllerTest {
 
         String results = pageController.view(OTHER_PAGE_ID, model);
         
-        assertThat(results, equalTo(HOME_VIEW));
+        assertThat(results, equalTo(ViewNames.HOME));
         assertThat((Page) model.asMap().get(ModelKeys.PAGE), sameInstance(otherPage));
         assertThat((List<Page>) model.asMap().get(ModelKeys.PAGES), sameInstance(allPages));
         
@@ -105,7 +105,7 @@ public class PageControllerTest {
         
         String results = pageController.view(OTHER_PAGE_ID, model);
         
-        assertThat(results, equalTo(HOME_VIEW));
+        assertThat(results, equalTo(ViewNames.HOME));
         assertThat((Page) model.asMap().get(ModelKeys.PAGE), sameInstance(defaultPage));
         assertThat((List<Page>) model.asMap().get(ModelKeys.PAGES), sameInstance(pages));
         
@@ -121,7 +121,7 @@ public class PageControllerTest {
 
         String results = pageController.viewDefault(model);
         
-        assertThat(results, equalTo(HOME_VIEW));
+        assertThat(results, equalTo(ViewNames.HOME));
         assertThat((Page) model.asMap().get(ModelKeys.PAGE), sameInstance(defaultPage));
         assertThat((List<Page>) model.asMap().get(ModelKeys.PAGES), sameInstance(allPages));
         
@@ -141,7 +141,7 @@ public class PageControllerTest {
 
         String results = pageController.viewDefault(model);
         
-        assertThat(results, equalTo(HOME_VIEW));
+        assertThat(results, equalTo(ViewNames.HOME));
         assertThat((Page) model.asMap().get(ModelKeys.PAGE), sameInstance(defaultPage));
         assertThat((List<Page>) model.asMap().get(ModelKeys.PAGES), sameInstance(pages));
         

Modified: incubator/rave/trunk/rave-portal-dependencies/pom.xml
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-dependencies/pom.xml?rev=1199564&r1=1199563&r2=1199564&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-dependencies/pom.xml (original)
+++ incubator/rave/trunk/rave-portal-dependencies/pom.xml Wed Nov  9 00:25:45 2011
@@ -128,6 +128,12 @@
             <groupId>org.slf4j</groupId>
             <artifactId>jcl-over-slf4j</artifactId>
         </dependency>
+
+        <!-- Tiles -->
+        <dependency>
+            <groupId>org.apache.tiles</groupId>
+            <artifactId>tiles-jsp</artifactId>
+        </dependency>
         
     </dependencies>
 

Modified: incubator/rave/trunk/rave-portal-resources/pom.xml
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/pom.xml?rev=1199564&r1=1199563&r2=1199564&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/pom.xml (original)
+++ incubator/rave/trunk/rave-portal-resources/pom.xml Wed Nov  9 00:25:45 2011
@@ -35,7 +35,7 @@
     <packaging>war</packaging>
 
     <!--
-     The dependencies should have the scope provided.
+     The dependencies defined here should have the scope provided.
      They are not needed for compilation, only to support JSTL code completion in IDE's.
      -->
     <dependencies>
@@ -59,6 +59,11 @@
             <artifactId>rave-web</artifactId>
             <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.tiles</groupId>
+            <artifactId>tiles-jsp</artifactId>
+            <scope>provided</scope>
+        </dependency>
     </dependencies>
 
 	 <build>

Modified: incubator/rave/trunk/rave-portal-resources/src/main/resources/messages.properties
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/resources/messages.properties?rev=1199564&r1=1199563&r2=1199564&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/resources/messages.properties (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/resources/messages.properties Wed Nov  9 00:25:45 2011
@@ -54,6 +54,7 @@ page.general.movethispage.after=After {0
 page.general.movethispage.tofirst=To First Tab (Set as Default)
 page.general.password=Password:
 page.general.screenshot=screenshot
+page.general.title=Rave
 page.general.titlesuffix= - Rave
 page.general.thumbnail=thumbnail
 page.general.toadmininterface=Admin interface
@@ -69,6 +70,7 @@ page.general.addpage.layout.columns_4=Fo
 page.general.addpage.layout.columns_3nwn_1_bottom=Four Columns (narrow/wide/narrow/bottom)
 page.general.addpage.selectlayout=Select Page Layout:
 
+page.home.title=Home
 page.home.welcome=Hello {0}, welcome to Rave!
 
 page.menu.title=Page Actions Menu

Modified: incubator/rave/trunk/rave-portal-resources/src/main/resources/messages_nl.properties
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/resources/messages_nl.properties?rev=1199564&r1=1199563&r2=1199564&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/resources/messages_nl.properties (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/resources/messages_nl.properties Wed Nov  9 00:25:45 2011
@@ -54,6 +54,7 @@ page.general.movethispage.after=Na {0}
 page.general.movethispage.tofirst=Naar eerste Tab (Set as Default)
 page.general.password=Wachtwoord:
 page.general.screenshot=screenshot
+page.general.title=Rave
 page.general.titlesuffix= - Rave
 page.general.thumbnail=miniatuur
 page.general.toadmininterface=Admin interface
@@ -69,6 +70,7 @@ page.general.addpage.layout.columns_4=Vi
 page.general.addpage.layout.columns_3nwn_1_bottom=Vier kolommen (smal/breed/smal/beneden)
 page.general.addpage.selectlayout=Selecteer de Pagina indeling:
 
+page.home.title=Home
 page.home.welcome=Hallo {0}, welkom bij Rave!
 
 page.menu.title=Pagina Acties Menu

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/dispatcher-servlet.xml
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/dispatcher-servlet.xml?rev=1199564&r1=1199563&r2=1199564&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/dispatcher-servlet.xml (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/dispatcher-servlet.xml Wed Nov  9 00:25:45 2011
@@ -59,4 +59,16 @@
         </property>
     </bean>
 
+    <bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
+        <property name="definitions">
+            <list>
+                <value>/WEB-INF/tiles-defs.xml</value>
+            </list>
+        </property>
+    </bean>
+
+    <bean id="tilesViewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver" p:order="0">
+        <property name="viewClass" value="org.springframework.web.servlet.view.tiles2.TilesView"/>
+    </bean>
+
 </beans>
\ No newline at end of file

Added: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/common/footer.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/common/footer.jsp?rev=1199564&view=auto
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/common/footer.jsp (added)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/common/footer.jsp Wed Nov  9 00:25:45 2011
@@ -0,0 +1,19 @@
+<%--
+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.
+--%>
+<%-- Common footer will go here... --%>
\ No newline at end of file

Added: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/common/header.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/common/header.jsp?rev=1199564&view=auto
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/common/header.jsp (added)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/common/header.jsp Wed Nov  9 00:25:45 2011
@@ -0,0 +1,19 @@
+<%--
+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.
+--%>
+<%-- Common header will go here... --%>
\ No newline at end of file

Added: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/includes/taglibs.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/includes/taglibs.jsp?rev=1199564&view=auto
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/includes/taglibs.jsp (added)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/includes/taglibs.jsp Wed Nov  9 00:25:45 2011
@@ -0,0 +1,26 @@
+<%--
+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 prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
+<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
+<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
+<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
+<%@ taglib prefix="portal" uri="http://www.apache.org/rave/tags" %>
+<%@ taglib prefix="rave" tagdir="/WEB-INF/tags"%>
\ No newline at end of file

Added: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/templates/base_layout.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/templates/base_layout.jsp?rev=1199564&view=auto
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/templates/base_layout.jsp (added)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/templates/base_layout.jsp Wed Nov  9 00:25:45 2011
@@ -0,0 +1,45 @@
+<%--
+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.
+--%>
+<%@ page language="java" trimDirectiveWhitespaces="true" %>
+<%@ page errorPage="/WEB-INF/jsp/views/error.jsp" %>
+<%@ include file="/WEB-INF/jsp/includes/taglibs.jsp" %>
+<fmt:setBundle basename="messages"/>
+<%-- Expose any attributes defined in the tiles-defs.xml to the request scope for use in other tiles --%>
+<tiles:importAttribute scope="request"/>
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="ISO-8859-1"/>
+    <title><fmt:message key="${pageTitleKey}"/>&nbsp;<fmt:message key="${pageTitleSuffixKey}"/></title>
+    <link rel="stylesheet" href="//ajax.aspnetcdn.com/ajax/jquery.ui/1.8.13/themes/base/jquery-ui.css"/>
+    <link rel="stylesheet" href="<c:url value="/css/default.css" />"/>
+    <rave:custom_css/>
+    <!--[if lt IE 9]>
+    <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+</head>
+<body>
+<%-- Header Content --%>
+<tiles:insertAttribute name="header"/>
+<%-- Main Body Content --%>
+<tiles:insertAttribute name="body"/>
+<%-- Footer Content --%>
+<tiles:insertAttribute name="footer"/>
+</body>
+</html>
\ No newline at end of file

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/home.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/home.jsp?rev=1199564&r1=1199563&r2=1199564&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/home.jsp (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/home.jsp Wed Nov  9 00:25:45 2011
@@ -17,218 +17,210 @@
   under the License.
   --%>
 <%@ page language="java" trimDirectiveWhitespaces="true" %>
-<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
-<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
-<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
-<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
-<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
-<%@ taglib prefix="portal" uri="http://www.apache.org/rave/tags" %>
-<%@ taglib tagdir="/WEB-INF/tags" prefix="rave"%>
+<%@ include file="/WEB-INF/jsp/includes/taglibs.jsp" %>
 <jsp:useBean id="pages" type="java.util.List<org.apache.rave.portal.model.Page>" scope="request"/>
 <fmt:setBundle basename="messages"/>
 <%--@elvariable id="page" type="org.apache.rave.portal.model.Page"--%>
-<rave:rave_generic_page pageTitle="${page.name}">
-    <header>
-        <nav class="topnav">
-            <ul class="horizontal-list">
+<header>
+    <nav class="topnav">
+        <ul class="horizontal-list">
+            <li>
+                <a href="<spring:url value="/app/store?referringPageId=${page.entityId}" />">
+                  <fmt:message key="page.store.title"/>
+                </a>
+            </li>
+            <sec:authorize url="/app/admin/">
                 <li>
-                    <a href="<spring:url value="/app/store?referringPageId=${page.entityId}" />">
-                      <fmt:message key="page.store.title"/>
+                    <a href="<spring:url value="/app/admin/"/>">
+                        <fmt:message key="page.general.toadmininterface"/>
                     </a>
                 </li>
-                <sec:authorize url="/app/admin/">
-                    <li>
-                        <a href="<spring:url value="/app/admin/"/>">
-                            <fmt:message key="page.general.toadmininterface"/>
-                        </a>
-                    </li>
-                </sec:authorize>
-                <li>
-                    <a href="<spring:url value="/j_spring_security_logout" htmlEscape="true" />">
-                      <fmt:message key="page.general.logout"/></a>
-                </li>
-            </ul>
-        </nav>
-      <h1>
-          <fmt:message key="page.home.welcome"><fmt:param><c:out value="${page.owner.username}"/></fmt:param></fmt:message>
-      </h1>
-    </header>
-    <input id="currentPageId" type="hidden" value="${page.entityId}" />
-    <c:set var="hasOnlyOnePage">
-        <c:choose>
-            <c:when test="${fn:length(pages) == 1}">true</c:when>
-            <c:otherwise>false</c:otherwise>
-        </c:choose>
-    </c:set>
-    <div id="tabsHeader">
-        <%-- render the page tabs --%>
-        <div id="tabs" class="rave-ui-tabs">
-            <c:forEach var="userPage" items="${pages}">
-                 <%-- determine if the current page in the list matches the page the user is viewing --%>
-                 <c:set var="isCurrentPage">
-                     <c:choose>
-                         <c:when test="${page.entityId == userPage.entityId}">true</c:when>
-                         <c:otherwise>false</c:otherwise>
-                     </c:choose>
-                 </c:set>
-                 <div id="tab-${userPage.entityId}" class="rave-ui-tab<c:if test="${isCurrentPage}"> rave-ui-tab-selected</c:if>">
-                    <div id="pageTitle-${userPage.entityId}" class="page-title" onclick="rave.viewPage(${userPage.entityId});"><c:out value="${userPage.name}"/></div>
-                    <c:if test="${isCurrentPage}">
-                        <div id="pageMenuWrapper">
-                            <span id="pageMenuButton" class="ui-icon ui-icon-circle-triangle-s" title="<fmt:message key="page.menu.title"/>"></span>
-                            <div id="pageMenu" class="page-menu">
-                                <div id="pageMenuEdit" class="page-menu-item"><fmt:message key="page.general.editpage"/></div>
-                                <div id="pageMenuDelete" class="page-menu-item<c:if test='${hasOnlyOnePage}'> page-menu-item-disabled</c:if>">
-                                  <fmt:message key="page.general.deletepage"/></div>
-                                <div id="pageMenuMove" class="page-menu-item<c:if test='${hasOnlyOnePage}'> page-menu-item-disabled</c:if>">
-                                  <fmt:message key="page.general.movepage"/></div>
-                            </div>
-                        </div>
-                    </c:if>
-                </div>
-            </c:forEach>
-            <%-- display the add page button at the end of the tabs --%>
-            <fmt:message key="page.general.addnewpage" var="addNewPageTitle"/>
-            <button id="add_page" title="${addNewPageTitle}" style="display: none;"></button>
-        </div>
-    </div>
-    <%--render the main page content (regions/widgets) --%>
-    <div id="pageContent">
-        <c:forEach var="region" items="${page.regions}">
-            <div class="region" id="region-${region.entityId}-id">
-                <c:forEach var="regionWidget" items="${region.regionWidgets}">
-                   <div class="widget-wrapper" id="widget-${regionWidget.entityId}-wrapper">
-                        <div class="widget-title-bar">
-                            <span id="widget-${regionWidget.entityId}-collapse" class="widget-toolbar-toggle-collapse" title="<fmt:message key="widget.chrome.toggle"/>"></span>
-                            <div id="widget-${regionWidget.entityId}-title" class="widget-title">
-                            <c:choose>
-                                <c:when test="${not empty regionWidget.widget.titleUrl}">
-                                    <a href="${regionWidget.widget.titleUrl}" rel="external"><c:out value="${regionWidget.widget.title}"/></a>
-                                </c:when>
-                                <c:otherwise>
-                                    <c:out value="${regionWidget.widget.title}"/>
-                                </c:otherwise>
-                            </c:choose>
-                            </div>
-                            <%-- These are toolbar buttons --%>
-                            <div id="widget-${regionWidget.entityId}-toolbar" style="float:right;">
-                                <div id="widget-${regionWidget.entityId}-widget-menu-wrapper" class="widget-menu-wrapper">
-                                    <span id="widget-${regionWidget.entityId}-menu-button" class="widget-menu-button ui-icon ui-icon-gear" title="<fmt:message key="widget.menu.title"/>"></span>   
-                                    <div id="widget-${regionWidget.entityId}-menu" class="widget-menu">  
-                                        <%-- 
-                                            By default the edit prefs item is disabled.
-                                            Each provider's widget initialization will be responsible for enabling this item
-                                            if the widget has preferences to be edited
-                                        --%> 
-                                        <div id="widget-${regionWidget.entityId}-menu-editprefs-item" class="widget-menu-item widget-menu-item-disabled">
-                                            <fmt:message key="widget.menu.editprefs"/>
-                                        </div>   
-                                        <div id="widget-${regionWidget.entityId}-menu-maximize-item" class="widget-menu-item">
-                                            <fmt:message key="widget.menu.maximize"/>
-                                        </div>    
-                                        <div id="widget-${regionWidget.entityId}-menu-move-item" class="widget-menu-item<c:if test='${hasOnlyOnePage}'> widget-menu-item-disabled</c:if>">
-                                            <fmt:message key="widget.menu.movetopage"/>
-                                        </div>   
-                                        <div id="widget-${regionWidget.entityId}-menu-delete-item" class="widget-menu-item">
-                                            <fmt:message key="widget.menu.delete"/>
-                                        </div>                                       
-                                    </div>                                           
-                                </div>           
-                                <%-- the minimize widget button, which is hidden by default and only displays in maximized view --%>    
-                                <button id="widget-${regionWidget.entityId}-min" 
-                                        class="widget-toolbar-btn widget-toolbar-btn-min"></button>
-                            </div>
-                        </div>
-                        <div class="widget-prefs" id="widget-${regionWidget.entityId}-prefs-content"></div>
-                        <div class="widget" id="widget-${regionWidget.entityId}-body">
-                                <portal:render-widget regionWidget="${regionWidget}" />
+            </sec:authorize>
+            <li>
+                <a href="<spring:url value="/j_spring_security_logout" htmlEscape="true" />">
+                  <fmt:message key="page.general.logout"/></a>
+            </li>
+        </ul>
+    </nav>
+  <h1>
+      <fmt:message key="page.home.welcome"><fmt:param><c:out value="${page.owner.username}"/></fmt:param></fmt:message>
+  </h1>
+</header>
+<input id="currentPageId" type="hidden" value="${page.entityId}" />
+<c:set var="hasOnlyOnePage">
+    <c:choose>
+        <c:when test="${fn:length(pages) == 1}">true</c:when>
+        <c:otherwise>false</c:otherwise>
+    </c:choose>
+</c:set>
+<div id="tabsHeader">
+    <%-- render the page tabs --%>
+    <div id="tabs" class="rave-ui-tabs">
+        <c:forEach var="userPage" items="${pages}">
+             <%-- determine if the current page in the list matches the page the user is viewing --%>
+             <c:set var="isCurrentPage">
+                 <c:choose>
+                     <c:when test="${page.entityId == userPage.entityId}">true</c:when>
+                     <c:otherwise>false</c:otherwise>
+                 </c:choose>
+             </c:set>
+             <div id="tab-${userPage.entityId}" class="rave-ui-tab<c:if test="${isCurrentPage}"> rave-ui-tab-selected</c:if>">
+                <div id="pageTitle-${userPage.entityId}" class="page-title" onclick="rave.viewPage(${userPage.entityId});"><c:out value="${userPage.name}"/></div>
+                <c:if test="${isCurrentPage}">
+                    <div id="pageMenuWrapper">
+                        <span id="pageMenuButton" class="ui-icon ui-icon-circle-triangle-s" title="<fmt:message key="page.menu.title"/>"></span>
+                        <div id="pageMenu" class="page-menu">
+                            <div id="pageMenuEdit" class="page-menu-item"><fmt:message key="page.general.editpage"/></div>
+                            <div id="pageMenuDelete" class="page-menu-item<c:if test='${hasOnlyOnePage}'> page-menu-item-disabled</c:if>">
+                              <fmt:message key="page.general.deletepage"/></div>
+                            <div id="pageMenuMove" class="page-menu-item<c:if test='${hasOnlyOnePage}'> page-menu-item-disabled</c:if>">
+                              <fmt:message key="page.general.movepage"/></div>
                         </div>
                     </div>
-                </c:forEach>
+                </c:if>
             </div>
         </c:forEach>
-        <div class="clear-float">&nbsp;</div>
-    </div>
-    <fmt:message key="page.general.addnewpage" var="addNewPageTitle"/>
-    <div id="dialog" title="${addNewPageTitle}" class="dialog">
-        <form id="pageForm">
-            <div id="pageFormErrors" class="error"></div>
-            <fieldset class="ui-helper-reset">
-                <input type="hidden" name="tab_id" id="tab_id" value="" />
-                <label for="tab_title"><fmt:message key="page.general.addpage.title"/></label>
-                <input type="text" name="tab_title" id="tab_title" value="" class="required ui-widget-content ui-corner-all" />
-                <label for="pageLayout"><fmt:message key="page.general.addpage.selectlayout"/></label>
-                <select name="pageLayout" id="pageLayout">
-                    <option value="columns_1" id="columns_1_id"><fmt:message key="page.general.addpage.layout.columns_1"/></option>
-                    <option value="columns_2" id="columns_2_id" selected="selected"><fmt:message key="page.general.addpage.layout.columns_2"/></option>
-                    <option value="columns_2wn" id="columns_2wn_id"><fmt:message key="page.general.addpage.layout.columns_2wn"/></option>
-                    <option value="columns_3" id="columns_3_id"><fmt:message key="page.general.addpage.layout.columns_3"/></option>
-                    <option value="columns_3nwn" id="columns_3nwn_id"><fmt:message key="page.general.addpage.layout.columns_3nwn"/></option>
-                    <option value="columns_4" id="columns_4_id"><fmt:message key="page.general.addpage.layout.columns_4"/></option>
-                    <option value="columns_3nwn_1_bottom" id="columns_3nwn_1_bottom"><fmt:message key="page.general.addpage.layout.columns_3nwn_1_bottom"/></option>
-                </select>
-            </fieldset>
-        </form>
+        <%-- display the add page button at the end of the tabs --%>
+        <fmt:message key="page.general.addnewpage" var="addNewPageTitle"/>
+        <button id="add_page" title="${addNewPageTitle}" style="display: none;"></button>
     </div>
-    <fmt:message key="page.general.movepage" var="movePageTitle"/>
-    <div id="movePageDialog" title="${movePageTitle}" class="dialog">
-        <div><fmt:message key="page.general.movethispage"/></div>
-        <form id="movePageForm">
-            <select id="moveAfterPageId">
-                <c:if test="${page.renderSequence != 1}">
-                    <option value="-1"><fmt:message key="page.general.movethispage.tofirst"/></option>
-                </c:if>
-                <c:forEach var="userPage" items="${pages}">
-                    <c:if test="${userPage.entityId != page.entityId}">
-                        <option value="${userPage.entityId}">
-                          <fmt:message key="page.general.movethispage.after">
-                              <fmt:param><c:out value="${userPage.name}"/></fmt:param>
-                          </fmt:message>
-                        </option>
-                    </c:if>
-                </c:forEach>
-            </select>
-        </form>
-    </div>
-    <fmt:message key="widget.menu.movetopage" var="moveWidgetToPageTitle"/>
-    <div id="moveWidgetDialog" title="${moveWidgetToPageTitle}" class="dialog">
-        <div><fmt:message key="widget.menu.movethiswidget"/></div>
-        <form id="moveWidgetForm">
-            <select id="moveToPageId">
-                <c:forEach var="userPage" items="${pages}">
-                    <c:if test="${userPage.entityId != page.entityId}">
-                        <option value="${userPage.entityId}">
-                            <c:out value="${userPage.name}"/>
-                        </option>
-                    </c:if>
-                </c:forEach>
+</div>
+<%--render the main page content (regions/widgets) --%>
+<div id="pageContent">
+    <c:forEach var="region" items="${page.regions}">
+        <div class="region" id="region-${region.entityId}-id">
+            <c:forEach var="regionWidget" items="${region.regionWidgets}">
+               <div class="widget-wrapper" id="widget-${regionWidget.entityId}-wrapper">
+                    <div class="widget-title-bar">
+                        <span id="widget-${regionWidget.entityId}-collapse" class="widget-toolbar-toggle-collapse" title="<fmt:message key="widget.chrome.toggle"/>"></span>
+                        <div id="widget-${regionWidget.entityId}-title" class="widget-title">
+                        <c:choose>
+                            <c:when test="${not empty regionWidget.widget.titleUrl}">
+                                <a href="${regionWidget.widget.titleUrl}" rel="external"><c:out value="${regionWidget.widget.title}"/></a>
+                            </c:when>
+                            <c:otherwise>
+                                <c:out value="${regionWidget.widget.title}"/>
+                            </c:otherwise>
+                        </c:choose>
+                        </div>
+                        <%-- These are toolbar buttons --%>
+                        <div id="widget-${regionWidget.entityId}-toolbar" style="float:right;">
+                            <div id="widget-${regionWidget.entityId}-widget-menu-wrapper" class="widget-menu-wrapper">
+                                <span id="widget-${regionWidget.entityId}-menu-button" class="widget-menu-button ui-icon ui-icon-gear" title="<fmt:message key="widget.menu.title"/>"></span>
+                                <div id="widget-${regionWidget.entityId}-menu" class="widget-menu">
+                                    <%--
+                                        By default the edit prefs item is disabled.
+                                        Each provider's widget initialization will be responsible for enabling this item
+                                        if the widget has preferences to be edited
+                                    --%>
+                                    <div id="widget-${regionWidget.entityId}-menu-editprefs-item" class="widget-menu-item widget-menu-item-disabled">
+                                        <fmt:message key="widget.menu.editprefs"/>
+                                    </div>
+                                    <div id="widget-${regionWidget.entityId}-menu-maximize-item" class="widget-menu-item">
+                                        <fmt:message key="widget.menu.maximize"/>
+                                    </div>
+                                    <div id="widget-${regionWidget.entityId}-menu-move-item" class="widget-menu-item<c:if test='${hasOnlyOnePage}'> widget-menu-item-disabled</c:if>">
+                                        <fmt:message key="widget.menu.movetopage"/>
+                                    </div>
+                                    <div id="widget-${regionWidget.entityId}-menu-delete-item" class="widget-menu-item">
+                                        <fmt:message key="widget.menu.delete"/>
+                                    </div>
+                                </div>
+                            </div>
+                            <%-- the minimize widget button, which is hidden by default and only displays in maximized view --%>
+                            <button id="widget-${regionWidget.entityId}-min"
+                                    class="widget-toolbar-btn widget-toolbar-btn-min"></button>
+                        </div>
+                    </div>
+                    <div class="widget-prefs" id="widget-${regionWidget.entityId}-prefs-content"></div>
+                    <div class="widget" id="widget-${regionWidget.entityId}-body">
+                            <portal:render-widget regionWidget="${regionWidget}" />
+                    </div>
+                </div>
+            </c:forEach>
+        </div>
+    </c:forEach>
+    <div class="clear-float">&nbsp;</div>
+</div>
+<fmt:message key="page.general.addnewpage" var="addNewPageTitle"/>
+<div id="dialog" title="${addNewPageTitle}" class="dialog">
+    <form id="pageForm">
+        <div id="pageFormErrors" class="error"></div>
+        <fieldset class="ui-helper-reset">
+            <input type="hidden" name="tab_id" id="tab_id" value="" />
+            <label for="tab_title"><fmt:message key="page.general.addpage.title"/></label>
+            <input type="text" name="tab_title" id="tab_title" value="" class="required ui-widget-content ui-corner-all" />
+            <label for="pageLayout"><fmt:message key="page.general.addpage.selectlayout"/></label>
+            <select name="pageLayout" id="pageLayout">
+                <option value="columns_1" id="columns_1_id"><fmt:message key="page.general.addpage.layout.columns_1"/></option>
+                <option value="columns_2" id="columns_2_id" selected="selected"><fmt:message key="page.general.addpage.layout.columns_2"/></option>
+                <option value="columns_2wn" id="columns_2wn_id"><fmt:message key="page.general.addpage.layout.columns_2wn"/></option>
+                <option value="columns_3" id="columns_3_id"><fmt:message key="page.general.addpage.layout.columns_3"/></option>
+                <option value="columns_3nwn" id="columns_3nwn_id"><fmt:message key="page.general.addpage.layout.columns_3nwn"/></option>
+                <option value="columns_4" id="columns_4_id"><fmt:message key="page.general.addpage.layout.columns_4"/></option>
+                <option value="columns_3nwn_1_bottom" id="columns_3nwn_1_bottom"><fmt:message key="page.general.addpage.layout.columns_3nwn_1_bottom"/></option>
             </select>
-        </form>
-    </div>        
-    <script>
-        //Define the global widgets map.  This map will be populated by RegionWidgetRender providers.
-        var widgetsByRegionIdMap = {};
-    </script>
-    <portal:render-script location="${'BEFORE_LIB'}" />
-    <script src="//cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js"></script>
-    <script src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.1.min.js"></script>
-    <script src="//ajax.aspnetcdn.com/ajax/jquery.ui/1.8.13/jquery-ui.min.js"></script>
-    <script src="//ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js"></script>
-    <portal:render-script location="${'AFTER_LIB'}" />
-    <portal:render-script location="${'BEFORE_RAVE'}" />
-    <script src="<spring:url value="/script/rave.js"/>"></script>
-    <script src="<spring:url value="/script/rave_api.js"/>"></script>
-    <script src="<spring:url value="/script/rave_opensocial.js"/>"></script>
-    <script src="<spring:url value="/script/rave_wookie.js"/>"></script>
-    <script src="<spring:url value="/script/rave_layout.js"/>"></script>
-    <portal:render-script location="${'AFTER_RAVE'}" />
-    <script>
-        $(function() {
-            rave.setContext("<spring:url value="/app/" />");
-            rave.initProviders();
-            rave.initWidgets(widgetsByRegionIdMap);
-            rave.initUI();
-            rave.layout.init();
-        });
-    </script>
-</rave:rave_generic_page>
+        </fieldset>
+    </form>
+</div>
+<fmt:message key="page.general.movepage" var="movePageTitle"/>
+<div id="movePageDialog" title="${movePageTitle}" class="dialog">
+    <div><fmt:message key="page.general.movethispage"/></div>
+    <form id="movePageForm">
+        <select id="moveAfterPageId">
+            <c:if test="${page.renderSequence != 1}">
+                <option value="-1"><fmt:message key="page.general.movethispage.tofirst"/></option>
+            </c:if>
+            <c:forEach var="userPage" items="${pages}">
+                <c:if test="${userPage.entityId != page.entityId}">
+                    <option value="${userPage.entityId}">
+                      <fmt:message key="page.general.movethispage.after">
+                          <fmt:param><c:out value="${userPage.name}"/></fmt:param>
+                      </fmt:message>
+                    </option>
+                </c:if>
+            </c:forEach>
+        </select>
+    </form>
+</div>
+<fmt:message key="widget.menu.movetopage" var="moveWidgetToPageTitle"/>
+<div id="moveWidgetDialog" title="${moveWidgetToPageTitle}" class="dialog">
+    <div><fmt:message key="widget.menu.movethiswidget"/></div>
+    <form id="moveWidgetForm">
+        <select id="moveToPageId">
+            <c:forEach var="userPage" items="${pages}">
+                <c:if test="${userPage.entityId != page.entityId}">
+                    <option value="${userPage.entityId}">
+                        <c:out value="${userPage.name}"/>
+                    </option>
+                </c:if>
+            </c:forEach>
+        </select>
+    </form>
+</div>
+<script>
+    //Define the global widgets map.  This map will be populated by RegionWidgetRender providers.
+    var widgetsByRegionIdMap = {};
+</script>
+<portal:render-script location="${'BEFORE_LIB'}" />
+<script src="//cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js"></script>
+<script src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.1.min.js"></script>
+<script src="//ajax.aspnetcdn.com/ajax/jquery.ui/1.8.13/jquery-ui.min.js"></script>
+<script src="//ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js"></script>
+<portal:render-script location="${'AFTER_LIB'}" />
+<portal:render-script location="${'BEFORE_RAVE'}" />
+<script src="<spring:url value="/script/rave.js"/>"></script>
+<script src="<spring:url value="/script/rave_api.js"/>"></script>
+<script src="<spring:url value="/script/rave_opensocial.js"/>"></script>
+<script src="<spring:url value="/script/rave_wookie.js"/>"></script>
+<script src="<spring:url value="/script/rave_layout.js"/>"></script>
+<portal:render-script location="${'AFTER_RAVE'}" />
+<script>
+    $(function() {
+        rave.setContext("<spring:url value="/app/" />");
+        rave.initProviders();
+        rave.initWidgets(widgetsByRegionIdMap);
+        rave.initUI();
+        rave.layout.init();
+    });
+</script>
\ No newline at end of file

Added: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tiles-defs.xml
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tiles-defs.xml?rev=1199564&view=auto
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tiles-defs.xml (added)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tiles-defs.xml Wed Nov  9 00:25:45 2011
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 2.1//EN"
+        "http://tiles.apache.org/dtds/tiles-config_2_1.dtd">
+
+<tiles-definitions>
+
+    <!-- BASE DEFINITIONS FOR THE ENTIRE APPLICATION -->
+    <definition name="templates.base" template="/WEB-INF/jsp/templates/base_layout.jsp">
+        <put-attribute name="pageTitleKey" value="page.general.title"/>
+        <put-attribute name="pageTitleSuffixKey" value="page.general.titlesuffix"/>
+        <put-attribute name="header" value="/WEB-INF/jsp/common/header.jsp"/>
+        <put-attribute name="footer" value="/WEB-INF/jsp/common/footer.jsp"/>
+    </definition>
+
+    <!-- USER FACING PAGES -->
+    <definition name="templates.user.*" extends="templates.base">
+        <put-attribute name="pageTitleKey" value="page.{1}.title"/>
+        <put-attribute name="body" value="/WEB-INF/jsp/views/{1}.jsp"/>
+    </definition>
+
+    <!-- ADMIN ONLY PAGES -->
+
+</tiles-definitions>
\ No newline at end of file



Mime
View raw message