Author: wesleyhales
Date: 2008-03-03 17:32:07 -0500 (Mon, 03 Mar 2008)
New Revision: 10185
Added:
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/eventdebug.jsp
modules/portlet/trunk/samples/src/assemble/samples-eventdebug-portlet.xml
modules/portlet/trunk/samples/src/main/artifacts/eventdebug-portlet-war/
modules/portlet/trunk/samples/src/main/artifacts/eventdebug-portlet-war/WEB-INF/
modules/portlet/trunk/samples/src/main/artifacts/eventdebug-portlet-war/WEB-INF/portlet.xml
modules/portlet/trunk/samples/src/main/artifacts/eventdebug-portlet-war/WEB-INF/web.xml
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventA.java
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventB.java
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventC.java
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventPortletA.java
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventPortletB.java
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventPortletC.java
Modified:
modules/portlet/trunk/portal/src/build.xml
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/layouts/nav/main.jsp
modules/portlet/trunk/samples/pom.xml
Log:
initial event debugger demo
Modified: modules/portlet/trunk/portal/src/build.xml
===================================================================
--- modules/portlet/trunk/portal/src/build.xml 2008-03-03 21:23:00 UTC (rev 10184)
+++ modules/portlet/trunk/portal/src/build.xml 2008-03-03 22:32:07 UTC (rev 10185)
@@ -1009,6 +1009,7 @@
<fileset dir="${samples.tmp.dir}/samples-basic-war"/>
</jar>
+
</target>
</project>
\ No newline at end of file
Added:
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/eventdebug.jsp
===================================================================
--- modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/eventdebug.jsp
(rev 0)
+++
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/eventdebug.jsp 2008-03-03
22:32:07 UTC (rev 10185)
@@ -0,0 +1,23 @@
+<%@ page contentType="text/html" %>
+<%@ page language="java" %>
+<%@ taglib prefix="jbp" tagdir="/WEB-INF/tags/portal" %>
+<%@ taglib uri="/WEB-INF/portal.tld" prefix="portal" %>
+<%@ page isELIgnored="false" %>
+
+<%@ include file="/layouts/header.jsp" %>
+
+<portal:page>
+
+
+ <jbp:layout1>
+ <jsp:attribute name="leftcol">
+ <jbp:portlet name="portletA"
applicationName="samples-eventdebug-portlet" id="portlet-A"/>
+ </jsp:attribute>
+ <jsp:attribute name="rightcol">
+ <jbp:portlet name="portletB"
applicationName="samples-eventdebug-portlet" id="portlet-B"/>
+ <jbp:portlet name="portletC"
applicationName="samples-eventdebug-portlet" id="portlet-C"/>
+ </jsp:attribute>
+
+ </jbp:layout1>
+</portal:page>
+<%@ include file="/layouts/footer.jsp" %>
\ No newline at end of file
Modified:
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/layouts/nav/main.jsp
===================================================================
---
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/layouts/nav/main.jsp 2008-03-03
21:23:00 UTC (rev 10184)
+++
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/layouts/nav/main.jsp 2008-03-03
22:32:07 UTC (rev 10185)
@@ -31,6 +31,9 @@
<li>
<a href="${pageContext.request.contextPath}/demo/demo3.jsp"
class="${fn:substringAfter(pageContext.request.servletPath, 'demo/') ==
'demo3.jsp' ? 'selected' : ''}">Demo3</a>
</li>
+ <li>
+ <a href="${pageContext.request.contextPath}/demo/eventdebug.jsp"
class="${fn:substringAfter(pageContext.request.servletPath, 'demo/') ==
'eventdebug.jsp' ? 'selected' : ''}">Event
Debug</a>
+ </li>
</ul>
<br class="clear"/>
</div>
Modified: modules/portlet/trunk/samples/pom.xml
===================================================================
--- modules/portlet/trunk/samples/pom.xml 2008-03-03 21:23:00 UTC (rev 10184)
+++ modules/portlet/trunk/samples/pom.xml 2008-03-03 22:32:07 UTC (rev 10185)
@@ -34,6 +34,7 @@
<descriptor>src/assemble/samples-google-portlet.xml</descriptor>
<descriptor>src/assemble/samples-remotecontroller-portlet.xml</descriptor>
<descriptor>src/assemble/samples-jsp-portlet.xml</descriptor>
+
<descriptor>src/assemble/samples-eventdebug-portlet.xml</descriptor>
</descriptors>
</configuration>
</plugin>
Added: modules/portlet/trunk/samples/src/assemble/samples-eventdebug-portlet.xml
===================================================================
--- modules/portlet/trunk/samples/src/assemble/samples-eventdebug-portlet.xml
(rev 0)
+++ modules/portlet/trunk/samples/src/assemble/samples-eventdebug-portlet.xml 2008-03-03
22:32:07 UTC (rev 10185)
@@ -0,0 +1,22 @@
+<assembly>
+ <id>eventdebug-portlet</id>
+ <formats>
+ <format>war</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <fileSets>
+ <fileSet>
+ <directory>src/main/artifacts/eventdebug-portlet-war</directory>
+ <outputDirectory></outputDirectory>
+ </fileSet>
+ <fileSet>
+ <directory>target/classes</directory>
+ <outputDirectory>WEB-INF/classes</outputDirectory>
+ <includes>
+ <include>org/jboss/portal/portlet/samples/eventdebug/**</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+
+</assembly>
\ No newline at end of file
Added:
modules/portlet/trunk/samples/src/main/artifacts/eventdebug-portlet-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/samples/src/main/artifacts/eventdebug-portlet-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/samples/src/main/artifacts/eventdebug-portlet-war/WEB-INF/portlet.xml 2008-03-03
22:32:07 UTC (rev 10185)
@@ -0,0 +1,108 @@
+<?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>Event Portlet A</description>
+ <portlet-name>portletA</portlet-name>
+ <display-name>Debug Portlet A</display-name>
+
<portlet-class>org.jboss.portal.portlet.samples.eventdebug.EventPortletA</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Debug Event A</title>
+ <keywords>sample,event</keywords>
+ </portlet-info>
+ <supported-publishing-event>
+ <qname
xmlns:jbp='urn:jboss:portal:samples:eventb'>jbp:EventB</qname>
+ </supported-publishing-event>
+ <supported-processing-event>
+ <qname
xmlns:jbp='urn:jboss:portal:samples:eventb'>jbp:EventB</qname>
+ </supported-processing-event>
+ <supported-processing-event>
+ <qname
xmlns:jbp='urn:jboss:portal:samples:eventa'>jbp:EventA</qname>
+ </supported-processing-event>
+ </portlet>
+
+ <portlet>
+ <description>Event Portlet B</description>
+ <portlet-name>portletB</portlet-name>
+ <display-name>Debug Portlet B</display-name>
+
<portlet-class>org.jboss.portal.portlet.samples.eventdebug.EventPortletB</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Debug Event B</title>
+ <keywords>sample,event</keywords>
+ </portlet-info>
+ <supported-publishing-event>
+ <qname
xmlns:jbp='urn:jboss:portal:samples:eventa'>jbp:EventA</qname>
+ </supported-publishing-event>
+ <supported-processing-event>
+ <qname
xmlns:jbp='urn:jboss:portal:samples:eventb'>jbp:EventB</qname>
+ </supported-processing-event>
+ </portlet>
+
+ <portlet>
+ <description>Event Portlet C</description>
+ <portlet-name>portletC</portlet-name>
+ <display-name>Debug Portlet C</display-name>
+
<portlet-class>org.jboss.portal.portlet.samples.eventdebug.EventPortletC</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Debug Event C</title>
+ <keywords>sample,event</keywords>
+ </portlet-info>
+ <supported-publishing-event>
+ <qname
xmlns:jbp='urn:jboss:portal:samples:eventb'>jbp:EventB</qname>
+ </supported-publishing-event>
+ <supported-processing-event>
+ <qname
xmlns:jbp='urn:jboss:portal:samples:eventb'>jbp:EventB</qname>
+ </supported-processing-event>
+ </portlet>
+
+ <event-definition>
+ <qname
xmlns:jbp='urn:jboss:portal:samples:eventa'>jbp:EventA</qname>
+
<value-type>org.jboss.portal.portlet.samples.eventdebug.EventA</value-type>
+ </event-definition>
+ <event-definition>
+ <qname
xmlns:jbp='urn:jboss:portal:samples:eventb'>jbp:EventB</qname>
+
<value-type>org.jboss.portal.portlet.samples.eventdebug.EventB</value-type>
+ </event-definition>
+ <event-definition>
+ <qname
xmlns:jbp='urn:jboss:portal:samples:eventc'>jbp:EventC</qname>
+
<value-type>org.jboss.portal.portlet.samples.eventdebug.EventC</value-type>
+ </event-definition>
+</portlet-app>
+
Added:
modules/portlet/trunk/samples/src/main/artifacts/eventdebug-portlet-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/samples/src/main/artifacts/eventdebug-portlet-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/samples/src/main/artifacts/eventdebug-portlet-war/WEB-INF/web.xml 2008-03-03
22:32:07 UTC (rev 10185)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<web-app version="2.4"
+
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+</web-app>
Added:
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventA.java
===================================================================
---
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventA.java
(rev 0)
+++
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventA.java 2008-03-03
22:32:07 UTC (rev 10185)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, 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.portlet.samples.eventdebug;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.namespace.QName;
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:whales@redhat.com">Wesley Hales</a>
+ * @version $Revision: 630 $
+ */
+@XmlRootElement
+public class EventA implements Serializable
+{
+ private String id;
+
+ public static final QName QNAME = new
QName("urn:jboss:portal:samples:eventa", "EventA");
+
+ public EventA(String id)
+ {
+ this.id = id;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+}
Added:
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventB.java
===================================================================
---
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventB.java
(rev 0)
+++
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventB.java 2008-03-03
22:32:07 UTC (rev 10185)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, 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.portlet.samples.eventdebug;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.namespace.QName;
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:whales@redhat.com">Wesley Hales</a>
+ * @version $Revision: 630 $
+ */
+@XmlRootElement
+public class EventB implements Serializable
+{
+ private String id;
+
+ public static final QName QNAME = new
QName("urn:jboss:portal:samples:eventb", "EventB");
+
+ public EventB(String id)
+ {
+ this.id = id;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+}
Added:
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventC.java
===================================================================
---
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventC.java
(rev 0)
+++
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventC.java 2008-03-03
22:32:07 UTC (rev 10185)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, 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.portlet.samples.eventdebug;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.namespace.QName;
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:whales@redhat.com">Wesley Hales</a>
+ * @version $Revision: 630 $
+ */
+@XmlRootElement
+public class EventC implements Serializable
+{
+ private String id;
+
+ public static final QName QNAME = new
QName("urn:jboss:portal:samples:eventc", "EventC");
+
+ public EventC(String id)
+ {
+ this.id = id;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+}
Added:
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventPortletA.java
===================================================================
---
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventPortletA.java
(rev 0)
+++
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventPortletA.java 2008-03-03
22:32:07 UTC (rev 10185)
@@ -0,0 +1,111 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, 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.portlet.samples.eventdebug;
+
+import javax.portlet.GenericPortlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.Event;
+import javax.portlet.PortletURL;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.EventPortlet;
+import javax.portlet.ResourceURL;
+import javax.xml.namespace.QName;
+import java.util.List;
+import java.util.ArrayList;
+import java.io.IOException;
+import java.io.Writer;
+import java.io.PrintWriter;
+
+/**
+ * @author <a href="mailto:whales@redhat.com">Wesley Hales</a>
+ * @version $Revision: 630 $
+ */
+public class EventPortletA extends GenericPortlet
+{
+
+ @Override
+ protected void doView(RenderRequest renderRequest, RenderResponse renderResponse)
throws PortletException, IOException
+ {
+ renderResponse.setContentType("text/html");
+ Writer writer = renderResponse.getWriter();
+ PortletURL addURL = renderResponse.createActionURL();
+ addURL.setParameter("id", "B");
+
+ writer.append("<a
href='").append(addURL.toString()).append("'\">Dispatch Event
B</a></td></tr>");
+
+ }
+
+ @Override
+ public void processAction(ActionRequest actionRequest, ActionResponse actionResponse)
throws PortletException, IOException
+ {
+ String value = actionRequest.getParameter("id");
+ if (value != null){
+ actionResponse.setEvent(EventB.QNAME, new EventB(value));
+ }
+
+ }
+
+
+ @Override
+ public void processEvent(EventRequest eventRequest, EventResponse eventResponse)
throws PortletException, IOException
+ {
+ Event event = eventRequest.getEvent();
+ System.out.println("------------a----" + event.getName());
+ if (event.getName().equals("EventA"))
+ {
+ EventA eventA = (EventA)event.getValue();
+ System.out.println("------------a---eventA-" + eventA);
+ //eventA.getId();
+ }
+ if (event.getName().equals("EventB"))
+ {
+ EventB eventB = (EventB)event.getValue();
+ System.out.println("-------------a--eventB-" + eventB);
+ //eventB.getId();
+ }
+ if (event.getName().equals("EventC"))
+ {
+ EventC eventC = (EventC)event.getValue();
+ //eventC.getId();
+ }
+ }
+
+ public void render(RenderRequest req, RenderResponse resp) throws PortletException,
IOException
+ {
+ ResourceURL resourceURL = resp.createResourceURL();
+ PortletURL actionURL = resp.createActionURL();
+
+ resp.setContentType("text/html");
+ PrintWriter writer = resp.getWriter();
+ writer.print("");
+ resourceURL.setParameter("prodId","1");
+ writer.print("<a href=\"javascript: browse(\'" +
resourceURL + "\');\">Product 1</a><br/>");
+
+
+ }
+}
Added:
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventPortletB.java
===================================================================
---
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventPortletB.java
(rev 0)
+++
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventPortletB.java 2008-03-03
22:32:07 UTC (rev 10185)
@@ -0,0 +1,92 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, 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.portlet.samples.eventdebug;
+
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.Event;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletURL;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.EventPortlet;
+import javax.xml.namespace.QName;
+import java.io.IOException;
+import java.io.Writer;
+
+/**
+ * @author <a href="mailto:whales@redhat.com">Wesley Hales</a>
+ * @version $Revision: 630 $
+ */
+public class EventPortletB extends GenericPortlet
+{
+
+ @Override
+ protected void doView(RenderRequest renderRequest, RenderResponse renderResponse)
throws PortletException, IOException
+ {
+ renderResponse.setContentType("text/html");
+ Writer writer = renderResponse.getWriter();
+ PortletURL addURL = renderResponse.createActionURL();
+ addURL.setParameter("id", "A");
+
+ writer.append("<a
href='").append(addURL.toString()).append("'\">Dispatch Event
A</a></td></tr>");
+
+ }
+
+ @Override
+ public void processAction(ActionRequest actionRequest, ActionResponse actionResponse)
throws PortletException, IOException
+ {
+ String value = actionRequest.getParameter("id");
+ if (value != null){
+ actionResponse.setEvent(EventA.QNAME, new EventA(value));
+ }
+
+ }
+
+ @Override
+ public void processEvent(EventRequest eventRequest, EventResponse eventResponse)
throws PortletException, IOException
+ {
+ Event event = eventRequest.getEvent();
+ System.out.println("------------b----" + event.getName());
+ if (event.getName().equals("EventA"))
+ {
+ EventA eventA = (EventA)event.getValue();
+ System.out.println("------------b---eventA-" + eventA);
+ //eventA.getId();
+ }
+ if (event.getName().equals("EventB"))
+ {
+ EventB eventB = (EventB)event.getValue();
+ System.out.println("------------b---eventB-" + eventB);
+ //eventB.getId();
+ }
+ if (event.getName().equals("EventC"))
+ {
+ EventC eventC = (EventC)event.getValue();
+ //eventC.getId();
+ }
+ }
+}
Added:
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventPortletC.java
===================================================================
---
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventPortletC.java
(rev 0)
+++
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventPortletC.java 2008-03-03
22:32:07 UTC (rev 10185)
@@ -0,0 +1,92 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, 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.portlet.samples.eventdebug;
+
+import javax.portlet.GenericPortlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.Event;
+import javax.portlet.PortletURL;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.EventPortlet;
+import java.io.IOException;
+import java.io.Writer;
+
+/**
+ * @author <a href="mailto:whales@redhat.com">Wesley Hales</a>
+ * @version $Revision: 630 $
+ */
+public class EventPortletC extends GenericPortlet
+{
+
+ @Override
+ protected void doView(RenderRequest renderRequest, RenderResponse renderResponse)
throws PortletException, IOException
+ {
+ renderResponse.setContentType("text/html");
+ Writer writer = renderResponse.getWriter();
+ PortletURL addURL = renderResponse.createActionURL();
+ addURL.setParameter("id", "B");
+
+ writer.append("<a
href='").append(addURL.toString()).append("'\">Dispatch Event
B</a></td></tr>");
+
+ }
+
+ @Override
+ public void processAction(ActionRequest actionRequest, ActionResponse actionResponse)
throws PortletException, IOException
+ {
+ String value = actionRequest.getParameter("id");
+ if (value != null){
+ actionResponse.setEvent(EventB.QNAME, new EventB(value));
+ }
+
+ }
+
+
+ @Override
+ public void processEvent(EventRequest eventRequest, EventResponse eventResponse)
throws PortletException, IOException
+ {
+ Event event = eventRequest.getEvent();
+ System.out.println("------------c----" + event.getName());
+ if (event.getName().equals("EventA"))
+ {
+ EventA eventA = (EventA)event.getValue();
+ System.out.println("-------------c--eventA-" + eventA);
+ //eventA.getId();
+ }
+ if (event.getName().equals("EventB"))
+ {
+ EventB eventB = (EventB)event.getValue();
+ System.out.println("-------------c--eventB-" + eventB);
+ //eventB.getId();
+ }
+ if (event.getName().equals("EventC"))
+ {
+ EventC eventC = (EventC)event.getValue();
+ //eventC.getId();
+ }
+ }
+}