Author: thomas.heute(a)jboss.com
Date: 2008-07-17 07:47:56 -0400 (Thu, 17 Jul 2008)
New Revision: 11475
Added:
examples/trunk/JSFHelloUser/src/main/java/org/jboss/portal/portlet/samples/jsf/
examples/trunk/JSFHelloUser/src/main/java/org/jboss/portal/portlet/samples/jsf/UserBean.java
examples/trunk/JSFHelloUser/src/main/webapp/jsf/
examples/trunk/JSFHelloUser/src/main/webapp/jsf/edit.jsp
examples/trunk/JSFHelloUser/src/main/webapp/jsf/hello.jsp
examples/trunk/JSFHelloUser/src/main/webapp/jsf/help.jsp
examples/trunk/JSFHelloUser/src/main/webapp/jsf/welcome.jsp
Removed:
examples/trunk/JSFHelloUser/src/main/webapp/jsf/edit.jsp
examples/trunk/JSFHelloUser/src/main/webapp/jsf/hello.jsp
examples/trunk/JSFHelloUser/src/main/webapp/jsf/help.jsp
examples/trunk/JSFHelloUser/src/main/webapp/jsf/welcome.jsp
examples/trunk/JSFHelloUser/src/main/webapp/jsp/
Modified:
examples/trunk/JSFHelloUser/pom.xml
examples/trunk/JSFHelloUser/src/main/webapp/WEB-INF/portlet.xml
examples/trunk/JSFHelloUser/src/main/webapp/WEB-INF/web.xml
Log:
On the way to a simple portlet
Modified: examples/trunk/JSFHelloUser/pom.xml
===================================================================
--- examples/trunk/JSFHelloUser/pom.xml 2008-07-17 10:30:38 UTC (rev 11474)
+++ examples/trunk/JSFHelloUser/pom.xml 2008-07-17 11:47:56 UTC (rev 11475)
@@ -17,5 +17,32 @@
<version>2.0</version>
<scope>provided</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.portletbridge</groupId>
+ <artifactId>portletbridge-api</artifactId>
+ <version>1.0.0.B3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.portletbridge</groupId>
+ <artifactId>portletbridge-impl</artifactId>
+ <version>1.0.0.B3</version>
+ </dependency>
</dependencies>
+
+ <repositories>
+ <repository>
+ <id>JBoss repository</id>
+ <
url>http://repository.jboss.com/maven2</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+
+ </repositories>
+
</project>
\ No newline at end of file
Added:
examples/trunk/JSFHelloUser/src/main/java/org/jboss/portal/portlet/samples/jsf/UserBean.java
===================================================================
---
examples/trunk/JSFHelloUser/src/main/java/org/jboss/portal/portlet/samples/jsf/UserBean.java
(rev 0)
+++
examples/trunk/JSFHelloUser/src/main/java/org/jboss/portal/portlet/samples/jsf/UserBean.java 2008-07-17
11:47:56 UTC (rev 11475)
@@ -0,0 +1,45 @@
+/******************************************************************************
+ * 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.samples.jsf;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class UserBean
+{
+
+ private String userName;
+
+ public String getUserName()
+ {
+ return userName;
+ }
+
+ public void setUserName(String userName)
+ {
+ this.userName = userName;
+ }
+
+}
+
Modified: examples/trunk/JSFHelloUser/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- examples/trunk/JSFHelloUser/src/main/webapp/WEB-INF/portlet.xml 2008-07-17 10:30:38
UTC (rev 11474)
+++ examples/trunk/JSFHelloUser/src/main/webapp/WEB-INF/portlet.xml 2008-07-17 11:47:56
UTC (rev 11475)
@@ -6,17 +6,31 @@
version="2.0">
<portlet>
<portlet-name>JSFHelloUserPortlet</portlet-name>
- <portlet-class>
- org.jboss.portal.portlet.samples.JSPHelloUserPortlet
- </portlet-class>
+ <portlet-class>javax.portlet.faces.GenericFacesPortlet</portlet-class>
<supports>
- <mime-type>text/html</mime-type>
- <mode>view</mode>
- <mode>edit</mode>
- <mode>help</mode>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>view</portlet-mode>
+ <portlet-mode>edit</portlet-mode>
+ <portlet-mode>help</portlet-mode>
</supports>
<portlet-info>
- <title>JSF Hello User Portlet</title>
+ <title>JSF Hello User Portlet</title>
</portlet-info>
+
+ <init-param>
+ <name>javax.portlet.faces.defaultViewId.view</name>
+ <value>/jsf/welcome.jsp</value>
+ </init-param>
+
+ <init-param>
+ <name>javax.portlet.faces.defaultViewId.edit</name>
+ <value>/jsf/edit.jsp</value>
+ </init-param>
+
+ <init-param>
+ <name>javax.portlet.faces.defaultViewId.help</name>
+ <value>/jsf/help.jsp</value>
+ </init-param>
+
</portlet>
</portlet-app>
\ No newline at end of file
Modified: examples/trunk/JSFHelloUser/src/main/webapp/WEB-INF/web.xml
===================================================================
--- examples/trunk/JSFHelloUser/src/main/webapp/WEB-INF/web.xml 2008-07-17 10:30:38 UTC
(rev 11474)
+++ examples/trunk/JSFHelloUser/src/main/webapp/WEB-INF/web.xml 2008-07-17 11:47:56 UTC
(rev 11475)
@@ -1,4 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
-<web-app>
+<web-app
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/web-app_2_5.xsd&...
+ version="2.5">
+ <servlet>
+ <servlet-name>JSFServlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>JSFServlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+
</web-app>
Copied: examples/trunk/JSFHelloUser/src/main/webapp/jsf (from rev 11374,
examples/trunk/JSFHelloUser/src/main/webapp/jsp)
Deleted: examples/trunk/JSFHelloUser/src/main/webapp/jsf/edit.jsp
===================================================================
--- examples/trunk/JSFHelloUser/src/main/webapp/jsp/edit.jsp 2008-07-09 17:54:14 UTC (rev
11374)
+++ examples/trunk/JSFHelloUser/src/main/webapp/jsf/edit.jsp 2008-07-17 11:47:56 UTC (rev
11475)
@@ -1,2 +0,0 @@
-<div class="portlet-section-header">Edit mode</div>
-<div class='Portlet-section-body">This is the edit mode, a convenient
place to let the user change his portlet preferences.</div>
\ No newline at end of file
Copied: examples/trunk/JSFHelloUser/src/main/webapp/jsf/edit.jsp (from rev 11474,
examples/trunk/JSFHelloUser/src/main/webapp/jsp/edit.jsp)
===================================================================
--- examples/trunk/JSFHelloUser/src/main/webapp/jsf/edit.jsp (rev
0)
+++ examples/trunk/JSFHelloUser/src/main/webapp/jsf/edit.jsp 2008-07-17 11:47:56 UTC (rev
11475)
@@ -0,0 +1,7 @@
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f" %>
+
+<f:view>
+<div class="portlet-section-header"><h:outputText value="Edit
mode"/></div>
+<div class='Portlet-section-body">This is the edit mode, a convenient
place to let the user change his portlet preferences.</div>
+</f:view>
\ No newline at end of file
Deleted: examples/trunk/JSFHelloUser/src/main/webapp/jsf/hello.jsp
===================================================================
--- examples/trunk/JSFHelloUser/src/main/webapp/jsp/hello.jsp 2008-07-09 17:54:14 UTC (rev
11374)
+++ examples/trunk/JSFHelloUser/src/main/webapp/jsf/hello.jsp 2008-07-17 11:47:56 UTC (rev
11475)
@@ -1,8 +0,0 @@
-<%@ taglib
uri="http://java.sun.com/portlet" prefix="portlet"
%>
-<portlet:defineObjects/>
-
-<div class="portlet-section-header">Remember we love you: <%=
renderRequest.getParameter("yourname") %></div>
-
-<portlet:renderURL var="myRenderURL"/>
-<br/>
-<a href="<%= myRenderURL %>">Ask me again</a></div>
Copied: examples/trunk/JSFHelloUser/src/main/webapp/jsf/hello.jsp (from rev 11474,
examples/trunk/JSFHelloUser/src/main/webapp/jsp/hello.jsp)
===================================================================
--- examples/trunk/JSFHelloUser/src/main/webapp/jsf/hello.jsp (rev
0)
+++ examples/trunk/JSFHelloUser/src/main/webapp/jsf/hello.jsp 2008-07-17 11:47:56 UTC (rev
11475)
@@ -0,0 +1,12 @@
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f" %>
+<f:view>
+<portlet:defineObjects/>
+
+<div class="portlet-section-header">Remember we love you:
<h:outputText value="#{user.userName}"/>}</div>
+
+<br/>
+<h:commandLink action="back">
+ <h:outputText value="Ask Me Again"/>
+</h:commandLink>
+</f:view>
\ No newline at end of file
Deleted: examples/trunk/JSFHelloUser/src/main/webapp/jsf/help.jsp
===================================================================
--- examples/trunk/JSFHelloUser/src/main/webapp/jsp/help.jsp 2008-07-09 17:54:14 UTC (rev
11374)
+++ examples/trunk/JSFHelloUser/src/main/webapp/jsf/help.jsp 2008-07-17 11:47:56 UTC (rev
11475)
@@ -1,2 +0,0 @@
-<div class="portlet-section-header">Help mode</div>
-<div class='Portlet-section-body">This is the help mode, a convenient
place to give the user some help information.</div>
\ No newline at end of file
Copied: examples/trunk/JSFHelloUser/src/main/webapp/jsf/help.jsp (from rev 11474,
examples/trunk/JSFHelloUser/src/main/webapp/jsp/help.jsp)
===================================================================
--- examples/trunk/JSFHelloUser/src/main/webapp/jsf/help.jsp (rev
0)
+++ examples/trunk/JSFHelloUser/src/main/webapp/jsf/help.jsp 2008-07-17 11:47:56 UTC (rev
11475)
@@ -0,0 +1,6 @@
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f" %>
+<f:view>
+<div class="portlet-section-header">Help mode</div>
+<div class='Portlet-section-body">This is the help mode, a convenient
place to give the user some help information.</div>
+</f:view>
\ No newline at end of file
Deleted: examples/trunk/JSFHelloUser/src/main/webapp/jsf/welcome.jsp
===================================================================
--- examples/trunk/JSFHelloUser/src/main/webapp/jsp/welcome.jsp 2008-07-09 17:54:14 UTC
(rev 11374)
+++ examples/trunk/JSFHelloUser/src/main/webapp/jsf/welcome.jsp 2008-07-17 11:47:56 UTC
(rev 11475)
@@ -1,35 +0,0 @@
-<%@ taglib
uri="http://java.sun.com/portlet" prefix="portlet"
%>
-
-<div class="portlet-section-header">Welcome !</div>
-
-<br/>
-
-<div class="portlet-font">Welcome on the JSP Hello User portlet,
-my name is JBoss Portal. What's yours ?</div>
-
-<br/>
-
-<div class="portlet-font">Method 1: We simply pass the parameter to the
render phase:<br/>
-<a href="<portlet:renderURL><portlet:param name="yourname"
value="John Doe"/></portlet:renderURL>">John
Doe</a></div>
-
-<br/>
-
-<div class="portlet-font">Method 2: We pass the parameter to the render
phase, using valid XML:
-Please check the source code to see the difference with Method 1.
-<portlet:renderURL var="myRenderURL">
- <portlet:param name="yourname" value='John Doe'/>
-</portlet:renderURL>
-<br/>
-<a href="<%= myRenderURL %>">John Doe</a></div>
-
-<br/>
-
-<div class="portlet-font">Method 3: We use a form:<br/>
-
-<portlet:actionURL var="myActionURL"/>
-<form action="<%= myActionURL %>" method="POST">
- <span class="portlet-form-field-label">Name:</span>
- <input class="portlet-form-input-field" type="text"
name="yourname"/>
- <input class="portlet-form-button" type="Submit"/>
-</form>
-</div>
\ No newline at end of file
Copied: examples/trunk/JSFHelloUser/src/main/webapp/jsf/welcome.jsp (from rev 11474,
examples/trunk/JSFHelloUser/src/main/webapp/jsp/welcome.jsp)
===================================================================
--- examples/trunk/JSFHelloUser/src/main/webapp/jsf/welcome.jsp
(rev 0)
+++ examples/trunk/JSFHelloUser/src/main/webapp/jsf/welcome.jsp 2008-07-17 11:47:56 UTC
(rev 11475)
@@ -0,0 +1,20 @@
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f" %>
+
+<f:view>
+
+<div class="portlet-section-header">Welcome !</div>
+
+<br/>
+
+<div class="portlet-font">Welcome on the JSP Hello User portlet,
+my name is JBoss Portal. What's yours ?</div>
+
+<br/>
+
+<h:form>
+ <h:inputText value="#{user.userName}"/>
+ <h:commandButton action="sayHello" value="Say Hello"/>
+</h:form>
+
+</f:view>
\ No newline at end of file