[richfaces-svn-commits] JBoss Rich Faces SVN: r2891 - in trunk/samples: richfaces-ear-demo/ejb and 10 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Tue Sep 11 18:17:46 EDT 2007


Author: alexsmirnov
Date: 2007-09-11 18:17:46 -0400 (Tue, 11 Sep 2007)
New Revision: 2891

Added:
   trunk/samples/richfaces-ear-demo/ejb/META-INF/
   trunk/samples/richfaces-ear-demo/ejb/META-INF/MANIFEST.MF
   trunk/samples/richfaces-ear-demo/ejb/src/main/resources/
   trunk/samples/richfaces-ear-demo/ejb/src/main/resources/META-INF/
   trunk/samples/richfaces-ear-demo/ejb/src/main/resources/META-INF/ejb-jar.xml
Removed:
   trunk/samples/richfaces-ear-demo/ejb/src/main/java/org/richfaces/samples/Placeholder.java
Modified:
   trunk/samples/richfaces-demo/pom.xml
   trunk/samples/richfaces-ear-demo/ejb/pom.xml
   trunk/samples/richfaces-ear-demo/ejb/src/main/java/org/richfaces/samples/Guess.java
   trunk/samples/richfaces-ear-demo/ejb/src/main/java/org/richfaces/samples/GuessBean.java
   trunk/samples/richfaces-ear-demo/webapp/pom.xml
   trunk/samples/richfaces-ear-demo/webapp/src/main/java/org/richfaces/samples/GuessViewBean.java
   trunk/samples/richfaces-ear-demo/webapp/src/main/webapp/WEB-INF/faces-config.xml
   trunk/samples/richfaces-ear-demo/webapp/src/main/webapp/pages/guess.xhtml
   trunk/samples/seamEAR/ejbs/pom.xml
Log:
build 3 versions ( jee5, tomcat5, tomcat6 ) of a demo application in release profile.
Continue to design EAR demo application ( currently run with glassfish , jboss4.2 / jboss5 ).

Modified: trunk/samples/richfaces-demo/pom.xml
===================================================================
--- trunk/samples/richfaces-demo/pom.xml	2007-09-11 22:09:10 UTC (rev 2890)
+++ trunk/samples/richfaces-demo/pom.xml	2007-09-11 22:17:46 UTC (rev 2891)
@@ -90,11 +90,19 @@
 					<mainClass>com.sun.tlddoc.TLDDoc</mainClass>
 					<arguments>
 						<argument>-d</argument>
-						<argument>${project.build.directory}/${project.build.finalName}/WEB-INF/tlddoc</argument>
+						<argument>
+							${project.build.directory}/${project.build.finalName}/WEB-INF/tlddoc
+						</argument>
 						<argument>-xslt</argument>
-						<argument>${basedir}/src/main/xslt/tlddoc</argument>
-						<argument>${project.build.directory}/richfaces/META-INF/ajax4jsf.tld</argument>
-						<argument>${project.build.directory}/richfaces/META-INF/rich.tld</argument>
+						<argument>
+							${basedir}/src/main/xslt/tlddoc
+						</argument>
+						<argument>
+							${project.build.directory}/richfaces/META-INF/ajax4jsf.tld
+						</argument>
+						<argument>
+							${project.build.directory}/richfaces/META-INF/rich.tld
+						</argument>
 					</arguments>
 				</configuration>
 
@@ -136,23 +144,96 @@
 
 	<profiles>
 		<profile>
-			<id>myfaces</id>
+			<id>release</id>
+			<build>
+				<plugins>
+					<plugin>
+						<groupId>org.apache.maven.plugins</groupId>
+						<artifactId>maven-war-plugin</artifactId>
+						<configuration>
+							<webResources>
+								<resource>
+									<!-- this is relative to the pom.xml directory -->
+									<directory>
+										${basedir}/src/main/java
+									</directory>
+									<targetPath>
+										/WEB-INF/src
+									</targetPath>
+								</resource>
+							</webResources>
+						</configuration>
+						<executions>
+							<execution>
+								<id>jee5</id>
+								<goals>
+									<goal>war</goal>
+								</goals>
+								<phase>package</phase>
+								<configuration>
+									<webappDirectory>
+										${project.build.directory}/${project.build.finalName}-jee5
+									</webappDirectory>
+									<classifier>jee5</classifier>
+									<warSourceExcludes>
+										WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*,WEB-INF/lib/el-*
+									</warSourceExcludes>
+								</configuration>
+							</execution>
+							<execution>
+								<id>tomcat6</id>
+								<goals>
+									<goal>war</goal>
+								</goals>
+								<phase>package</phase>
+								<configuration>
+									<webappDirectory>
+										${project.build.directory}/${project.build.finalName}-tomcat6
+									</webappDirectory>
+									<classifier>tomcat6</classifier>
+									<warSourceExcludes>
+										WEB-INF/lib/el-*
+									</warSourceExcludes>
+								</configuration>
+							</execution>
+						</executions>
+					</plugin>
+				</plugins>
+			</build>
 			<dependencies>
 				<dependency>
-					<groupId>org.richfaces.ui</groupId>
-					<artifactId>richfaces-ui</artifactId>
-					<version>3.1.0-SNAPSHOT</version>
-					<exclusions>
-						<exclusion>
-							<groupId>javax.faces</groupId>
-							<artifactId>jsf-api</artifactId>
-						</exclusion>
-						<exclusion>
-							<groupId>javax.faces</groupId>
-							<artifactId>jsf-impl</artifactId>
-						</exclusion>
-					</exclusions>
+					<groupId>javax.el</groupId>
+					<artifactId>el-api</artifactId>
+					<version>1.0</version>
 				</dependency>
+				<dependency>
+					<groupId>el-impl</groupId>
+					<artifactId>el-impl</artifactId>
+					<version>1.0</version>
+				</dependency>
+				<dependency>
+					<groupId>javax.servlet</groupId>
+					<artifactId>servlet-api</artifactId>
+					<version>2.4</version>
+					<scope>provided</scope>
+				</dependency>
+				<dependency>
+					<groupId>javax.servlet.jsp</groupId>
+					<artifactId>jsp-api</artifactId>
+					<version>2.0</version>
+					<scope>provided</scope>
+				</dependency>
+				<dependency>
+					<groupId>javax.faces</groupId>
+					<artifactId>jsf-api</artifactId>
+					<version>1.2_04-p02</version>
+				</dependency>
+				<dependency>
+					<groupId>javax.faces</groupId>
+					<artifactId>jsf-impl</artifactId>
+					<version>1.2_04-p02</version>
+					<scope>runtime</scope>
+				</dependency>
 			</dependencies>
 		</profile>
 	</profiles>

Added: trunk/samples/richfaces-ear-demo/ejb/META-INF/MANIFEST.MF
===================================================================
--- trunk/samples/richfaces-ear-demo/ejb/META-INF/MANIFEST.MF	                        (rev 0)
+++ trunk/samples/richfaces-ear-demo/ejb/META-INF/MANIFEST.MF	2007-09-11 22:17:46 UTC (rev 2891)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path: 
+


Property changes on: trunk/samples/richfaces-ear-demo/ejb/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: trunk/samples/richfaces-ear-demo/ejb/pom.xml
===================================================================
--- trunk/samples/richfaces-ear-demo/ejb/pom.xml	2007-09-11 22:09:10 UTC (rev 2890)
+++ trunk/samples/richfaces-ear-demo/ejb/pom.xml	2007-09-11 22:17:46 UTC (rev 2891)
@@ -38,11 +38,26 @@
 			<scope>provided</scope>
 			<optional>true</optional>
 		</dependency>
+		<dependency>
+			<groupId>javax.annotation</groupId>
+			<artifactId>jsr250-api</artifactId>
+			<version>1.0</version>
+			<scope>provided</scope>
+			<optional>true</optional>
+		</dependency>
 	</dependencies>
 	<build>
 		<finalName>ejb</finalName>
 		<plugins>
 			<plugin>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<inherited>true</inherited>
+				<configuration>
+					<source>1.5</source>
+					<target>1.5</target>
+				</configuration>
+			</plugin>
+			<plugin>
 				<artifactId>maven-ejb-plugin</artifactId>
 				<configuration>
 					<!-- this is false by default -->

Modified: trunk/samples/richfaces-ear-demo/ejb/src/main/java/org/richfaces/samples/Guess.java
===================================================================
--- trunk/samples/richfaces-ear-demo/ejb/src/main/java/org/richfaces/samples/Guess.java	2007-09-11 22:09:10 UTC (rev 2890)
+++ trunk/samples/richfaces-ear-demo/ejb/src/main/java/org/richfaces/samples/Guess.java	2007-09-11 22:17:46 UTC (rev 2891)
@@ -5,12 +5,13 @@
 
 import javax.ejb.Local;
 import javax.ejb.LocalHome;
+import javax.ejb.Remote;
 
 /**
  * @author asmirnov
  *
  */
- at Local
+ at Remote
 public interface Guess {
 
 	/**

Modified: trunk/samples/richfaces-ear-demo/ejb/src/main/java/org/richfaces/samples/GuessBean.java
===================================================================
--- trunk/samples/richfaces-ear-demo/ejb/src/main/java/org/richfaces/samples/GuessBean.java	2007-09-11 22:09:10 UTC (rev 2890)
+++ trunk/samples/richfaces-ear-demo/ejb/src/main/java/org/richfaces/samples/GuessBean.java	2007-09-11 22:17:46 UTC (rev 2891)
@@ -3,6 +3,9 @@
  */
 package org.richfaces.samples;
 
+import java.io.Serializable;
+
+import javax.ejb.Init;
 import javax.ejb.Remove;
 import javax.ejb.Stateful;
 
@@ -11,7 +14,7 @@
  *
  */
 @Stateful
-public class GuessBean implements Guess {
+public class GuessBean implements Guess,Serializable {
 	
 	int random;
 	
@@ -26,9 +29,16 @@
 	int userGuess;
 	
 	public GuessBean() {
+		min = 0;
+		max = 100;
+		attempts=0;
+		maxAttempts = 10;
 	}
 	
-	
+	@Init
+	public void init(){
+		
+	}
 
 	@Remove
 	public void destroy(){

Deleted: trunk/samples/richfaces-ear-demo/ejb/src/main/java/org/richfaces/samples/Placeholder.java
===================================================================
--- trunk/samples/richfaces-ear-demo/ejb/src/main/java/org/richfaces/samples/Placeholder.java	2007-09-11 22:09:10 UTC (rev 2890)
+++ trunk/samples/richfaces-ear-demo/ejb/src/main/java/org/richfaces/samples/Placeholder.java	2007-09-11 22:17:46 UTC (rev 2891)
@@ -1,10 +0,0 @@
-package org.richfaces.samples;
-
-/**
- * Placeholder class - to build project with Maven
- * @author Maksim Kaszynski
- *
- */
-public class Placeholder {
-	
-}
\ No newline at end of file

Added: trunk/samples/richfaces-ear-demo/ejb/src/main/resources/META-INF/ejb-jar.xml
===================================================================
--- trunk/samples/richfaces-ear-demo/ejb/src/main/resources/META-INF/ejb-jar.xml	                        (rev 0)
+++ trunk/samples/richfaces-ear-demo/ejb/src/main/resources/META-INF/ejb-jar.xml	2007-09-11 22:17:46 UTC (rev 2891)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar 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/ejb-jar_3_0.xsd"
+         version="3.0">
+         
+   
+</ejb-jar>
\ No newline at end of file


Property changes on: trunk/samples/richfaces-ear-demo/ejb/src/main/resources/META-INF/ejb-jar.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Date Revision Author

Modified: trunk/samples/richfaces-ear-demo/webapp/pom.xml
===================================================================
--- trunk/samples/richfaces-ear-demo/webapp/pom.xml	2007-09-11 22:09:10 UTC (rev 2890)
+++ trunk/samples/richfaces-ear-demo/webapp/pom.xml	2007-09-11 22:17:46 UTC (rev 2891)
@@ -15,6 +15,16 @@
 	<url>http://maven.apache.org</url>
 	<build>
 		<finalName>webapp</finalName>
+		<plugins>
+			<plugin>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<inherited>true</inherited>
+				<configuration>
+					<source>1.5</source>
+					<target>1.5</target>
+				</configuration>
+			</plugin>
+		</plugins>
 	</build>
 	<dependencies>
 		<dependency>

Modified: trunk/samples/richfaces-ear-demo/webapp/src/main/java/org/richfaces/samples/GuessViewBean.java
===================================================================
--- trunk/samples/richfaces-ear-demo/webapp/src/main/java/org/richfaces/samples/GuessViewBean.java	2007-09-11 22:09:10 UTC (rev 2890)
+++ trunk/samples/richfaces-ear-demo/webapp/src/main/java/org/richfaces/samples/GuessViewBean.java	2007-09-11 22:17:46 UTC (rev 2891)
@@ -3,29 +3,111 @@
  */
 package org.richfaces.samples;
 
-import javax.ejb.EJB;
+import javax.faces.FacesException;
+import javax.naming.InitialContext;
+import javax.naming.NameNotFoundException;
+import javax.naming.NamingException;
 
 /**
  * @author asmirnov
- *
+ * 
  */
 public class GuessViewBean {
-	
-	@EJB
+
 	private Guess guess;
 
+	private int userGuess;
+
 	/**
+	 * @return the userGuess
+	 */
+	public int getUserGuess() {
+		return userGuess;
+	}
+
+	/**
+	 * @param userGuess
+	 *            the userGuess to set
+	 */
+	public void setUserGuess(int userGuess) {
+		this.userGuess = userGuess;
+	}
+
+	/**
 	 * @return the guess
 	 */
 	public Guess getGuess() {
+		if (guess == null) {
+			try {
+				InitialContext ic = new InitialContext();
+				try {
+					guess = (Guess) ic.lookup(Guess.class.getName());
+				} catch (NameNotFoundException e) {
+					// JBOSS Server uses different JNDI name
+					guess = (Guess) ic.lookup("richfacesEAR/GuessBean/remote");
+				}
+			} catch (NamingException e) {
+				throw new FacesException("Local Guess EJB not found", e);
+			}
+		}
+
 		return guess;
 	}
 
 	/**
-	 * @param guess the guess to set
+	 * @param guess
+	 *            the guess to set
 	 */
 	public void setGuess(Guess guess) {
 		this.guess = guess;
 	}
 
+	/**
+	 * @return
+	 * @see org.richfaces.samples.Guess#getAttempts()
+	 */
+	public int getAttempts() {
+		return getGuess().getAttempts();
+	}
+
+	/**
+	 * @return
+	 * @see org.richfaces.samples.Guess#getMax()
+	 */
+	public int getMax() {
+		return getGuess().getMax();
+	}
+
+	/**
+	 * @return
+	 * @see org.richfaces.samples.Guess#getMaxAttempts()
+	 */
+	public int getMaxAttempts() {
+		return getGuess().getMaxAttempts();
+	}
+
+	/**
+	 * @return
+	 * @see org.richfaces.samples.Guess#getMin()
+	 */
+	public int getMin() {
+		return getGuess().getMin();
+	}
+
+	/**
+	 * @return
+	 * @see org.richfaces.samples.Guess#guess()
+	 */
+	public int guess() {
+		return getGuess().guess();
+	}
+
+	/**
+	 * 
+	 * @see org.richfaces.samples.Guess#start()
+	 */
+	public void start() {
+		getGuess().start();
+	}
+
 }

Modified: trunk/samples/richfaces-ear-demo/webapp/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/richfaces-ear-demo/webapp/src/main/webapp/WEB-INF/faces-config.xml	2007-09-11 22:09:10 UTC (rev 2890)
+++ trunk/samples/richfaces-ear-demo/webapp/src/main/webapp/WEB-INF/faces-config.xml	2007-09-11 22:17:46 UTC (rev 2891)
@@ -3,46 +3,10 @@
                               "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
 <faces-config>
  <managed-bean>
-  <managed-bean-name>bean</managed-bean-name>
-  <managed-bean-class>org.ajax4jsf.Bean</managed-bean-class>
-  <managed-bean-scope>request</managed-bean-scope>
-  <managed-property>
-   <property-name>text</property-name>
-   <property-class>java.lang.String</property-class>
-   <null-value/>
-  </managed-property>
- </managed-bean>
- <managed-bean>
-  <managed-bean-name>repeatData</managed-bean-name>
-  <managed-bean-class>org.ajax4jsf.RepeatData</managed-bean-class>
+  <managed-bean-name>guessView</managed-bean-name>
+  <managed-bean-class>org.richfaces.samples.GuessViewBean</managed-bean-class>
   <managed-bean-scope>session</managed-bean-scope>
- </managed-bean>
- <managed-bean>
-  <managed-bean-name>enclosedData</managed-bean-name>
-  <managed-bean-class>org.ajax4jsf.EnclosedData</managed-bean-class>
-  <managed-bean-scope>session</managed-bean-scope>
- </managed-bean>
- <managed-bean>
-  <managed-bean-name>a4jTestBean</managed-bean-name>
-  <managed-bean-class>org.ajax4jsf.A4jTestBean</managed-bean-class>
-  <managed-bean-scope>request</managed-bean-scope>
- </managed-bean>
- <managed-bean>
-  <managed-bean-name>messageBean</managed-bean-name>
-  <managed-bean-class>org.ajax4jsf.MessageBean</managed-bean-class>
-  <managed-bean-scope>session</managed-bean-scope>
- </managed-bean>
-    <managed-bean>
-        <managed-bean-name>dataManager</managed-bean-name>
-        <managed-bean-class>control.test.ControlBackingBean</managed-bean-class>
-        <managed-bean-scope>request</managed-bean-scope>
-  </managed-bean>
-	<managed-bean>
-		<managed-bean-name>delme</managed-bean-name>
-		<managed-bean-class>org.ajax4jsf.TestBean</managed-bean-class>
-		<managed-bean-scope>request</managed-bean-scope>
-	</managed-bean>
-
+</managed-bean>
  <navigation-rule>
   <navigation-case>
    <from-outcome>verify_cookie</from-outcome>

Modified: trunk/samples/richfaces-ear-demo/webapp/src/main/webapp/pages/guess.xhtml
===================================================================
--- trunk/samples/richfaces-ear-demo/webapp/src/main/webapp/pages/guess.xhtml	2007-09-11 22:09:10 UTC (rev 2890)
+++ trunk/samples/richfaces-ear-demo/webapp/src/main/webapp/pages/guess.xhtml	2007-09-11 22:17:46 UTC (rev 2891)
@@ -15,7 +15,8 @@
 	    <f:facet name="header" >
 	      <h:outputText value="Guess number demo application"/>
 	    </f:facet>
-	    Hello, world !
+	    	Guess number from <h:outputText value="#{guessView.min}"/> to <h:outputText value="#{guessView.max}"/>
+	    	<h:commandButton value="Start" action="#{guessView.start}" />
 	  </rich:panel>
 	</h:form>
 	<a4j:log hotkey="D" />

Modified: trunk/samples/seamEAR/ejbs/pom.xml
===================================================================
--- trunk/samples/seamEAR/ejbs/pom.xml	2007-09-11 22:09:10 UTC (rev 2890)
+++ trunk/samples/seamEAR/ejbs/pom.xml	2007-09-11 22:17:46 UTC (rev 2891)
@@ -48,6 +48,13 @@
 			<optional>true</optional>
 		</dependency>
 		<dependency>
+			<groupId>javax.annotation</groupId>
+			<artifactId>jsr250-api</artifactId>
+			<version>1.0</version>
+			<scope>provided</scope>
+			<optional>true</optional>
+		</dependency>
+		<dependency>
 			<groupId>javax.faces</groupId>
 			<artifactId>jsf-api</artifactId>
 			<version>1.2_04</version>




More information about the richfaces-svn-commits mailing list