Author: mvanco(a)redhat.com
Date: 2011-01-14 11:11:17 -0500 (Fri, 14 Jan 2011)
New Revision: 5749
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/assembly/test-windowstates-portlet.xml
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/WindowStatesPortlet.java
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-windowstates-portlet-war/
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-windowstates-portlet-war/WEB-INF/
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-windowstates-portlet-war/WEB-INF/portlet.xml
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-windowstates-portlet-war/WEB-INF/web.xml
Modified:
components/wsrp/trunk/wsrp-producer-war/pom.xml
Log:
WSRP2 Sample portlets
- added new sample portlet for window states
Modified: components/wsrp/trunk/wsrp-producer-war/pom.xml
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/pom.xml 2011-01-14 15:04:56 UTC (rev 5748)
+++ components/wsrp/trunk/wsrp-producer-war/pom.xml 2011-01-14 16:11:17 UTC (rev 5749)
@@ -182,6 +182,7 @@
<descriptor>src/test/assembly/test-prp-portlet.xml</descriptor>
<descriptor>src/test/assembly/test-state-portlet.xml</descriptor>
<descriptor>src/test/assembly/test-resourceserving-portlet.xml</descriptor>
+
<descriptor>src/test/assembly/test-windowstates-portlet.xml</descriptor>
</descriptors>
</configuration>
<executions>
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/assembly/test-windowstates-portlet.xml
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/assembly/test-windowstates-portlet.xml
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/assembly/test-windowstates-portlet.xml 2011-01-14
16:11:17 UTC (rev 5749)
@@ -0,0 +1,25 @@
+<assembly>
+ <id>windowstates-portlet</id>
+ <formats>
+ <format>war</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <fileSets>
+ <!-- Test Classes -->
+ <fileSet>
+ <directory>target/test-classes</directory>
+ <outputDirectory>WEB-INF/classes</outputDirectory>
+ <includes>
+ <include>org/gatein/wsrp/portlet/WindowStatesPortlet.class</include>
+ </includes>
+ </fileSet>
+ <!-- Fileset for the sar strucuture -->
+ <fileSet>
+
<directory>src/test/test-portlets/test-windowstates-portlet-war</directory>
+ <outputDirectory></outputDirectory>
+ </fileSet>
+ </fileSets>
+
+</assembly>
+
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/WindowStatesPortlet.java
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/WindowStatesPortlet.java
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/WindowStatesPortlet.java 2011-01-14
16:11:17 UTC (rev 5749)
@@ -0,0 +1,52 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2010, 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.gatein.wsrp.portlet;
+
+import java.io.IOException;
+
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+
+/**
+ * @author <a href="mailto:mvanco@redhat.com">Michal Vanco</a>
+ * @version $Revision$
+ */
+public class WindowStatesPortlet extends GenericPortlet
+{
+
+ @Override
+ public void doView(RenderRequest request, RenderResponse response) throws
PortletException, IOException
+ {
+ response.setContentType("text/html");
+
+ StringBuffer sb = new StringBuffer();
+ sb.append("<h1>Welcome to window states sample</h1>");
+ sb.append("now you have <b>${state}</b> state selected.");
+ WindowState state = request.getWindowState();
+ response.getWriter().print(sb.toString().replace("${state}",
state.toString()));
+ }
+
+}
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-windowstates-portlet-war/WEB-INF/portlet.xml
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-windowstates-portlet-war/WEB-INF/portlet.xml
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-windowstates-portlet-war/WEB-INF/portlet.xml 2011-01-14
16:11:17 UTC (rev 5749)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ JBoss, a division of Red Hat
+ ~ Copyright 2010, 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>Window States</description>
+ <portlet-name>Window States</portlet-name>
+ <display-name>Window States</display-name>
+ <portlet-class>org.gatein.wsrp.portlet.WindowStatesPortlet</portlet-class>
+ <expiration-cache>0</expiration-cache>
+
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+
+ <portlet-info>
+ <title>Window States sample</title>
+ <short-title>Window States sample</short-title>
+ </portlet-info>
+ </portlet>
+
+ <!-- Make these portlets remotable -->
+ <container-runtime-option>
+ <name>org.gatein.pc.remotable</name>
+ <value>true</value>
+ </container-runtime-option>
+
+</portlet-app>
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-windowstates-portlet-war/WEB-INF/web.xml
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-windowstates-portlet-war/WEB-INF/web.xml
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-windowstates-portlet-war/WEB-INF/web.xml 2011-01-14
16:11:17 UTC (rev 5749)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2007, 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>
\ No newline at end of file