[seam-commits] Seam SVN: r12395 - in modules/faces/trunk/examples/tiny-url: src and 11 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon Apr 5 16:21:38 EDT 2010


Author: lincolnthree
Date: 2010-04-05 16:21:36 -0400 (Mon, 05 Apr 2010)
New Revision: 12395

Added:
   modules/faces/trunk/examples/tiny-url/pom.xml
   modules/faces/trunk/examples/tiny-url/src/
   modules/faces/trunk/examples/tiny-url/src/main/
   modules/faces/trunk/examples/tiny-url/src/main/java/
   modules/faces/trunk/examples/tiny-url/src/main/java/org/
   modules/faces/trunk/examples/tiny-url/src/main/java/org/jboss/
   modules/faces/trunk/examples/tiny-url/src/main/java/org/jboss/seam/
   modules/faces/trunk/examples/tiny-url/src/main/java/org/jboss/seam/faces/
   modules/faces/trunk/examples/tiny-url/src/main/java/org/jboss/seam/faces/examples/
   modules/faces/trunk/examples/tiny-url/src/main/java/org/jboss/seam/faces/examples/LinkBean.java
   modules/faces/trunk/examples/tiny-url/src/main/java/org/jboss/seam/faces/examples/RedirectBean.java
   modules/faces/trunk/examples/tiny-url/src/main/resources/
   modules/faces/trunk/examples/tiny-url/src/main/webapp/
   modules/faces/trunk/examples/tiny-url/src/main/webapp/META-INF/
   modules/faces/trunk/examples/tiny-url/src/main/webapp/META-INF/MANIFEST.MF
   modules/faces/trunk/examples/tiny-url/src/main/webapp/WEB-INF/
   modules/faces/trunk/examples/tiny-url/src/main/webapp/WEB-INF/beans.xml
   modules/faces/trunk/examples/tiny-url/src/main/webapp/WEB-INF/faces-config.xml
   modules/faces/trunk/examples/tiny-url/src/main/webapp/WEB-INF/lib/
   modules/faces/trunk/examples/tiny-url/src/main/webapp/WEB-INF/pretty-config.xml
   modules/faces/trunk/examples/tiny-url/src/main/webapp/WEB-INF/web.xml
   modules/faces/trunk/examples/tiny-url/src/main/webapp/editLink.xhtml
   modules/faces/trunk/examples/tiny-url/src/main/webapp/index.xhtml
   modules/faces/trunk/examples/tiny-url/src/test/
   modules/faces/trunk/examples/tiny-url/src/test/java/
   modules/faces/trunk/examples/tiny-url/src/test/resources/
Modified:
   modules/faces/trunk/examples/tiny-url/
Log:
Initial import.


Property changes on: modules/faces/trunk/examples/tiny-url
___________________________________________________________________
Name: svn:ignore
   + .settings
target
.classpath
.project


Added: modules/faces/trunk/examples/tiny-url/pom.xml
===================================================================
--- modules/faces/trunk/examples/tiny-url/pom.xml	                        (rev 0)
+++ modules/faces/trunk/examples/tiny-url/pom.xml	2010-04-05 20:21:36 UTC (rev 12395)
@@ -0,0 +1,112 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+
+	<groupId>org.jboss.seam.faces</groupId>
+	<artifactId>faces-examples-tiny-url</artifactId>
+
+	<packaging>war</packaging>
+	<version>0.0.1-SNAPSHOT</version>
+	<name>tiny.url with Seam &amp; PrettyFaces</name>
+
+	<url>http://go.jboss.org/</url>
+
+	<repositories>
+		<repository>
+			<id>java.net2</id>
+			<name>Repository hosting the jee6 artifacts</name>
+			<url>http://download.java.net/maven/2</url>
+		</repository>
+	</repositories>
+
+	<dependencies>
+		<dependency>
+			<groupId>org.jboss.seam</groupId>
+			<artifactId>seam-faces</artifactId>
+			<version>3.0.0-SNAPSHOT</version>
+		</dependency>
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-api</artifactId>
+			<version>1.5.9.RC1</version>
+			<scope>provided</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>javax</groupId>
+			<artifactId>javaee-web-api</artifactId>
+			<version>6.0</version>
+			<scope>provided</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>com.ocpsoft</groupId>
+			<artifactId>ocpsoft-pretty-faces</artifactId>
+			<version>2.0.5-SNAPSHOT</version>
+		</dependency>
+
+		<dependency>
+			<groupId>com.ocpsoft</groupId>
+			<artifactId>ocpsoft-pretty-time</artifactId>
+			<version>1.0.5</version>
+		</dependency>
+
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>4.8.1</version>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+
+	<pluginRepositories>
+		<pluginRepository>
+			<id>Glassfish</id>
+			<url>http://download.java.net/maven/glassfish/</url>
+		</pluginRepository>
+	</pluginRepositories>
+
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.glassfish</groupId>
+				<artifactId>maven-embedded-glassfish-plugin</artifactId>
+				<version>3.0</version>
+				<configuration>
+					<goalPrefix>glassfish</goalPrefix>
+					<app>test.war</app>
+					<port>8080</port>
+					<contextRoot>test</contextRoot>
+				</configuration>
+				<executions>
+					<execution>
+						<phase>install</phase>
+						<goals>
+							<goal>run</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<version>2.0.2</version>
+				<configuration>
+					<source>1.6</source>
+					<target>1.6</target>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-war-plugin</artifactId>
+				<version>2.1-beta-1</version>
+				<configuration>
+					<failOnMissingWebXml>false</failOnMissingWebXml>
+				</configuration>
+			</plugin>
+		</plugins>
+		<finalName>tiny.url</finalName>
+	</build>
+
+</project>

Added: modules/faces/trunk/examples/tiny-url/src/main/java/org/jboss/seam/faces/examples/LinkBean.java
===================================================================
--- modules/faces/trunk/examples/tiny-url/src/main/java/org/jboss/seam/faces/examples/LinkBean.java	                        (rev 0)
+++ modules/faces/trunk/examples/tiny-url/src/main/java/org/jboss/seam/faces/examples/LinkBean.java	2010-04-05 20:21:36 UTC (rev 12395)
@@ -0,0 +1,54 @@
+/**
+ * 
+ */
+package org.jboss.seam.faces.examples;
+
+import java.io.Serializable;
+
+import javax.enterprise.context.ConversationScoped;
+import javax.inject.Named;
+
+import org.jboss.seam.faces.context.conversation.Begin;
+import org.jboss.seam.faces.context.conversation.End;
+
+/**
+ * @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
+ * 
+ */
+ at Named
+ at ConversationScoped
+public class LinkBean implements Serializable
+{
+   private static final long serialVersionUID = -2209547152337410725L;
+
+   private String key;
+   private String url;
+
+   @Begin
+   @End
+   public String createLink()
+   {
+      System.out.println("Created link: [ " + key + " => " + url + " ]");
+      return "pretty:edit";
+   }
+
+   public String getKey()
+   {
+      return key;
+   }
+
+   public void setKey(final String key)
+   {
+      this.key = key;
+   }
+
+   public String getUrl()
+   {
+      return url;
+   }
+
+   public void setUrl(final String url)
+   {
+      this.url = url;
+   }
+}

Added: modules/faces/trunk/examples/tiny-url/src/main/java/org/jboss/seam/faces/examples/RedirectBean.java
===================================================================
--- modules/faces/trunk/examples/tiny-url/src/main/java/org/jboss/seam/faces/examples/RedirectBean.java	                        (rev 0)
+++ modules/faces/trunk/examples/tiny-url/src/main/java/org/jboss/seam/faces/examples/RedirectBean.java	2010-04-05 20:21:36 UTC (rev 12395)
@@ -0,0 +1,45 @@
+/**
+ * 
+ */
+package org.jboss.seam.faces.examples;
+
+import java.io.IOException;
+
+import javax.enterprise.context.RequestScoped;
+import javax.faces.context.FacesContext;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
+ * 
+ */
+ at Named
+ at RequestScoped
+public class RedirectBean
+{
+   @Inject
+   FacesContext context;
+
+   private String key;
+
+   public void send() throws IOException
+   {
+      String url = "http://ocpsoft.com";
+      System.out.println("Sent redirect for key: " + key);
+      HttpServletResponse response = (HttpServletResponse) context.getExternalContext().getResponse();
+      response.sendRedirect(url);
+      context.responseComplete();
+   }
+
+   public String getKey()
+   {
+      return key;
+   }
+
+   public void setKey(final String key)
+   {
+      this.key = key;
+   }
+}

Added: modules/faces/trunk/examples/tiny-url/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- modules/faces/trunk/examples/tiny-url/src/main/webapp/META-INF/MANIFEST.MF	                        (rev 0)
+++ modules/faces/trunk/examples/tiny-url/src/main/webapp/META-INF/MANIFEST.MF	2010-04-05 20:21:36 UTC (rev 12395)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path: 
+

Added: modules/faces/trunk/examples/tiny-url/src/main/webapp/WEB-INF/beans.xml
===================================================================
--- modules/faces/trunk/examples/tiny-url/src/main/webapp/WEB-INF/beans.xml	                        (rev 0)
+++ modules/faces/trunk/examples/tiny-url/src/main/webapp/WEB-INF/beans.xml	2010-04-05 20:21:36 UTC (rev 12395)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans/>
\ No newline at end of file

Added: modules/faces/trunk/examples/tiny-url/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- modules/faces/trunk/examples/tiny-url/src/main/webapp/WEB-INF/faces-config.xml	                        (rev 0)
+++ modules/faces/trunk/examples/tiny-url/src/main/webapp/WEB-INF/faces-config.xml	2010-04-05 20:21:36 UTC (rev 12395)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
+              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+              http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
+              version="2.0">
+
+</faces-config>

Added: modules/faces/trunk/examples/tiny-url/src/main/webapp/WEB-INF/pretty-config.xml
===================================================================
--- modules/faces/trunk/examples/tiny-url/src/main/webapp/WEB-INF/pretty-config.xml	                        (rev 0)
+++ modules/faces/trunk/examples/tiny-url/src/main/webapp/WEB-INF/pretty-config.xml	2010-04-05 20:21:36 UTC (rev 12395)
@@ -0,0 +1,25 @@
+<pretty-config xmlns="http://ocpsoft.com/prettyfaces/2.0.4"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://ocpsoft.com/prettyfaces/2.0.4
+http://ocpsoft.com/xml/ns/prettyfaces/ocpsoft-pretty-faces-2.0.4.xsd">
+
+	<rewrite trailingSlash="remove" toCase="lowercase" />
+
+    <url-mapping id="create">
+        <pattern value="/" />
+        <view-id>/faces/index.xhtml</view-id>
+    </url-mapping>
+
+    <url-mapping id="redirect">
+        <pattern value="/#{key}" />
+        <view-id>/faces/index.xhtml</view-id>
+        <action phaseId="RENDER_RESPONSE">#{redirectBean.send}</action>
+    </url-mapping>
+    
+    <url-mapping id="edit">
+        <pattern value="/#{key}/edit" />
+        <view-id>/faces/editLink.xhtml</view-id>
+        <action phaseId="INVOKE_APPLICATION">#{linkBean.send}</action>
+    </url-mapping>
+
+</pretty-config>

Added: modules/faces/trunk/examples/tiny-url/src/main/webapp/WEB-INF/web.xml
===================================================================
--- modules/faces/trunk/examples/tiny-url/src/main/webapp/WEB-INF/web.xml	                        (rev 0)
+++ modules/faces/trunk/examples/tiny-url/src/main/webapp/WEB-INF/web.xml	2010-04-05 20:21:36 UTC (rev 12395)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
+    <context-param>
+        <param-name>javax.faces.PROJECT_STAGE</param-name>
+        <param-value>Development</param-value>
+    </context-param>
+    <servlet>
+        <servlet-name>Faces Servlet</servlet-name>
+        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+    <servlet-mapping>
+        <servlet-name>Faces Servlet</servlet-name>
+        <url-pattern>/faces/*</url-pattern>
+    </servlet-mapping>
+    <session-config>
+        <session-timeout>
+            30
+        </session-timeout>
+    </session-config>
+    <welcome-file-list>
+        <welcome-file>faces/index.xhtml</welcome-file>
+    </welcome-file-list>
+</web-app>

Added: modules/faces/trunk/examples/tiny-url/src/main/webapp/editLink.xhtml
===================================================================
--- modules/faces/trunk/examples/tiny-url/src/main/webapp/editLink.xhtml	                        (rev 0)
+++ modules/faces/trunk/examples/tiny-url/src/main/webapp/editLink.xhtml	2010-04-05 20:21:36 UTC (rev 12395)
@@ -0,0 +1,27 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:h="http://java.sun.com/jsf/html"
+      xmlns:f="http://java.sun.com/jsf/core"
+      xmlns:ui="http://java.sun.com/jsf/facelets">
+
+	<f:metadata>
+		<f:viewParam name="key" value="#{redirectBean.key}" />
+	</f:metadata>
+
+	<h:head>
+	</h:head>
+
+	<h:body>
+		<h:form>
+			<h3>View a new link:</h3>
+			<label for="key">Key: <h:messages for="key"/><br/></label>
+			<h:inputText id="key" value="#{createLinkBean.key}" /><br/>
+			<label for="url">Link URL: <h:messages for="url"/><br/></label>
+			<h:inputText id="url" value="#{createLinkBean.url}" /><br/>
+			<h:commandButton action ="#{createLinkBean.done}" value="Create" />
+		</h:form>
+	</h:body>
+
+</html>
+

Added: modules/faces/trunk/examples/tiny-url/src/main/webapp/index.xhtml
===================================================================
--- modules/faces/trunk/examples/tiny-url/src/main/webapp/index.xhtml	                        (rev 0)
+++ modules/faces/trunk/examples/tiny-url/src/main/webapp/index.xhtml	2010-04-05 20:21:36 UTC (rev 12395)
@@ -0,0 +1,27 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:h="http://java.sun.com/jsf/html"
+      xmlns:f="http://java.sun.com/jsf/core"
+      xmlns:ui="http://java.sun.com/jsf/facelets">
+
+	<f:metadata>
+		<f:viewParam name="key" value="#{redirectBean.key}" />
+	</f:metadata>
+
+	<h:head>
+	</h:head>
+
+	<h:body>
+		<h:form>
+			<h3>Create a new link:</h3>
+			<label for="key">Key: <h:messages for="key"/><br/></label>
+			<h:inputText id="key" value="#{createLinkBean.key}" /><br/>
+			<label for="url">Link URL: <h:messages for="url"/><br/></label>
+			<h:inputText id="url" value="#{createLinkBean.url}" /><br/>
+			<h:commandButton action ="#{createLinkBean.createLink}" value="Create" />
+		</h:form>
+	</h:body>
+
+</html>
+



More information about the seam-commits mailing list