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 2009/09/25 13:17:50 UTC
svn commit: r818820 - in /tiles/framework/branches/TILES_2_1_X:
tiles-portlet/ tiles-portlet/src/main/java/org/apache/tiles/portlet/context/
tiles-portlet/src/test/java/org/apache/tiles/portlet/context/ tiles-test/
tiles-test/src/main/java/org/apache/t...
Author: apetrelli
Date: Fri Sep 25 11:17:49 2009
New Revision: 818820
URL: http://svn.apache.org/viewvc?rev=818820&view=rev
Log:
TILES-436
TILES-466
Merge from trunk to TILES_2_1_X branch.
Fixed portlet integration and added sample portlet in "tiles-test" webapp.
Added:
tiles/framework/branches/TILES_2_1_X/tiles-portlet/src/main/java/org/apache/tiles/portlet/context/PortletUtil.java
tiles/framework/branches/TILES_2_1_X/tiles-portlet/src/test/java/org/apache/tiles/portlet/context/PortletTilesRequestContextFactoryTest.java
tiles/framework/branches/TILES_2_1_X/tiles-test/src/main/java/org/apache/tiles/test/portlet/
tiles/framework/branches/TILES_2_1_X/tiles-test/src/main/java/org/apache/tiles/test/portlet/TestPortlet.java
tiles/framework/branches/TILES_2_1_X/tiles-test/src/main/java/org/apache/tiles/test/portlet/package.html
tiles/framework/branches/TILES_2_1_X/tiles-test/src/main/webapp/WEB-INF/jsp/
tiles/framework/branches/TILES_2_1_X/tiles-test/src/main/webapp/WEB-INF/jsp/index.jsp
tiles/framework/branches/TILES_2_1_X/tiles-test/src/main/webapp/WEB-INF/jsp/nosuchdefinition.jsp
tiles/framework/branches/TILES_2_1_X/tiles-test/src/main/webapp/WEB-INF/portlet.xml
Modified:
tiles/framework/branches/TILES_2_1_X/tiles-portlet/pom.xml
tiles/framework/branches/TILES_2_1_X/tiles-portlet/src/main/java/org/apache/tiles/portlet/context/PortletTilesRequestContextFactory.java
tiles/framework/branches/TILES_2_1_X/tiles-test/pom.xml
Modified: tiles/framework/branches/TILES_2_1_X/tiles-portlet/pom.xml
URL: http://svn.apache.org/viewvc/tiles/framework/branches/TILES_2_1_X/tiles-portlet/pom.xml?rev=818820&r1=818819&r2=818820&view=diff
==============================================================================
--- tiles/framework/branches/TILES_2_1_X/tiles-portlet/pom.xml (original)
+++ tiles/framework/branches/TILES_2_1_X/tiles-portlet/pom.xml Fri Sep 25 11:17:49 2009
@@ -90,6 +90,11 @@
<artifactId>tiles-core</artifactId>
<version>${pom.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.tiles</groupId>
+ <artifactId>tiles-servlet</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
<dependency>
<groupId>org.springframework</groupId>
@@ -133,6 +138,20 @@
</dependency>
<dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymockclassextension</artifactId>
+ <version>2.4</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.shale</groupId>
<artifactId>shale-test</artifactId>
<version>1.0.5</version>
Modified: tiles/framework/branches/TILES_2_1_X/tiles-portlet/src/main/java/org/apache/tiles/portlet/context/PortletTilesRequestContextFactory.java
URL: http://svn.apache.org/viewvc/tiles/framework/branches/TILES_2_1_X/tiles-portlet/src/main/java/org/apache/tiles/portlet/context/PortletTilesRequestContextFactory.java?rev=818820&r1=818819&r2=818820&view=diff
==============================================================================
--- tiles/framework/branches/TILES_2_1_X/tiles-portlet/src/main/java/org/apache/tiles/portlet/context/PortletTilesRequestContextFactory.java (original)
+++ tiles/framework/branches/TILES_2_1_X/tiles-portlet/src/main/java/org/apache/tiles/portlet/context/PortletTilesRequestContextFactory.java Fri Sep 25 11:17:49 2009
@@ -40,6 +40,14 @@
public class PortletTilesRequestContextFactory implements
TilesRequestContextFactory {
+ /**
+ * The site of the request object array in case there is a request, a
+ * response and a portlet context.
+ *
+ * @since 2.1.4
+ */
+ private static final int REQUEST_OBJECTS_LENGTH = 3;
+
/** {@inheritDoc} */
public void init(Map<String, String> configParameters) {
}
@@ -47,15 +55,26 @@
/** {@inheritDoc} */
public TilesRequestContext createRequestContext(TilesApplicationContext context,
Object... requestItems) {
- if (requestItems.length == 2) {
+ if (requestItems.length == 2
+ && requestItems[0] instanceof PortletRequest
+ && requestItems[1] instanceof PortletResponse) {
PortletContext portletContext = getPortletContext(context);
if (portletContext != null) {
return new PortletTilesRequestContext(context, portletContext,
(PortletRequest) requestItems[0],
(PortletResponse) requestItems[1]);
}
+ } else if (requestItems.length == REQUEST_OBJECTS_LENGTH
+ && requestItems[0] instanceof PortletRequest
+ && requestItems[1] instanceof PortletResponse
+ && requestItems[2] instanceof PortletContext) {
+ return new PortletTilesRequestContext(context,
+ (PortletContext) requestItems[2],
+ (PortletRequest) requestItems[0],
+ (PortletResponse) requestItems[1]);
}
+
return null;
}
Added: tiles/framework/branches/TILES_2_1_X/tiles-portlet/src/main/java/org/apache/tiles/portlet/context/PortletUtil.java
URL: http://svn.apache.org/viewvc/tiles/framework/branches/TILES_2_1_X/tiles-portlet/src/main/java/org/apache/tiles/portlet/context/PortletUtil.java?rev=818820&view=auto
==============================================================================
--- tiles/framework/branches/TILES_2_1_X/tiles-portlet/src/main/java/org/apache/tiles/portlet/context/PortletUtil.java (added)
+++ tiles/framework/branches/TILES_2_1_X/tiles-portlet/src/main/java/org/apache/tiles/portlet/context/PortletUtil.java Fri Sep 25 11:17:49 2009
@@ -0,0 +1,200 @@
+/*
+ * $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.
+ */
+
+package org.apache.tiles.portlet.context;
+
+import javax.portlet.PortletContext;
+import javax.portlet.PortletRequest;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.tiles.TilesContainer;
+import org.apache.tiles.access.TilesAccess;
+import org.apache.tiles.impl.NoSuchContainerException;
+import org.apache.tiles.servlet.context.ServletUtil;
+
+
+/**
+ * Utilities for Tiles portlet support.
+ *
+ * @version $Rev$ $Date$
+ * @since 2.0.6
+ */
+public final class PortletUtil {
+
+ /**
+ * Private constructor to avoid instantiation.
+ */
+ private PortletUtil() {
+ }
+
+ /**
+ * Returns true if forced include of the result is needed.
+ *
+ * @param request The portlet request.
+ * @return If <code>true</code> the include operation must be forced.
+ * @since 2.0.6
+ */
+ public static boolean isForceInclude(PortletRequest request) {
+ Boolean retValue = (Boolean) request
+ .getAttribute(ServletUtil.FORCE_INCLUDE_ATTRIBUTE_NAME);
+ return retValue != null && retValue.booleanValue();
+ }
+
+ /**
+ * Sets the option that enables the forced include of the response.
+ *
+ * @param request The portlet request.
+ * @param forceInclude If <code>true</code> the include operation must be
+ * forced.
+ * @since 2.0.6
+ */
+ public static void setForceInclude(PortletRequest request,
+ boolean forceInclude) {
+ Boolean retValue = Boolean.valueOf(forceInclude);
+ request.setAttribute(
+ ServletUtil.FORCE_INCLUDE_ATTRIBUTE_NAME,
+ retValue);
+ }
+
+ /**
+ * Returns the default Tiles container.
+ *
+ * @param context The portlet context to use.
+ * @return The default Tiles container.
+ * @since 2.1.2
+ */
+ public static TilesContainer getContainer(PortletContext context) {
+ return getContainer(context, TilesAccess.CONTAINER_ATTRIBUTE);
+ }
+
+ /**
+ * Returns a specific Tiles container.
+ *
+ * @param context The portlet context to use.
+ * @param key The key under which the container is stored. If null, the
+ * default container will be returned.
+ * @return The requested Tiles container.
+ * @since 2.1.2
+ */
+ public static TilesContainer getContainer(PortletContext context, String key) {
+ if (key == null) {
+ key = TilesAccess.CONTAINER_ATTRIBUTE;
+ }
+ return (TilesContainer) context.getAttribute(key);
+ }
+
+ /**
+ * Configures the default container to be used in the application.
+ *
+ * @param context The portlet context object to use.
+ * @param container The container object to set.
+ * @since 2.1.2
+ */
+ public static void setContainer(PortletContext context,
+ TilesContainer container) {
+ setContainer(context, container, TilesAccess.CONTAINER_ATTRIBUTE);
+ }
+
+ /**
+ * Configures the container to be used in the application.
+ *
+ * @param context The portlet context object to use.
+ * @param container The container object to set.
+ * @param key The key under which the container will be stored.
+ * @since 2.1.2
+ */
+ public static void setContainer(PortletContext context,
+ TilesContainer container, String key) {
+ Log log = LogFactory.getLog(PortletUtil.class);
+ if (key == null) {
+ key = TilesAccess.CONTAINER_ATTRIBUTE;
+ }
+
+ if (container == null) {
+ if (log.isInfoEnabled()) {
+ log.info("Removing TilesContext for context: " + context.getClass().getName());
+ }
+ context.removeAttribute(key);
+ }
+ if (container != null && log.isInfoEnabled()) {
+ log.info("Publishing TilesContext for context: " + context.getClass().getName());
+ }
+ context.setAttribute(key, container);
+ }
+
+ /**
+ * Sets the current container to use in web pages.
+ *
+ * @param request The request to use.
+ * @param context The portlet context to use.
+ * @param key The key under which the container is stored.
+ * @since 2.1.0
+ */
+ public static void setCurrentContainer(PortletRequest request,
+ PortletContext context, String key) {
+ TilesContainer container = getContainer(context, key);
+ if (container != null) {
+ request.setAttribute(ServletUtil.CURRENT_CONTAINER_ATTRIBUTE_NAME, container);
+ } else {
+ throw new NoSuchContainerException("The container with the key '"
+ + key + "' cannot be found");
+ }
+ }
+
+ /**
+ * Sets the current container to use in web pages.
+ *
+ * @param request The request to use.
+ * @param context The portlet context to use.
+ * @param container The container to use as the current container.
+ * @since 2.1.0
+ */
+ public static void setCurrentContainer(PortletRequest request,
+ PortletContext context, TilesContainer container) {
+ if (container != null) {
+ request.setAttribute(ServletUtil.CURRENT_CONTAINER_ATTRIBUTE_NAME, container);
+ } else {
+ throw new NoSuchContainerException("The container cannot be null");
+ }
+ }
+
+ /**
+ * Returns the current container that has been set, or the default one.
+ *
+ * @param request The request to use.
+ * @param context The portlet context to use.
+ * @return The current Tiles container to use in web pages.
+ * @since 2.1.0
+ */
+ public static TilesContainer getCurrentContainer(PortletRequest request,
+ PortletContext context) {
+ TilesContainer container = (TilesContainer) request
+ .getAttribute(ServletUtil.CURRENT_CONTAINER_ATTRIBUTE_NAME);
+ if (container == null) {
+ container = getContainer(context);
+ request.setAttribute(ServletUtil.CURRENT_CONTAINER_ATTRIBUTE_NAME,
+ container);
+ }
+
+ return container;
+ }
+}
Added: tiles/framework/branches/TILES_2_1_X/tiles-portlet/src/test/java/org/apache/tiles/portlet/context/PortletTilesRequestContextFactoryTest.java
URL: http://svn.apache.org/viewvc/tiles/framework/branches/TILES_2_1_X/tiles-portlet/src/test/java/org/apache/tiles/portlet/context/PortletTilesRequestContextFactoryTest.java?rev=818820&view=auto
==============================================================================
--- tiles/framework/branches/TILES_2_1_X/tiles-portlet/src/test/java/org/apache/tiles/portlet/context/PortletTilesRequestContextFactoryTest.java (added)
+++ tiles/framework/branches/TILES_2_1_X/tiles-portlet/src/test/java/org/apache/tiles/portlet/context/PortletTilesRequestContextFactoryTest.java Fri Sep 25 11:17:49 2009
@@ -0,0 +1,124 @@
+/*
+ * $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.
+ */
+
+package org.apache.tiles.portlet.context;
+
+import static org.easymock.EasyMock.*;
+import static org.easymock.classextension.EasyMock.*;
+import static org.junit.Assert.*;
+
+import javax.portlet.PortletContext;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletResponse;
+
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Test for {@link PortletTilesRequestContextFactory}.
+ *
+ * @version $Rev$ $Date$
+ */
+public class PortletTilesRequestContextFactoryTest {
+
+ /**
+ * The factory to test.
+ */
+ private PortletTilesRequestContextFactory factory;
+
+ /**
+ * Sets up the test object.
+ */
+ @Before
+ public void setUp() {
+ factory = new PortletTilesRequestContextFactory();
+ }
+
+ /**
+ * Test method for
+ * {@link PortletTilesRequestContextFactory
+ * #createRequestContext(org.apache.tiles.TilesApplicationContext, java.lang.Object[])}
+ * .
+ */
+ @Test
+ public void testCreateRequestContext2Params() {
+ PortletTilesApplicationContext applicationContext = createMock(PortletTilesApplicationContext.class);
+ PortletRequest request = createMock(PortletRequest.class);
+ PortletResponse response = createMock(PortletResponse.class);
+ PortletContext portletContext = createMock(PortletContext.class);
+
+ expect(applicationContext.getPortletContext())
+ .andReturn(portletContext);
+
+ replay(applicationContext, request, response, portletContext);
+ PortletTilesRequestContext tilesRequest = (PortletTilesRequestContext) factory
+ .createRequestContext(applicationContext, request, response);
+ Object[] objs = tilesRequest.getRequestObjects();
+ assertEquals(2, objs.length);
+ assertEquals(request, objs[0]);
+ assertEquals(response, objs[1]);
+ verify(applicationContext, request, response, portletContext);
+ }
+
+ /**
+ * Test method for
+ * {@link PortletTilesRequestContextFactory
+ * #createRequestContext(org.apache.tiles.TilesApplicationContext, java.lang.Object[])}
+ * .
+ */
+ @Test
+ public void testCreateRequestContext3Params() {
+ PortletTilesApplicationContext applicationContext = createMock(PortletTilesApplicationContext.class);
+ PortletRequest request = createMock(PortletRequest.class);
+ PortletResponse response = createMock(PortletResponse.class);
+ PortletContext portletContext = createMock(PortletContext.class);
+
+ replay(applicationContext, request, response, portletContext);
+ PortletTilesRequestContext tilesRequest = (PortletTilesRequestContext) factory
+ .createRequestContext(applicationContext, request, response,
+ portletContext);
+ Object[] objs = tilesRequest.getRequestObjects();
+ assertEquals(2, objs.length);
+ assertEquals(request, objs[0]);
+ assertEquals(response, objs[1]);
+ verify(applicationContext, request, response, portletContext);
+ }
+
+ /**
+ * Test method for
+ * {@link org.apache.tiles.portlet.context.PortletTilesRequestContextFactory
+ * #getPortletContext(org.apache.tiles.TilesApplicationContext)}
+ * .
+ */
+ @Test
+ public void testGetPortletContext() {
+ PortletTilesApplicationContext applicationContext = createMock(PortletTilesApplicationContext.class);
+ PortletContext portletContext = createMock(PortletContext.class);
+
+ expect(applicationContext.getPortletContext())
+ .andReturn(portletContext);
+
+ replay(applicationContext, portletContext);
+ assertEquals(portletContext, factory.getPortletContext(applicationContext));
+ verify(applicationContext, portletContext);
+ }
+
+}
Modified: tiles/framework/branches/TILES_2_1_X/tiles-test/pom.xml
URL: http://svn.apache.org/viewvc/tiles/framework/branches/TILES_2_1_X/tiles-test/pom.xml?rev=818820&r1=818819&r2=818820&view=diff
==============================================================================
--- tiles/framework/branches/TILES_2_1_X/tiles-test/pom.xml (original)
+++ tiles/framework/branches/TILES_2_1_X/tiles-test/pom.xml Fri Sep 25 11:17:49 2009
@@ -48,6 +48,11 @@
<version>${pom.version}</version>
</dependency>
<dependency>
+ <groupId>${pom.groupId}</groupId>
+ <artifactId>tiles-portlet</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
@@ -60,6 +65,12 @@
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>javax.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ <version>2.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>jasper-el</artifactId>
<version>6.0.20</version>
@@ -98,6 +109,12 @@
<version>2.5.6</version>
</dependency>
<dependency>
+ <groupId>org.apache.portals.pluto</groupId>
+ <artifactId>pluto-taglib</artifactId>
+ <version>2.0.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>2.5.6</version>
Added: tiles/framework/branches/TILES_2_1_X/tiles-test/src/main/java/org/apache/tiles/test/portlet/TestPortlet.java
URL: http://svn.apache.org/viewvc/tiles/framework/branches/TILES_2_1_X/tiles-test/src/main/java/org/apache/tiles/test/portlet/TestPortlet.java?rev=818820&view=auto
==============================================================================
--- tiles/framework/branches/TILES_2_1_X/tiles-test/src/main/java/org/apache/tiles/test/portlet/TestPortlet.java (added)
+++ tiles/framework/branches/TILES_2_1_X/tiles-test/src/main/java/org/apache/tiles/test/portlet/TestPortlet.java Fri Sep 25 11:17:49 2009
@@ -0,0 +1,102 @@
+/*
+ * $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.
+ */
+package org.apache.tiles.test.portlet;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.PortletSession;
+import javax.portlet.PortletURL;
+import javax.portlet.ProcessAction;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.tiles.TilesContainer;
+import org.apache.tiles.portlet.context.PortletUtil;
+
+/**
+ * Test Portlet.
+ *
+ * @version $Rev$ $Date$
+ */
+public class TestPortlet extends GenericPortlet {
+
+ /** {@inheritDoc} */
+ @Override
+ protected void doView(RenderRequest request, RenderResponse response)
+ throws PortletException, IOException {
+ PortletSession portletSession = request.getPortletSession();
+ String definition = (String) portletSession.getAttribute("definition");
+ if (definition != null) {
+ portletSession.removeAttribute("definition");
+ TilesContainer container = PortletUtil.getCurrentContainer(request,
+ getPortletContext());
+ if (container.isValidDefinition(definition, request, response,
+ getPortletContext())) {
+ container.render(definition, request, response,
+ getPortletContext());
+ addBackLink(response);
+ } else {
+ PortletRequestDispatcher dispatcher = getPortletContext()
+ .getRequestDispatcher(
+ "/WEB-INF/jsp/nosuchdefinition.jsp");
+ dispatcher.forward(request, response);
+ addBackLink(response);
+ }
+ } else {
+ PortletRequestDispatcher dispatcher = getPortletContext()
+ .getRequestDispatcher("/WEB-INF/jsp/index.jsp");
+ dispatcher.forward(request, response);
+ }
+ }
+
+
+ /**
+ * Puts the definition name in a session attribue.
+ *
+ * @param request The portlet request.
+ * @param response The portlet response.
+ */
+ @ProcessAction(name = "showDefinition")
+ public void showDefinition(ActionRequest request, ActionResponse response) {
+ request.getPortletSession().setAttribute("definition",
+ request.getParameter("definition"));
+ }
+
+ /**
+ * Adds a link to the response to go back.
+ *
+ * @param response The portlet response.
+ * @throws IOException If something goes wrong.
+ */
+ private void addBackLink(RenderResponse response) throws IOException {
+ PrintWriter writer = response.getWriter();
+ writer.append("<a href=\"");
+ PortletURL url = response.createRenderURL();
+ writer.append(url.toString());
+ writer.append("\"> Back to definition selection</a>");
+ }
+}
Added: tiles/framework/branches/TILES_2_1_X/tiles-test/src/main/java/org/apache/tiles/test/portlet/package.html
URL: http://svn.apache.org/viewvc/tiles/framework/branches/TILES_2_1_X/tiles-test/src/main/java/org/apache/tiles/test/portlet/package.html?rev=818820&view=auto
==============================================================================
--- tiles/framework/branches/TILES_2_1_X/tiles-test/src/main/java/org/apache/tiles/test/portlet/package.html (added)
+++ tiles/framework/branches/TILES_2_1_X/tiles-test/src/main/java/org/apache/tiles/test/portlet/package.html Fri Sep 25 11:17:49 2009
@@ -0,0 +1,30 @@
+<!--
+/*
+ * $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>
+ <title>Test portlets.</title>
+</head>
+<body>
+Test portlets for Tiles evaluation.
+</body>
+</html>
\ No newline at end of file
Added: tiles/framework/branches/TILES_2_1_X/tiles-test/src/main/webapp/WEB-INF/jsp/index.jsp
URL: http://svn.apache.org/viewvc/tiles/framework/branches/TILES_2_1_X/tiles-test/src/main/webapp/WEB-INF/jsp/index.jsp?rev=818820&view=auto
==============================================================================
--- tiles/framework/branches/TILES_2_1_X/tiles-test/src/main/webapp/WEB-INF/jsp/index.jsp (added)
+++ tiles/framework/branches/TILES_2_1_X/tiles-test/src/main/webapp/WEB-INF/jsp/index.jsp Fri Sep 25 11:17:49 2009
@@ -0,0 +1,43 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"%>
+<%@taglib prefix="portlet" uri="http://java.sun.com/portlet_2_0" %>
+<%--
+/*
+ * $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.
+ *
+ */
+--%>
+<portlet:defineObjects/>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Insert title here</title>
+</head>
+<body>
+<p>Type a definition name to render it.</p>
+<form action="<portlet:actionURL name='showDefinition' />" method="post">
+ <label for="definitionName">Definition name:</label><input id="definitionName" type="text" name="definition" />
+ <input type="submit" value="Render" />
+</form>
+
+
+</body>
+</html>
\ No newline at end of file
Added: tiles/framework/branches/TILES_2_1_X/tiles-test/src/main/webapp/WEB-INF/jsp/nosuchdefinition.jsp
URL: http://svn.apache.org/viewvc/tiles/framework/branches/TILES_2_1_X/tiles-test/src/main/webapp/WEB-INF/jsp/nosuchdefinition.jsp?rev=818820&view=auto
==============================================================================
--- tiles/framework/branches/TILES_2_1_X/tiles-test/src/main/webapp/WEB-INF/jsp/nosuchdefinition.jsp (added)
+++ tiles/framework/branches/TILES_2_1_X/tiles-test/src/main/webapp/WEB-INF/jsp/nosuchdefinition.jsp Fri Sep 25 11:17:49 2009
@@ -0,0 +1,35 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"%>
+<%--
+/*
+ * $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.
+ *
+ */
+--%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Insert title here</title>
+</head>
+<body>
+No definition here!
+</body>
+</html>
\ No newline at end of file
Added: tiles/framework/branches/TILES_2_1_X/tiles-test/src/main/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewvc/tiles/framework/branches/TILES_2_1_X/tiles-test/src/main/webapp/WEB-INF/portlet.xml?rev=818820&view=auto
==============================================================================
--- tiles/framework/branches/TILES_2_1_X/tiles-test/src/main/webapp/WEB-INF/portlet.xml (added)
+++ tiles/framework/branches/TILES_2_1_X/tiles-test/src/main/webapp/WEB-INF/portlet.xml Fri Sep 25 11:17:49 2009
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/*
+ * $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.
+ */
+-->
+<portlet-app
+ xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+
+ <portlet>
+ <portlet-name>TestPortlet</portlet-name>
+ <display-name>TestPortlet</display-name>
+ <portlet-class>
+ org.apache.tiles.test.portlet.TestPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>TestPortlet</title>
+ </portlet-info>
+ </portlet>
+</portlet-app>