Author: julien(a)jboss.com
Date: 2008-02-09 20:17:56 -0500 (Sat, 09 Feb 2008)
New Revision: 9912
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/GoogleClippingPortlet.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/GoogleWeatherClippingPortlet.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/RemoteControlResourcePortlet.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CartEvent.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CartPortlet.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/Catalog.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CatalogItem.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CatalogPortlet.java
modules/portlet/trunk/test/src/test/resources/portal/samples/cart-event-portlet-war/
modules/portlet/trunk/test/src/test/resources/portal/samples/cart-event-portlet-war/WEB-INF/
modules/portlet/trunk/test/src/test/resources/portal/samples/google-map-portlet-war/
modules/portlet/trunk/test/src/test/resources/portal/samples/google-map-portlet-war/WEB-INF/
modules/portlet/trunk/test/src/test/resources/portal/samples/google-weather-portlet-war/
modules/portlet/trunk/test/src/test/resources/portal/samples/google-weather-portlet-war/WEB-INF/
modules/portlet/trunk/test/src/test/resources/portal/samples/remotecontrol-portlet-war/
modules/portlet/trunk/test/src/test/resources/portal/samples/remotecontrol-portlet-war/WEB-INF/
Removed:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CartEvent.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CartPortlet.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/Catalog.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CatalogItem.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CatalogPortlet.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/GoogleClippingPortlet.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/GoogleWeatherClippingPortlet.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/RemoteControlResourcePortlet.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/
modules/portlet/trunk/test/src/test/resources/cart-event-portlet-war/
modules/portlet/trunk/test/src/test/resources/google-map-portlet-war/
modules/portlet/trunk/test/src/test/resources/google-weather-portlet-war/
modules/portlet/trunk/test/src/test/resources/portal/samples/cart-event-portlet-war/WEB-INF/
modules/portlet/trunk/test/src/test/resources/portal/samples/google-map-portlet-war/WEB-INF/
modules/portlet/trunk/test/src/test/resources/portal/samples/google-weather-portlet-war/WEB-INF/
modules/portlet/trunk/test/src/test/resources/portal/samples/remotecontrol-portlet-war/WEB-INF/
modules/portlet/trunk/test/src/test/resources/remotecontrol-portlet-war/
Modified:
modules/portlet/trunk/test/src/test/build.xml
modules/portlet/trunk/test/src/test/resources/portal/samples/cart-event-portlet-war/WEB-INF/portlet.xml
modules/portlet/trunk/test/src/test/resources/portal/samples/google-map-portlet-war/WEB-INF/portlet.xml
modules/portlet/trunk/test/src/test/resources/portal/samples/google-weather-portlet-war/WEB-INF/portlet.xml
modules/portlet/trunk/test/src/test/resources/portal/samples/remotecontrol-portlet-war/WEB-INF/portlet.xml
modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo.jsp
modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo1.jsp
modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo2.jsp
Log:
- moved stuff for more consistency but had to merge with changes so it may be f. up, will
clean up just after
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/GoogleClippingPortlet.java
(from rev 9905,
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/GoogleClippingPortlet.java)
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/GoogleClippingPortlet.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/GoogleClippingPortlet.java 2008-02-10
01:17:56 UTC (rev 9912)
@@ -0,0 +1,178 @@
+/******************************************************************************
+ * 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.portlet.portal.samples;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletPreferences;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.BufferedInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.net.URL;
+import java.net.URLConnection;
+
+/**
+ * A simple portlet using Google's search services to extract interesting information
(weather, map, ...) from first
+ * result.
+ *
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class GoogleClippingPortlet extends GenericPortlet
+{
+ protected static final String A = "<a";
+ private static final String A_TARGET_BLANK = "<a
target='_blank'";
+ private static final String ZIP = "zipcode";
+ private static final String SAN_FRAN = "94102";
+ private static final String GOOGLE = "http://www.google.com/search?q=";
+
+ @Override
+ protected void doView(RenderRequest renderRequest, RenderResponse renderResponse)
throws PortletException, IOException
+ {
+ String zip = getZipCode(renderRequest);
+
+ String query = getQueryString(zip);
+
+ URL url = new URL(query);
+
+ URLConnection connection = url.openConnection();
+ connection.setRequestProperty("User-Agent", "Mozilla/5.0");
+
+ BufferedInputStream in = new BufferedInputStream(connection.getInputStream());
+ String html = new String(getBytes(in, 16384), "UTF-8");
+ in.close();
+
+ String beg = "<div class=e>";
+ String end = "</table>";
+ int begIndex = html.indexOf(beg);
+ if (begIndex != -1)
+ {
+ // extract table containing specific first result
+ int endIndex = html.indexOf(end, begIndex);
+ html = html.substring(begIndex + beg.length(), endIndex + end.length());
+
+ html = postProcessHTML(html);
+
+ renderResponse.setContentType("text/html");
+ PrintWriter printWriter = renderResponse.getWriter();
+ printWriter.print(html);
+ }
+ }
+
+ protected String getZipCode(RenderRequest renderRequest)
+ {
+ String zip = renderRequest.getParameter(ZIP);
+ if (zip == null)
+ {
+ zip = renderRequest.getPreferences().getValue(ZIP, SAN_FRAN);
+ }
+ return zip;
+ }
+
+ @Override
+ protected void doEdit(RenderRequest renderRequest, RenderResponse renderResponse)
throws PortletException, IOException
+ {
+ renderResponse.setContentType("text/html");
+ renderResponse.getWriter().print(
+ "<div align='center'>\n" +
+ " <br/>\n" +
+ " <font class='portlet-font'>Change
Location:</font>\n" +
+ "\n" +
+ " <form method='post' action='" +
renderResponse.createActionURL() + "'\n" +
+ " <font class='portlet-font'>Zip
Code:</font><br/>\n" +
+ " <input class='portlet-form-input-field'
type='text' value='' size='12' name='" + ZIP +
"'/>\n" +
+ " <br/>\n" +
+ " <input class='portlet-form-input-field'
type='submit' name='submit' value='submit'>\n" +
+ " </form>\n" +
+ "</div>");
+ }
+
+ @Override
+ public void processAction(ActionRequest actionRequest, ActionResponse actionResponse)
throws PortletException, IOException
+ {
+ String zip = actionRequest.getParameter(ZIP);
+
+ if (null != zip)
+ {
+ PortletPreferences prefs = actionRequest.getPreferences();
+ prefs.setValue(ZIP, zip);
+ prefs.store();
+ }
+
+ // set zip as render parameter
+ actionResponse.setRenderParameter(ZIP, zip);
+
+ // request view
+ actionResponse.setPortletMode(PortletMode.VIEW);
+ }
+
+ protected String postProcessHTML(String html)
+ {
+ // links should open in new windows
+ html = html.replaceAll(A, A_TARGET_BLANK);
+
+ // src attributes should be absolute
+ html = html.replaceAll("src=/", "src=http://google.com/");
+ html = html.replaceAll("src=\"/",
"src=\"http://google.com/");
+
+ // forms should open in new windows and have an absolute action URL
+ html = html.replaceAll("action=\"/", "target='_blank'
action=\"http://google.com/");
+
+ return html;
+ }
+
+ protected String getQueryString(String zip)
+ {
+ return GOOGLE + zip;
+ }
+
+ private byte[] getBytes(InputStream in, int bufferSize) throws IOException,
IllegalArgumentException
+ {
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+
+ byte[] buffer = new byte[bufferSize];
+ while (true)
+ {
+ int i = in.read(buffer);
+ if (i == 0)
+ {
+ continue;
+ }
+ if (i == -1)
+ {
+ break;
+ }
+ out.write(buffer, 0, i);
+ }
+ return out.toByteArray();
+ }
+
+}
Property changes on:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/GoogleClippingPortlet.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/GoogleWeatherClippingPortlet.java
(from rev 9905,
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/GoogleWeatherClippingPortlet.java)
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/GoogleWeatherClippingPortlet.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/GoogleWeatherClippingPortlet.java 2008-02-10
01:17:56 UTC (rev 9912)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.portlet.portal.samples;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class GoogleWeatherClippingPortlet extends GoogleClippingPortlet
+{
+ private final static String WEATHER_URL =
"http://www.google.com/search?q=weather+";
+ private static final String A_END = "</a>";
+
+ protected String getQueryString(String zip)
+ {
+ return WEATHER_URL + zip;
+ }
+
+ protected String postProcessHTML(String html)
+ {
+ int begIndex;
+ int endIndex;
+
+ // remove add to iGoogle link
+ begIndex = html.indexOf(A);
+ if (begIndex != -1)
+ {
+ endIndex = html.indexOf(A_END, begIndex);
+ html = html.substring(0, begIndex) + html.substring(endIndex + A_END.length());
+ }
+
+ return super.postProcessHTML(html);
+ }
+}
Property changes on:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/GoogleWeatherClippingPortlet.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/RemoteControlResourcePortlet.java
(from rev 9905,
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/RemoteControlResourcePortlet.java)
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/RemoteControlResourcePortlet.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/RemoteControlResourcePortlet.java 2008-02-10
01:17:56 UTC (rev 9912)
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2008, Your Corporation. All Rights Reserved.
+ */
+
+package org.jboss.portal.portlet.portal.samples;
+
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+import javax.portlet.ResourceURL;
+import javax.portlet.WindowState;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class RemoteControlResourcePortlet extends GenericPortlet
+{
+ private static final String ZIPCODE = "zipcode";
+
+ @Override
+ protected void doView(RenderRequest renderRequest, RenderResponse renderResponse)
throws PortletException, IOException
+ {
+ renderResponse.setContentType("text/html");
+ PrintWriter printWriter = renderResponse.getWriter();
+ printWriter.print("<script type='text/javascript'>function
openRemote(url){window.name='jbp_parent';" +
+ "window.open(url, 'jbp_remote',
'width=400,height=200,scrollable=yes')}</script>");
+ printWriter.print("<p><a href='#'
onclick=\"openRemote('");
+ ResourceURL resource = renderResponse.createResourceURL();
+ printWriter.print(resource);
+ printWriter.print("')\">Open remote
control!</a></p>");
+ }
+
+ @Override
+ public void serveResource(ResourceRequest resourceRequest, ResourceResponse
resourceResponse) throws PortletException, IOException
+ {
+ resourceResponse.setContentType("text/html");
+ PrintWriter writer = resourceResponse.getWriter();
+ writer.print("<script type='text/javascript'>function
openLinkInParent(url){window.open(url,'jbp_parent');}</script>");
+ PortletURL url = resourceResponse.createRenderURL();
+ url.setWindowState(WindowState.MINIMIZED);
+ writer.print("<ul><li><a href='#' onclick=\""
+ createParentURL(url) + "\">minimize parent
portlet</a></li>");
+ url.setWindowState(WindowState.MAXIMIZED);
+ writer.print("<li><a href='#' onclick=\"" +
createParentURL(url) + "\">maximize parent
portlet</a></li>");
+ url.setWindowState(WindowState.NORMAL);
+ writer.print("<li><a href='#' onclick=\"" +
createParentURL(url) + "\">make parent portlet
normal</a></li></ul>");
+ writer.print("<p><b>'zipcode'</b> public render
parameter value: " + resourceRequest.getParameter(ZIPCODE) +
"<br/>");
+ writer.print("Set value of <b>'zipcode'</b> public render
parameter to:</p>");
+ url.setParameter(ZIPCODE, "80201");
+ writer.print("<ul><li><a href='#' onclick=\""
+ createParentURL(url) + "\">Denver</a>");
+ url.setParameter(ZIPCODE, "94102");
+ writer.print("<li><a href='#' onclick=\"" +
createParentURL(url) + "\">San Francisco</a>");
+ url.setParameter(ZIPCODE, "20001");
+ writer.print("<li><a href='#' onclick=\"" +
createParentURL(url) + "\">Washington, DC</a>");
+ writer.print("</ul>");
+ }
+
+ private String createParentURL(PortletURL url)
+ {
+ return "openLinkInParent('" + url + "')";
+ }
+}
Property changes on:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/RemoteControlResourcePortlet.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event
(from rev 9905,
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event)
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CartEvent.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/CartEvent.java 2008-02-09
16:39:07 UTC (rev 9905)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CartEvent.java 2008-02-10
01:17:56 UTC (rev 9912)
@@ -1,50 +0,0 @@
-/******************************************************************************
- * 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;
- }
-}
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CartEvent.java
(from rev 9911,
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/portlet/portal/samples/event/CartEvent.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CartEvent.java 2008-02-10
01:17:56 UTC (rev 9912)
@@ -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.portlet.portal.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;
+ }
+}
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CartPortlet.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/CartPortlet.java 2008-02-09
16:39:07 UTC (rev 9905)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CartPortlet.java 2008-02-10
01:17:56 UTC (rev 9912)
@@ -1,82 +0,0 @@
-/******************************************************************************
- * 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()));
- }
- }
-}
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CartPortlet.java
(from rev 9911,
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/portlet/portal/samples/event/CartPortlet.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CartPortlet.java 2008-02-10
01:17:56 UTC (rev 9912)
@@ -0,0 +1,83 @@
+/******************************************************************************
+ * 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.portlet.portal.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 width='95%'><thead><tr
align='left'><th width='66%'>Description</th><th
align='right'>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><b>Total:</b></td><td
align='right' style='border-top: 2px solid #000;'>")
+ .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()));
+ }
+ }
+}
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/Catalog.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/Catalog.java 2008-02-09
16:39:07 UTC (rev 9905)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/Catalog.java 2008-02-10
01:17:56 UTC (rev 9912)
@@ -1,63 +0,0 @@
-/******************************************************************************
- * 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();
- }
-}
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/Catalog.java
(from rev 9911,
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/portlet/portal/samples/event/Catalog.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/Catalog.java 2008-02-10
01:17:56 UTC (rev 9912)
@@ -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.portlet.portal.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();
+ }
+}
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CatalogItem.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/CatalogItem.java 2008-02-09
16:39:07 UTC (rev 9905)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CatalogItem.java 2008-02-10
01:17:56 UTC (rev 9912)
@@ -1,57 +0,0 @@
-/******************************************************************************
- * 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;
- }
-}
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CatalogItem.java
(from rev 9911,
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/portlet/portal/samples/event/CatalogItem.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CatalogItem.java 2008-02-10
01:17:56 UTC (rev 9912)
@@ -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.portlet.portal.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;
+ }
+}
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CatalogPortlet.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/event/CatalogPortlet.java 2008-02-09
16:39:07 UTC (rev 9905)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CatalogPortlet.java 2008-02-10
01:17:56 UTC (rev 9912)
@@ -1,71 +0,0 @@
-/******************************************************************************
- * 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));
- }
-}
Copied:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CatalogPortlet.java
(from rev 9911,
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/portlet/portal/samples/event/CatalogPortlet.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CatalogPortlet.java 2008-02-10
01:17:56 UTC (rev 9912)
@@ -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.portlet.portal.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 width='95%'><thead><tr
align='left'><th width='50%'>Description</th><th
width='25%'>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));
+ }
+}
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/GoogleClippingPortlet.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/GoogleClippingPortlet.java 2008-02-09
20:42:01 UTC (rev 9911)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/GoogleClippingPortlet.java 2008-02-10
01:17:56 UTC (rev 9912)
@@ -1,178 +0,0 @@
-/******************************************************************************
- * 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;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.GenericPortlet;
-import javax.portlet.PortletException;
-import javax.portlet.PortletMode;
-import javax.portlet.PortletPreferences;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import java.io.BufferedInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.net.URL;
-import java.net.URLConnection;
-
-/**
- * A simple portlet using Google's search services to extract interesting information
(weather, map, ...) from first
- * result.
- *
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision$
- */
-public class GoogleClippingPortlet extends GenericPortlet
-{
- protected static final String A = "<a";
- private static final String A_TARGET_BLANK = "<a
target='_blank'";
- private static final String ZIP = "zipcode";
- private static final String SAN_FRAN = "94102";
- private static final String GOOGLE = "http://www.google.com/search?q=";
-
- @Override
- protected void doView(RenderRequest renderRequest, RenderResponse renderResponse)
throws PortletException, IOException
- {
- String zip = getZipCode(renderRequest);
-
- String query = getQueryString(zip);
-
- URL url = new URL(query);
-
- URLConnection connection = url.openConnection();
- connection.setRequestProperty("User-Agent", "Mozilla/5.0");
-
- BufferedInputStream in = new BufferedInputStream(connection.getInputStream());
- String html = new String(getBytes(in, 16384), "UTF-8");
- in.close();
-
- String beg = "<div class=e>";
- String end = "</table>";
- int begIndex = html.indexOf(beg);
- if (begIndex != -1)
- {
- // extract table containing specific first result
- int endIndex = html.indexOf(end, begIndex);
- html = html.substring(begIndex + beg.length(), endIndex + end.length());
-
- html = postProcessHTML(html);
-
- renderResponse.setContentType("text/html");
- PrintWriter printWriter = renderResponse.getWriter();
- printWriter.print(html);
- }
- }
-
- protected String getZipCode(RenderRequest renderRequest)
- {
- String zip = renderRequest.getParameter(ZIP);
- if (zip == null)
- {
- zip = renderRequest.getPreferences().getValue(ZIP, SAN_FRAN);
- }
- return zip;
- }
-
- @Override
- protected void doEdit(RenderRequest renderRequest, RenderResponse renderResponse)
throws PortletException, IOException
- {
- renderResponse.setContentType("text/html");
- renderResponse.getWriter().print(
- "<div align='center'>\n" +
- " <br/>\n" +
- " <font class='portlet-font'>Change
Location:</font>\n" +
- "\n" +
- " <form method='post' action='" +
renderResponse.createActionURL() + "'\n" +
- " <font class='portlet-font'>Zip
Code:</font><br/>\n" +
- " <input class='portlet-form-input-field'
type='text' value='' size='12' name='" + ZIP +
"'/>\n" +
- " <br/>\n" +
- " <input class='portlet-form-input-field'
type='submit' name='submit' value='submit'>\n" +
- " </form>\n" +
- "</div>");
- }
-
- @Override
- public void processAction(ActionRequest actionRequest, ActionResponse actionResponse)
throws PortletException, IOException
- {
- String zip = actionRequest.getParameter(ZIP);
-
- if (null != zip)
- {
- PortletPreferences prefs = actionRequest.getPreferences();
- prefs.setValue(ZIP, zip);
- prefs.store();
- }
-
- // set zip as render parameter
- actionResponse.setRenderParameter(ZIP, zip);
-
- // request view
- actionResponse.setPortletMode(PortletMode.VIEW);
- }
-
- protected String postProcessHTML(String html)
- {
- // links should open in new windows
- html = html.replaceAll(A, A_TARGET_BLANK);
-
- // src attributes should be absolute
- html = html.replaceAll("src=/", "src=http://google.com/");
- html = html.replaceAll("src=\"/",
"src=\"http://google.com/");
-
- // forms should open in new windows and have an absolute action URL
- html = html.replaceAll("action=\"/", "target='_blank'
action=\"http://google.com/");
-
- return html;
- }
-
- protected String getQueryString(String zip)
- {
- return GOOGLE + zip;
- }
-
- private byte[] getBytes(InputStream in, int bufferSize) throws IOException,
IllegalArgumentException
- {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
-
- byte[] buffer = new byte[bufferSize];
- while (true)
- {
- int i = in.read(buffer);
- if (i == 0)
- {
- continue;
- }
- if (i == -1)
- {
- break;
- }
- out.write(buffer, 0, i);
- }
- return out.toByteArray();
- }
-
-}
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/GoogleWeatherClippingPortlet.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/GoogleWeatherClippingPortlet.java 2008-02-09
20:42:01 UTC (rev 9911)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/GoogleWeatherClippingPortlet.java 2008-02-10
01:17:56 UTC (rev 9912)
@@ -1,55 +0,0 @@
-/******************************************************************************
- * 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;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision$
- */
-public class GoogleWeatherClippingPortlet extends GoogleClippingPortlet
-{
- private final static String WEATHER_URL =
"http://www.google.com/search?q=weather+";
- private static final String A_END = "</a>";
-
- protected String getQueryString(String zip)
- {
- return WEATHER_URL + zip;
- }
-
- protected String postProcessHTML(String html)
- {
- int begIndex;
- int endIndex;
-
- // remove add to iGoogle link
- begIndex = html.indexOf(A);
- if (begIndex != -1)
- {
- endIndex = html.indexOf(A_END, begIndex);
- html = html.substring(0, begIndex) + html.substring(endIndex + A_END.length());
- }
-
- return super.postProcessHTML(html);
- }
-}
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/RemoteControlResourcePortlet.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/RemoteControlResourcePortlet.java 2008-02-09
20:42:01 UTC (rev 9911)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/samples/RemoteControlResourcePortlet.java 2008-02-10
01:17:56 UTC (rev 9912)
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2008, Your Corporation. All Rights Reserved.
- */
-
-package org.jboss.portal.simple.samples;
-
-import javax.portlet.GenericPortlet;
-import javax.portlet.PortletException;
-import javax.portlet.PortletURL;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.ResourceRequest;
-import javax.portlet.ResourceResponse;
-import javax.portlet.ResourceURL;
-import javax.portlet.WindowState;
-import java.io.IOException;
-import java.io.PrintWriter;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision$
- */
-public class RemoteControlResourcePortlet extends GenericPortlet
-{
- private static final String ZIPCODE = "zipcode";
-
- @Override
- protected void doView(RenderRequest renderRequest, RenderResponse renderResponse)
throws PortletException, IOException
- {
- renderResponse.setContentType("text/html");
- PrintWriter printWriter = renderResponse.getWriter();
- printWriter.print("<script type='text/javascript'>function
openRemote(url){window.name='jbp_parent';" +
- "window.open(url, 'jbp_remote',
'width=400,height=200,scrollable=yes')}</script>");
- printWriter.print("<p><a href='#'
onclick=\"openRemote('");
- ResourceURL resource = renderResponse.createResourceURL();
- printWriter.print(resource);
- printWriter.print("')\">Open remote
control!</a></p>");
- }
-
- @Override
- public void serveResource(ResourceRequest resourceRequest, ResourceResponse
resourceResponse) throws PortletException, IOException
- {
- resourceResponse.setContentType("text/html");
- PrintWriter writer = resourceResponse.getWriter();
- writer.print("<script type='text/javascript'>function
openLinkInParent(url){window.open(url,'jbp_parent');}</script>");
- PortletURL url = resourceResponse.createRenderURL();
- url.setWindowState(WindowState.MINIMIZED);
- writer.print("<ul><li><a href='#' onclick=\""
+ createParentURL(url) + "\">minimize parent
portlet</a></li>");
- url.setWindowState(WindowState.MAXIMIZED);
- writer.print("<li><a href='#' onclick=\"" +
createParentURL(url) + "\">maximize parent
portlet</a></li>");
- url.setWindowState(WindowState.NORMAL);
- writer.print("<li><a href='#' onclick=\"" +
createParentURL(url) + "\">make parent portlet
normal</a></li></ul>");
- writer.print("<p><b>'zipcode'</b> public render
parameter value: " + resourceRequest.getParameter(ZIPCODE) +
"<br/>");
- writer.print("Set value of <b>'zipcode'</b> public render
parameter to:</p>");
- url.setParameter(ZIPCODE, "80201");
- writer.print("<ul><li><a href='#' onclick=\""
+ createParentURL(url) + "\">Denver</a>");
- url.setParameter(ZIPCODE, "94102");
- writer.print("<li><a href='#' onclick=\"" +
createParentURL(url) + "\">San Francisco</a>");
- url.setParameter(ZIPCODE, "20001");
- writer.print("<li><a href='#' onclick=\"" +
createParentURL(url) + "\">Washington, DC</a>");
- writer.print("</ul>");
- }
-
- private String createParentURL(PortletURL url)
- {
- return "openLinkInParent('" + url + "')";
- }
-}
Modified: modules/portlet/trunk/test/src/test/build.xml
===================================================================
--- modules/portlet/trunk/test/src/test/build.xml 2008-02-09 20:42:01 UTC (rev 9911)
+++ modules/portlet/trunk/test/src/test/build.xml 2008-02-10 01:17:56 UTC (rev 9912)
@@ -755,46 +755,48 @@
</target>
<target name="package-demo-portlets" depends="prepare_env">
- <copy todir="${test.temp.dir}/google-map-portlet-war">
- <fileset dir="src/test/resources/google-map-portlet-war"/>
- <fileset dir="${target}/classes"
includes="org/jboss/portal/simple/samples/GoogleClippingPortlet.class"/>
+
+ <mkdir dir="${test.temp.dir}/portal"/>
+ <mkdir dir="${test.temp.dir}/portal/samples"/>
+ <mkdir dir="${target}/portal"/>
+
+ <copy
todir="${test.temp.dir}/portal/samples-google-map-portlet-war">
+ <fileset
dir="src/test/resources/portal/samples/google-map-portlet-war"/>
+ <fileset dir="${target}/classes"
includes="org/jboss/portal/portlet/portal/samples/GoogleClippingPortlet.class"/>
</copy>
- <jar jarfile="${target}/google-map-portlet.war">
- <fileset dir="${test.temp.dir}/google-map-portlet-war"/>
+ <jar jarfile="${target}/portal/samples-google-map-portlet.war">
+ <fileset
dir="${test.temp.dir}/portal/samples-google-map-portlet-war"/>
</jar>
- <copy todir="${test.temp.dir}/google-weather-portlet-war">
- <fileset dir="src/test/resources/google-weather-portlet-war"/>
- <fileset dir="${target}/classes"
includes="org/jboss/portal/simple/samples/*.class"/>
+ <copy
todir="${test.temp.dir}/portal/samples-google-weather-portlet-war">
+ <fileset
dir="src/test/resources/portal/samples/google-weather-portlet-war"/>
+ <fileset dir="${target}/classes"
includes="org/jboss/portal/portlet/portal/samples/*.class"/>
</copy>
- <jar jarfile="${target}/google-weather-portlet.war">
- <fileset dir="${test.temp.dir}/google-weather-portlet-war"/>
+ <jar
jarfile="${target}/portal/samples-google-weather-portlet.war">
+ <fileset
dir="${test.temp.dir}/portal/samples-google-weather-portlet-war"/>
</jar>
- <copy todir="${test.temp.dir}/remotecontrol-portlet-war">
- <fileset dir="src/test/resources/remotecontrol-portlet-war"/>
+ <copy
todir="${test.temp.dir}/portal/samples-remotecontrol-portlet-war">
+ <fileset
dir="src/test/resources/portal/samples/remotecontrol-portlet-war"/>
<fileset dir="${target}/classes"
-
includes="org/jboss/portal/simple/samples/RemoteControlResourcePortlet.class"/>
+
includes="org/jboss/portal/portlet/portal/samples/RemoteControlResourcePortlet.class"/>
</copy>
- <jar jarfile="${target}/remotecontrol-portlet.war">
- <fileset dir="${test.temp.dir}/remotecontrol-portlet-war"/>
+ <jar jarfile="${target}/portal/samples-remotecontrol-portlet.war">
+ <fileset
dir="${test.temp.dir}/portal/samples-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
todir="${test.temp.dir}/portal/samples-cart-event-portlet-war">
+ <fileset
dir="src/test/resources/portal/samples/cart-event-portlet-war"/>
+ <fileset dir="${target}/classes"
includes="org/jboss/portal/portlet/portal/samples/event/*.class"/>
</copy>
- <jar jarfile="${target}/cart-event-portlet.war">
- <fileset dir="${test.temp.dir}/cart-event-portlet-war"/>
+ <jar jarfile="${target}/portal/samples-cart-event-portlet.war">
+ <fileset
dir="${test.temp.dir}/portal/samples-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">
<fileset dir="src/test/resources/portal/samples/basic-war"/>
<fileset dir="${target}/classes"
includes="org/jboss/portal/portlet/portal/samples/basic/**"/>
</copy>
- <mkdir dir="${target}/portal"/>
<jar jarfile="${target}/portal/samples-basic.war">
<fileset dir="${test.temp.dir}/portal/samples-basic-war"/>
</jar>
Copied:
modules/portlet/trunk/test/src/test/resources/portal/samples/cart-event-portlet-war (from
rev 9905, modules/portlet/trunk/test/src/test/resources/cart-event-portlet-war)
Copied:
modules/portlet/trunk/test/src/test/resources/portal/samples/cart-event-portlet-war/WEB-INF
(from rev 9911,
modules/portlet/trunk/test/src/test/resources/cart-event-portlet-war/WEB-INF)
Modified:
modules/portlet/trunk/test/src/test/resources/portal/samples/cart-event-portlet-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/test/src/test/resources/cart-event-portlet-war/WEB-INF/portlet.xml 2008-02-09
20:42:01 UTC (rev 9911)
+++
modules/portlet/trunk/test/src/test/resources/portal/samples/cart-event-portlet-war/WEB-INF/portlet.xml 2008-02-10
01:17:56 UTC (rev 9912)
@@ -30,7 +30,7 @@
<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>
+
<portlet-class>org.jboss.portal.portlet.portal.samples.event.CatalogPortlet</portlet-class>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
@@ -48,7 +48,7 @@
<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>
+
<portlet-class>org.jboss.portal.portlet.portal.samples.event.CartPortlet</portlet-class>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
@@ -64,7 +64,7 @@
<event-definition>
<qname
xmlns:jbp='urn:jboss:portal:samples:event'>jbp:CartEvent</qname>
-
<value-type>org.jboss.portal.simple.samples.event.CartEvent</value-type>
+
<value-type>org.jboss.portal.portlet.portal.samples.event.CartEvent</value-type>
</event-definition>
</portlet-app>
Copied:
modules/portlet/trunk/test/src/test/resources/portal/samples/google-map-portlet-war (from
rev 9905, modules/portlet/trunk/test/src/test/resources/google-map-portlet-war)
Copied:
modules/portlet/trunk/test/src/test/resources/portal/samples/google-map-portlet-war/WEB-INF
(from rev 9911,
modules/portlet/trunk/test/src/test/resources/google-map-portlet-war/WEB-INF)
Modified:
modules/portlet/trunk/test/src/test/resources/portal/samples/google-map-portlet-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/test/src/test/resources/google-map-portlet-war/WEB-INF/portlet.xml 2008-02-09
20:42:01 UTC (rev 9911)
+++
modules/portlet/trunk/test/src/test/resources/portal/samples/google-map-portlet-war/WEB-INF/portlet.xml 2008-02-10
01:17:56 UTC (rev 9912)
@@ -29,7 +29,7 @@
<description>Portlet displaying a location on Google
Maps</description>
<portlet-name>GoogleMap</portlet-name>
<display-name>Google Map Portlet</display-name>
-
<portlet-class>org.jboss.portal.simple.samples.GoogleClippingPortlet</portlet-class>
+
<portlet-class>org.jboss.portal.portlet.portal.samples.GoogleClippingPortlet</portlet-class>
<expiration-cache>120</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
Copied:
modules/portlet/trunk/test/src/test/resources/portal/samples/google-weather-portlet-war
(from rev 9905, modules/portlet/trunk/test/src/test/resources/google-weather-portlet-war)
Copied:
modules/portlet/trunk/test/src/test/resources/portal/samples/google-weather-portlet-war/WEB-INF
(from rev 9911,
modules/portlet/trunk/test/src/test/resources/google-weather-portlet-war/WEB-INF)
Modified:
modules/portlet/trunk/test/src/test/resources/portal/samples/google-weather-portlet-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/test/src/test/resources/google-weather-portlet-war/WEB-INF/portlet.xml 2008-02-09
20:42:01 UTC (rev 9911)
+++
modules/portlet/trunk/test/src/test/resources/portal/samples/google-weather-portlet-war/WEB-INF/portlet.xml 2008-02-10
01:17:56 UTC (rev 9912)
@@ -29,7 +29,7 @@
<description>Portlet displaying the weather forecast for the specified
location</description>
<portlet-name>GoogleWeather</portlet-name>
<display-name>Google Weather Portlet</display-name>
-
<portlet-class>org.jboss.portal.simple.samples.GoogleWeatherClippingPortlet</portlet-class>
+
<portlet-class>org.jboss.portal.portlet.portal.samples.GoogleWeatherClippingPortlet</portlet-class>
<expiration-cache>120</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
Copied:
modules/portlet/trunk/test/src/test/resources/portal/samples/remotecontrol-portlet-war
(from rev 9905, modules/portlet/trunk/test/src/test/resources/remotecontrol-portlet-war)
Copied:
modules/portlet/trunk/test/src/test/resources/portal/samples/remotecontrol-portlet-war/WEB-INF
(from rev 9911,
modules/portlet/trunk/test/src/test/resources/remotecontrol-portlet-war/WEB-INF)
Modified:
modules/portlet/trunk/test/src/test/resources/portal/samples/remotecontrol-portlet-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/test/src/test/resources/remotecontrol-portlet-war/WEB-INF/portlet.xml 2008-02-09
20:42:01 UTC (rev 9911)
+++
modules/portlet/trunk/test/src/test/resources/portal/samples/remotecontrol-portlet-war/WEB-INF/portlet.xml 2008-02-10
01:17:56 UTC (rev 9912)
@@ -29,7 +29,7 @@
<description>Portlet controlling display of other
portlets</description>
<portlet-name>RemoteControl</portlet-name>
<display-name>Remote Control Resource Portlet</display-name>
-
<portlet-class>org.jboss.portal.simple.samples.RemoteControlResourcePortlet</portlet-class>
+
<portlet-class>org.jboss.portal.portlet.portal.samples.RemoteControlResourcePortlet</portlet-class>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
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
20:42:01 UTC (rev 9911)
+++
modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo.jsp 2008-02-10
01:17:56 UTC (rev 9912)
@@ -10,15 +10,15 @@
<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="RemoteControl"
applicationName="samples-remotecontrol-portlet"/>
<jbp:portlet name="Foo" applicationName="bar"/>
<jbp:portlet name="ExceptionPortlet"
applicationName="samples-basic"/>
- <jbp:portlet name="Cart"
applicationName="cart-event-portlet"/>
+ <jbp:portlet name="Cart"
applicationName="samples-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"/>
+ <jbp:portlet name="GoogleMap"
applicationName="samples-google-map-portlet"/>
+ <jbp:portlet name="GoogleWeather"
applicationName="samples-google-weather-portlet"/>
+ <jbp:portlet name="Catalog"
applicationName="samples-cart-event-portlet"/>
</jsp:attribute>
</jbp:layout1>
</portal:page>
Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo1.jsp
===================================================================
---
modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo1.jsp 2008-02-09
20:42:01 UTC (rev 9911)
+++
modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo1.jsp 2008-02-10
01:17:56 UTC (rev 9912)
@@ -10,10 +10,10 @@
<portal:pageparam namespaceURI="urn:jboss:portal:simple:google"
localName="zipcode" value="80201"/>
<jbp:layout1>
<jsp:attribute name="leftcol">
- <jbp:portlet name="Cart"
applicationName="cart-event-portlet"/>
+ <jbp:portlet name="Cart"
applicationName="samples-cart-event-portlet"/>
</jsp:attribute>
<jsp:attribute name="rightcol">
- <jbp:portlet name="Catalog"
applicationName="cart-event-portlet"/>
+ <jbp:portlet name="Catalog"
applicationName="samples-cart-event-portlet"/>
</jsp:attribute>
</jbp:layout1>
</portal:page>
Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo2.jsp
===================================================================
---
modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo2.jsp 2008-02-09
20:42:01 UTC (rev 9911)
+++
modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo2.jsp 2008-02-10
01:17:56 UTC (rev 9912)
@@ -10,13 +10,13 @@
<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="RemoteControl"
applicationName="samples-remotecontrol-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="GoogleMap"
applicationName="samples-google-map-portlet"/>
+ <jbp:portlet name="GoogleWeather"
applicationName="samples-google-weather-portlet"/>
</jsp:attribute>
</jbp:layout1>