Author: chris.laprun(a)jboss.com
Date: 2008-02-08 23:57:27 -0500 (Fri, 08 Feb 2008)
New Revision: 9883
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/CartEvent.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/CartPortlet.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/Catalog.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/CatalogItem.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/CatalogPortlet.java
modules/portlet/trunk/test/src/test/resources/cart-event-portlet-war/
modules/portlet/trunk/test/src/test/resources/cart-event-portlet-war/WEB-INF/
modules/portlet/trunk/test/src/test/resources/cart-event-portlet-war/WEB-INF/portlet.xml
modules/portlet/trunk/test/src/test/resources/cart-event-portlet-war/WEB-INF/web.xml
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/StateAwareResponseImpl.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PagePortletControllerContext.java
modules/portlet/trunk/test/src/test/build.xml
modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo.jsp
modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.jsp
modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/default.jsp
Log:
- Added event demo portlets: a catalog and a cart. Does not currently work as there seems
to be problem with the event processing.
- Modified PagePortletControllerContext.getPortlet as the given parameter is not always a
windowId (in particular, it's a portlet id when processing events).
The current fix is probably a hack and indicative of a more serious issue (as evidenced
with further problems down the stream).
- Fixed incorrect forward in index.jsp.
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/StateAwareResponseImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/StateAwareResponseImpl.java 2008-02-09
03:22:01 UTC (rev 9882)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/StateAwareResponseImpl.java 2008-02-09
04:57:27 UTC (rev 9883)
@@ -283,11 +283,11 @@
// Check jaxb annotation
if (requiresJAXBAnnotation(valueType))
{
- for (Annotation a : value.getClass().getAnnotations())
+ for (Annotation a : valueType.getAnnotations())
{
System.out.println("a = " + a);
}
- boolean b = value.getClass().isAnnotationPresent(XmlRootElement.class);
+ boolean b = valueType.isAnnotationPresent(XmlRootElement.class);
if (!b)
{
throw new IllegalArgumentException("The provided event value type
" + value.getClass().getName() +
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PagePortletControllerContext.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PagePortletControllerContext.java 2008-02-09
03:22:01 UTC (rev 9882)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PagePortletControllerContext.java 2008-02-09
04:57:27 UTC (rev 9883)
@@ -22,25 +22,25 @@
******************************************************************************/
package org.jboss.portal.portlet.test.jsp;
-import org.jboss.portal.portlet.test.controller.AbstractPortletControllerContext;
import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.PortletInvoker;
-import org.jboss.portal.portlet.PortletContext;
-import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.controller.event.EventControllerContext;
import org.jboss.portal.portlet.controller.impl.event.EventControllerContextImpl;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.test.controller.AbstractPortletControllerContext;
import org.jboss.portal.web.IllegalRequestException;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
import java.io.IOException;
+import java.util.HashMap;
import java.util.Map;
-import java.util.HashMap;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -93,6 +93,14 @@
{
int index = windowId.lastIndexOf('.');
String portletId = windowId.substring(0, index);
+
+ // in the case of an event propagation, the given 'windowId' is actually
the portlet id already so need to check
+ // for that case (portletId should still have a '.', if not it means that
the windowId was really a portlet id)
+ if (portletId.indexOf('.') == -1)
+ {
+ portletId = windowId;
+ }
+
PortletContext portletContext = PortletContext.createPortletContext(portletId);
return invoker.getPortlet(portletContext);
}
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/CartEvent.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/CartEvent.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/CartEvent.java 2008-02-09
04:57:27 UTC (rev 9883)
@@ -0,0 +1,50 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+
+package org.jboss.portal.simple.samples.event;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.namespace.QName;
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+@XmlRootElement
+public class CartEvent implements Serializable
+{
+ private String id;
+
+ public static final QName QNAME = new
QName("urn:jboss:portal:samples:event", "CartEvent");
+
+ public CartEvent(String id)
+ {
+ this.id = id;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+}
Property changes on:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/CartEvent.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/CartPortlet.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/CartPortlet.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/CartPortlet.java 2008-02-09
04:57:27 UTC (rev 9883)
@@ -0,0 +1,82 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+
+package org.jboss.portal.simple.samples.event;
+
+import javax.portlet.Event;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class CartPortlet extends GenericPortlet
+{
+ List<CatalogItem> items = new ArrayList<CatalogItem>(7);
+
+ @Override
+ protected void doView(RenderRequest renderRequest, RenderResponse renderResponse)
throws PortletException, IOException
+ {
+ renderResponse.setContentType("text/html");
+ Writer writer = renderResponse.getWriter();
+
+
+ if (!items.isEmpty())
+ {
+
writer.append("<table><thead><tr><th>Description</th><th>Price</th></tr></thead><tbody>");
+ int total = 0;
+ for (CatalogItem item : items)
+ {
+ int price = item.getPrice();
+ total += price;
+
writer.append("<tr><td>").append(item.getDescription()).append("</td><td
align='right'>$").append("" + price)
+ .append("</td></tr>");
+ }
+ writer.append("<tr><td colspan='2'
align='right'>").append("$" +
total).append("</td></tr></tbody></table>");
+ }
+ else
+ {
+ writer.append("Cart is empty.");
+ }
+ }
+
+ @Override
+ public void processEvent(EventRequest eventRequest, EventResponse eventResponse)
throws PortletException, IOException
+ {
+ Event event = eventRequest.getEvent();
+ if (event.getName().equals("CartEvent"))
+ {
+ CartEvent cartEvent = (CartEvent)event.getValue();
+ items.add(Catalog.get(cartEvent.getId()));
+ }
+ }
+}
Property changes on:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/CartPortlet.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/Catalog.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/Catalog.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/Catalog.java 2008-02-09
04:57:27 UTC (rev 9883)
@@ -0,0 +1,63 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+
+package org.jboss.portal.simple.samples.event;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class Catalog
+{
+ private static Map<String, CatalogItem> items;
+
+ static
+ {
+ items = new HashMap<String, CatalogItem>(7);
+ items.put("1", new CatalogItem("1", 800, "Bike"));
+ items.put("2", new CatalogItem("2", 450,
"Snowboard"));
+ items.put("3", new CatalogItem("3", 225, "Tent"));
+ items.put("4", new CatalogItem("4", 75,
"Backpack"));
+ items.put("5", new CatalogItem("5", 119,
"Skateboard"));
+ items.put("6", new CatalogItem("6", 333,
"Surfboard"));
+ items.put("7", new CatalogItem("7", 90,
"Sneakers"));
+ }
+
+ private Catalog()
+ {
+ }
+
+ public static CatalogItem get(String id)
+ {
+ return items.get(id);
+ }
+
+ public static Collection<CatalogItem> getAll()
+ {
+ return items.values();
+ }
+}
Property changes on:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/Catalog.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/CatalogItem.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/CatalogItem.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/CatalogItem.java 2008-02-09
04:57:27 UTC (rev 9883)
@@ -0,0 +1,57 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+
+package org.jboss.portal.simple.samples.event;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class CatalogItem
+{
+ private String id;
+ private int price;
+ private String description;
+
+ public CatalogItem(String id, int price, String description)
+ {
+ this.id = id;
+ this.price = price;
+ this.description = description;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public int getPrice()
+ {
+ return price;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+}
Property changes on:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/CatalogItem.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/CatalogPortlet.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/CatalogPortlet.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/CatalogPortlet.java 2008-02-09
04:57:27 UTC (rev 9883)
@@ -0,0 +1,71 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+
+package org.jboss.portal.simple.samples.event;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class CatalogPortlet extends GenericPortlet
+{
+ @Override
+ protected void doView(RenderRequest renderRequest, RenderResponse renderResponse)
throws PortletException, IOException
+ {
+ renderResponse.setContentType("text/html");
+ Writer writer = renderResponse.getWriter();
+
+
writer.append("<table><thead><tr><th>Description</th><th>Price</th><th>Actions</th></tr></thead><tbody>");
+
+ PortletURL addURL = renderResponse.createActionURL();
+ addURL.setParameter("op", "add");
+
+ Collection<CatalogItem> items = Catalog.getAll();
+ for (CatalogItem item : items)
+ {
+ addURL.setParameter("id", item.getId());
+
writer.append("<tr><td>").append(item.getDescription()).append("</td><td>$").append(""
+ item.getPrice())
+ .append("</td><td><a
href='").append(addURL.toString()).append("'>Add to
cart</a></td></tr>");
+ }
+
+ writer.append("</tbody></table>");
+ }
+
+ @Override
+ public void processAction(ActionRequest actionRequest, ActionResponse actionResponse)
throws PortletException, IOException
+ {
+ String value = actionRequest.getParameter("id");
+ actionResponse.setEvent(CartEvent.QNAME, new CartEvent(value));
+ }
+}
Property changes on:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/CatalogPortlet.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: modules/portlet/trunk/test/src/test/build.xml
===================================================================
--- modules/portlet/trunk/test/src/test/build.xml 2008-02-09 03:22:01 UTC (rev 9882)
+++ modules/portlet/trunk/test/src/test/build.xml 2008-02-09 04:57:27 UTC (rev 9883)
@@ -698,7 +698,6 @@
<fileset dir="${target}"
includes="portlet-test-lib.jar"/>
<path refid="mc.portal-common"/>
- <path refid="mc.portal-portlet"/>
<!-- MC 2.0.0.Beta4 -->
<path refid="mc.trove"/>
@@ -711,13 +710,13 @@
<path refid="mc.jboss_xb"/>
<path refid="mc.jboss_aop"/>
<path refid="mc.jboss_microcontainer"/>
- <path refid="mc.jaxb-api"/>
<!-- For Tomcat -->
<path>
<pathelement path="${dependency.log4j.jar}"/>
<pathelement path="${dependency.activation.jar}"/>
<pathelement path="${dependency.xercesImpl.jar}"/>
+ <!--<path refid="mc.jaxb-api"/>-->
</path>
</copy>
@@ -762,12 +761,21 @@
<copy todir="${test.temp.dir}/remotecontrol-portlet-war">
<fileset dir="src/test/resources/remotecontrol-portlet-war"/>
- <fileset dir="${target}/classes"
includes="org/jboss/portal/simple/samples/RemoteControlResourcePortlet.class"/>
+ <fileset dir="${target}/classes"
+
includes="org/jboss/portal/simple/samples/RemoteControlResourcePortlet.class"/>
</copy>
<jar jarfile="${target}/remotecontrol-portlet.war">
<fileset dir="${test.temp.dir}/remotecontrol-portlet-war"/>
</jar>
+ <copy todir="${test.temp.dir}/cart-event-portlet-war">
+ <fileset dir="src/test/resources/cart-event-portlet-war"/>
+ <fileset dir="${target}/classes"
includes="org/jboss/portal/simple/samples/event/*.class"/>
+ </copy>
+ <jar jarfile="${target}/cart-event-portlet.war">
+ <fileset dir="${test.temp.dir}/cart-event-portlet-war"/>
+ </jar>
+
<mkdir dir="${test.temp.dir}/portal"/>
<mkdir dir="${test.temp.dir}/portal/samples"/>
<copy todir="${test.temp.dir}/portal/samples-basic-war">
Copied:
modules/portlet/trunk/test/src/test/resources/cart-event-portlet-war/WEB-INF/portlet.xml
(from rev 9878,
modules/portlet/trunk/test/src/test/resources/google-map-portlet-war/WEB-INF/portlet.xml)
===================================================================
---
modules/portlet/trunk/test/src/test/resources/cart-event-portlet-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/test/src/test/resources/cart-event-portlet-war/WEB-INF/portlet.xml 2008-02-09
04:57:27 UTC (rev 9883)
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2008, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<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...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+ <portlet>
+ <description>Catalog Portlet</description>
+ <portlet-name>Catalog</portlet-name>
+ <display-name>Catalog Portlet</display-name>
+
<portlet-class>org.jboss.portal.simple.samples.event.CatalogPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Catalog Portlet</title>
+ <keywords>sample,event,catalog</keywords>
+ </portlet-info>
+ <supported-publishing-event>
+ <qname
xmlns:jbp='urn:jboss:portal:samples:event'>jbp:CartEvent</qname>
+ </supported-publishing-event>
+ </portlet>
+
+ <portlet>
+ <description>Cart Portlet</description>
+ <portlet-name>Cart</portlet-name>
+ <display-name>Cart Portlet</display-name>
+
<portlet-class>org.jboss.portal.simple.samples.event.CartPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Cart Portlet</title>
+ <keywords>sample,event,cart</keywords>
+ </portlet-info>
+ <supported-processing-event>
+ <qname
xmlns:jbp='urn:jboss:portal:samples:event'>jbp:CartEvent</qname>
+ </supported-processing-event>
+ </portlet>
+
+ <event-definition>
+ <qname
xmlns:jbp='urn:jboss:portal:samples:event'>jbp:CartEvent</qname>
+
<value-type>org.jboss.portal.simple.samples.event.CartEvent</value-type>
+ </event-definition>
+</portlet-app>
+
Copied:
modules/portlet/trunk/test/src/test/resources/cart-event-portlet-war/WEB-INF/web.xml (from
rev 9878,
modules/portlet/trunk/test/src/test/resources/google-map-portlet-war/WEB-INF/web.xml)
===================================================================
--- modules/portlet/trunk/test/src/test/resources/cart-event-portlet-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/test/src/test/resources/cart-event-portlet-war/WEB-INF/web.xml 2008-02-09
04:57:27 UTC (rev 9883)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2008, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app/>
+
Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo.jsp
===================================================================
---
modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo.jsp 2008-02-09
03:22:01 UTC (rev 9882)
+++
modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo.jsp 2008-02-09
04:57:27 UTC (rev 9883)
@@ -4,21 +4,23 @@
<%@ taglib uri="/WEB-INF/portal.tld" prefix="portal" %>
<%@ page isELIgnored="false" %>
- <%@ include file="/layouts/header.jsp" %>
-
- <portal:page>
- <portal:pageparam namespaceURI="urn:jboss:portal:simple:google"
localName="zipcode" value="80201"/>
- <jbp:layout1>
+<%@ include file="/layouts/header.jsp" %>
+
+<portal:page>
+ <portal:pageparam namespaceURI="urn:jboss:portal:simple:google"
localName="zipcode" value="80201"/>
+ <jbp:layout1>
<jsp:attribute name="leftcol">
<jbp:portlet name="RemoteControl"
applicationName="remotecontrol-portlet"/>
<jbp:portlet name="Foo" applicationName="bar"/>
<jbp:portlet name="ErrorPortlet"
applicationName="samples-basic"/>
+ <jbp:portlet name="Cart"
applicationName="cart-event-portlet"/>
</jsp:attribute>
<jsp:attribute name="rightcol">
<jbp:portlet name="GoogleMap"
applicationName="google-map-portlet"/>
<jbp:portlet name="GoogleWeather"
applicationName="google-weather-portlet"/>
+ <jbp:portlet name="Catalog"
applicationName="cart-event-portlet"/>
</jsp:attribute>
- </jbp:layout1>
- </portal:page>
+ </jbp:layout1>
+</portal:page>
- <%@ include file="/layouts/footer.jsp" %>
\ No newline at end of file
+<%@ include file="/layouts/footer.jsp" %>
\ No newline at end of file
Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.jsp
===================================================================
--- modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.jsp 2008-02-09
03:22:01 UTC (rev 9882)
+++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.jsp 2008-02-09
04:57:27 UTC (rev 9883)
@@ -3,8 +3,8 @@
<%@ page isELIgnored="false" %>
<html>
<body>
-<jsp:forward page="demo/main.jsp" >
- <jsp:param name="nav" value="home" />
+<jsp:forward page="demo/home.jsp">
+ <jsp:param name="nav" value="home"/>
</jsp:forward>
</body>
</html>
Modified:
modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/default.jsp
===================================================================
---
modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/default.jsp 2008-02-09
03:22:01 UTC (rev 9882)
+++
modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/default.jsp 2008-02-09
04:57:27 UTC (rev 9883)
@@ -5,97 +5,98 @@
<%@ page isELIgnored="false" %>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en">
<head>
-<title>Portlet Container 2.0</title>
-<link rel="stylesheet"
href="${pageContext.request.contextPath}/css/master.css"
type="text/css"/>
+ <title>Portlet Container 2.0</title>
+ <link rel="stylesheet"
href="${pageContext.request.contextPath}/css/master.css"
type="text/css"/>
</head>
<body>
<div id="container" class="full-width">
<div class="header full-width">
<div class="float-left three-quarter-width logo"></div>
- <div class="float-right quarter-width pc20"><img
src="/simple/images/pc20.gif" alt="Portlet Container
2.0"/></div>
+ <div class="float-right quarter-width pc20"><img
src="${pageContext.request.contextPath}/images/pc20.gif"
+ alt="Portlet Container
2.0"/></div>
<br class="clear"/>
</div>
<%@ include file="nav/main.jsp" %>
<div id="content">
<portal:page>
- <div class="home-content full-width">
- <div class="third-width float-right">
- <jbp:portlet name="GoogleMap"
applicationName="google-map-portlet" />
+ <div class="home-content full-width">
+ <div class="third-width float-right">
+ <jbp:portlet name="GoogleMap"
applicationName="google-map-portlet"/>
</div>
- <h2 class="title">Demo Page Title</h2>
- Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et
- dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip
- ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu
- fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt
- mollit anim id est laborum.
- <br/>
- Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et
- dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip
- ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu
- fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt
- mollit anim id est laborum.
- <br/>
- Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et
- dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip
- ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu
- fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt
- mollit anim id est laborum.
- <br/>
- Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et
- dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip
- ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu
- fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt
- mollit anim id est laborum.
- <br/>
- Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et
- dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip
- ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu
- fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt
- mollit anim id est laborum.
- <br/>
- Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et
- dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip
- ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu
- fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt
- mollit anim id est laborum.
- <br/>
- Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et
- dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip
- ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu
- fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt
- mollit anim id est laborum.
- <br/>
- Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et
- dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip
- ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu
- fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt
- mollit anim id est laborum.
- <br/>
- Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et
- dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip
- ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu
- fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt
- mollit anim id est laborum.
- <br/>
- Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et
- dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip
- ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu
- fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt
- mollit anim id est laborum.
- <br/>
- Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et
- dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip
- ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu
- fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt
- mollit anim id est laborum.
- <br/>
- </div>
+ <h2 class="title">Demo Page Title</h2>
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et
+ dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip
+ ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu
+ fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt
+ mollit anim id est laborum.
+ <br/>
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et
+ dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip
+ ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu
+ fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt
+ mollit anim id est laborum.
+ <br/>
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et
+ dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip
+ ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu
+ fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt
+ mollit anim id est laborum.
+ <br/>
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et
+ dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip
+ ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu
+ fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt
+ mollit anim id est laborum.
+ <br/>
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et
+ dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip
+ ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu
+ fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt
+ mollit anim id est laborum.
+ <br/>
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et
+ dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip
+ ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu
+ fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt
+ mollit anim id est laborum.
+ <br/>
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et
+ dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip
+ ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu
+ fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt
+ mollit anim id est laborum.
+ <br/>
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et
+ dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip
+ ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu
+ fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt
+ mollit anim id est laborum.
+ <br/>
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et
+ dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip
+ ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu
+ fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt
+ mollit anim id est laborum.
+ <br/>
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et
+ dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip
+ ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu
+ fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt
+ mollit anim id est laborum.
+ <br/>
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et
+ dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip
+ ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu
+ fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt
+ mollit anim id est laborum.
+ <br/>
+ </div>
</portal:page>
</div>