Author: bdaw
Date: 2007-05-01 04:51:15 -0400 (Tue, 01 May 2007)
New Revision: 7159
Added:
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/event/
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/event/view.jsp
trunk/samples/src/main/org/jboss/samples/portlet/event/
trunk/samples/src/main/org/jboss/samples/portlet/event/EventPortlet.java
Modified:
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/default-object.xml
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet-instances.xml
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet.xml
Log:
- make Page Event sample page verbose on whats happening there.
Modified: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/default-object.xml
===================================================================
---
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/default-object.xml 2007-05-01
05:52:03 UTC (rev 7158)
+++
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/default-object.xml 2007-05-01
08:51:15 UTC (rev 7159)
@@ -107,38 +107,38 @@
<page-name>page event test</page-name>
<listener>window_event_listener</listener>
<window>
- <window-name>CatalogPortletWindow1</window-name>
- <instance-ref>CatalogPortletInstance</instance-ref>
+ <window-name>EventPortletWindow1</window-name>
+ <instance-ref>EventPortletInstance</instance-ref>
<region>left</region>
<height>0</height>
</window>
<window>
- <window-name>CatalogPortletWindow2</window-name>
- <instance-ref>CatalogPortletInstance</instance-ref>
+ <window-name>EventPortletWindow2</window-name>
+ <instance-ref>EventPortletInstance</instance-ref>
<region>left</region>
<height>1</height>
</window>
<window>
- <window-name>CatalogPortletWindow3</window-name>
- <instance-ref>CatalogPortletInstance</instance-ref>
+ <window-name>EventPortletWindow3</window-name>
+ <instance-ref>EventPortletInstance</instance-ref>
<region>left</region>
<height>2</height>
</window>
<window>
- <window-name>CatalogPortletWindow4</window-name>
- <instance-ref>CatalogPortletInstance</instance-ref>
+ <window-name>EventPortletWindow4</window-name>
+ <instance-ref>EventPortletInstance</instance-ref>
<region>center</region>
<height>0</height>
</window>
<window>
- <window-name>CatalogPortletWindow5</window-name>
- <instance-ref>CatalogPortletInstance</instance-ref>
+ <window-name>EventPortletWindow5</window-name>
+ <instance-ref>EventPortletInstance</instance-ref>
<region>center</region>
<height>1</height>
</window>
<window>
- <window-name>CatalogPortletWindow6</window-name>
- <instance-ref>CatalogPortletInstance</instance-ref>
+ <window-name>EventPortletWindow6</window-name>
+ <instance-ref>EventPortletInstance</instance-ref>
<region>center</region>
<height>2</height>
</window>
Added: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/event/view.jsp
===================================================================
--- trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/event/view.jsp
(rev 0)
+++
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/event/view.jsp 2007-05-01
08:51:15 UTC (rev 7159)
@@ -0,0 +1,41 @@
+<%@ page import="org.jboss.portal.server.PortalConstants" %>
+<%--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+~ 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. ~
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--%>
+
+<%@ taglib
uri="http://java.sun.com/portlet" prefix="portlet"
%>
+<%@ page isELIgnored="false" %>
+
+<portlet:defineObjects/>
+
+<table border="0" cellspacing="2" cellpadding="2">
+ <tr>
+ <td class="portlet-section-alternate">
+ <font class="portlet-font">This is simple showcase of Portal
Node Event Listener. For this portal page it ensures
+ that in every column, only one portlet window is in <b>NORMAL</b>
state. Try to change window state of other
+ portlets and see what happens. To learn more read <b>InterPortlet
Communication (IPC)</b> chapter in
+ <b>JBoss Portal Reference Guide</b>, or check source code of
+
<i><b>org.jboss.portal.core.portlet.test.event.WindowConstraintEventListener</b></i>
class .
+ </font>
+ </td>
+ </tr>
+</table>
Modified:
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet-instances.xml
===================================================================
---
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet-instances.xml 2007-05-01
05:52:03 UTC (rev 7158)
+++
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet-instances.xml 2007-05-01
08:51:15 UTC (rev 7159)
@@ -35,6 +35,12 @@
</deployment>
<deployment>
<instance>
+ <instance-id>EventPortletInstance</instance-id>
+ <portlet-ref>EventPortlet</portlet-ref>
+ </instance>
+ </deployment>
+ <deployment>
+ <instance>
<instance-id>NewsPortletInstance</instance-id>
<portlet-ref>NewsPortlet</portlet-ref>
</instance>
Modified: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet.xml
===================================================================
--- trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet.xml 2007-05-01
05:52:03 UTC (rev 7158)
+++ trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet.xml 2007-05-01
08:51:15 UTC (rev 7159)
@@ -42,6 +42,20 @@
</portlet-info>
</portlet>
<portlet>
+ <description>Simple Portlet</description>
+ <portlet-name>EventPortlet</portlet-name>
+ <display-name>Event Portlet</display-name>
+
<portlet-class>org.jboss.samples.portlet.event.EventPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Portal Node Event Listener</title>
+ <keywords>event, sample,test</keywords>
+ </portlet-info>
+ </portlet>
+ <portlet>
<description>Portlet to test modification of head
content</description>
<portlet-name>HeaderContentPortlet</portlet-name>
<display-name>Header Content Portlet</display-name>
Added: trunk/samples/src/main/org/jboss/samples/portlet/event/EventPortlet.java
===================================================================
--- trunk/samples/src/main/org/jboss/samples/portlet/event/EventPortlet.java
(rev 0)
+++ trunk/samples/src/main/org/jboss/samples/portlet/event/EventPortlet.java 2007-05-01
08:51:15 UTC (rev 7159)
@@ -0,0 +1,47 @@
+/*
+* 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.samples.portlet.event;
+
+import org.jboss.samples.portlet.jsp.JSPPortlet;
+
+import javax.portlet.GenericPortlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.UnavailableException;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:roy@jboss.org">Roy Russo</a>
+ */
+public class EventPortlet extends GenericPortlet
+{
+ private static final String JSP_PATH = "/WEB-INF/jsp/event";
+
+ protected void doView(RenderRequest rRequest, RenderResponse rResponse) throws
PortletException, IOException, UnavailableException
+ {
+ rResponse.setContentType("text/html");
+ javax.portlet.PortletRequestDispatcher pRD =
this.getPortletContext().getRequestDispatcher(JSP_PATH + "/view.jsp");
+ pRD.include(rRequest, rResponse);
+ }
+}