[seam-commits] Seam SVN: r10154 - in trunk/seam-gen: build-scripts and 7 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Fri Mar 13 20:01:28 EDT 2009


Author: dan.j.allen
Date: 2009-03-13 20:01:28 -0400 (Fri, 13 Mar 2009)
New Revision: 10154

Added:
   trunk/seam-gen/build-scripts/glassfish-build.xml
   trunk/seam-gen/build-scripts/glassfish-readme.txt
   trunk/seam-gen/ivy/
   trunk/seam-gen/ivy/ivy-build.xml
   trunk/seam-gen/ivy/ivy.settings.xml
   trunk/seam-gen/ivy/ivy.xml
   trunk/seam-gen/resources/glassfish-resources.xml
   trunk/seam-gen/src/AuthenticatorBean.java
   trunk/seam-gen/src/AuthenticatorJavaBean.java
Removed:
   trunk/seam-gen/icefaces/build-scripts/build-war.xml
   trunk/seam-gen/icefaces/build-scripts/build.properties
   trunk/seam-gen/icefaces/build-scripts/build.xml
   trunk/seam-gen/icefaces/resources/WEB-INF/components-war.xml
   trunk/seam-gen/icefaces/resources/WEB-INF/components.xml
Modified:
   trunk/seam-gen/build-scripts/build-war.xml
   trunk/seam-gen/build-scripts/build.properties
   trunk/seam-gen/build-scripts/build.xml
   trunk/seam-gen/build.xml
   trunk/seam-gen/resources/META-INF/persistence-dev-war.xml
   trunk/seam-gen/resources/META-INF/persistence-dev.xml
   trunk/seam-gen/resources/META-INF/persistence-prod-war.xml
   trunk/seam-gen/resources/META-INF/persistence-prod.xml
   trunk/seam-gen/resources/WEB-INF/components-war.xml
   trunk/seam-gen/resources/WEB-INF/components.xml
   trunk/seam-gen/resources/components-dev.properties
   trunk/seam-gen/resources/components-prod.properties
   trunk/seam-gen/resources/components-test.properties
   trunk/seam-gen/resources/datasource-ds.xml
   trunk/seam-gen/src/Authenticator.java
Log:
JBSEAM-1619
use same build.xml and components.xml source file for both RichFaces and ICEfaces build
add target for adding ivy support to build (add-ivy)


Modified: trunk/seam-gen/build-scripts/build-war.xml
===================================================================
--- trunk/seam-gen/build-scripts/build-war.xml	2009-03-12 23:39:22 UTC (rev 10153)
+++ trunk/seam-gen/build-scripts/build-war.xml	2009-03-14 00:01:28 UTC (rev 10154)
@@ -9,6 +9,8 @@
 
     <!-- set global properties for this build -->
     <property name="project.name" value="@projectName@"/>
+    <property name="project.war" value="true"/>
+    <property name="richfaces.present" value="true"/>
     <property name="dist.dir" value="dist" />
     <property name="src.model.dir" value="src/main" />
     <property name="src.action.dir" value="src/hot" />
@@ -16,6 +18,7 @@
     <property name="lib.dir" value="lib" />
     <property name="endorsed.dir" value="${lib.dir}/endorsed" />
     <property name="war.dir" value="exploded-archives/${project.name}.war" />
+    <property name="exploded.archive.dir" value="${war.dir}" />
     <property name="classes.model.dir" value="${war.dir}/WEB-INF/classes" />
     <property name="action.dir" value="WEB-INF/classes" />
     <property name="classes.action.dir" value="${war.dir}/${action.dir}" />
@@ -24,6 +27,7 @@
     <property name="jboss.domain" value="default"/>
     <property name="deploy.dir" value="${jboss.home}/server/${jboss.domain}/deploy" />
     <property name="war.deploy.dir" value="${deploy.dir}/${project.name}.war" />
+    <property name="packaged.archive" value="${dist.dir}/${project.name}.war"/>
     <property name="testng.jar" value="${basedir}/lib/testng.jar" />
     <property name="javac.debug" value="true" />
     <property name="javac.deprecation" value="false" />
@@ -43,6 +47,9 @@
         <fileset refid="lib" />
     </path>
 
+    <!-- Import GlassFish deployment targets -->
+    <import file="${basedir}/glassfish-build.xml"/>
+
     <target name="init" description="Initialize the build">
 
         <taskdef name="groovyc"
@@ -52,6 +59,29 @@
         <mkdir dir="${classes.model.dir}" />
         <mkdir dir="${classes.action.dir}" />
         <mkdir dir="${dist.dir}" />
+
+        <property name="transactionManagerLookupClass" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
+        <property name="ejbJndiPattern" value="${project.name}/#{ejbName}/local"/>
+        <condition property="seamBootstrapsPu" value="false" else="true">
+            <available file="${jboss.home}/lib/jboss-vfs.jar"/> <!-- JBoss AS >= 5.0 -->
+        </condition>
+        <condition property="seamEmfRef" value="#{entityManagerFactory}" else="#{null}">
+            <equals arg1="${seamBootstrapsPu}" arg2="true"/>
+        </condition>
+        <condition property="puJndiName" value="#{null}" else="java:comp/env/${project.name}/pu">
+            <equals arg1="${seamBootstrapsPu}" arg2="true"/>
+        </condition>
+
+        <filterset id="persistence">
+            <filter token="transactionManagerLookupClass" value="${transactionManagerLookupClass}"/>
+        </filterset>
+        <filterset id="seam">
+            <filter token="ejbJndiPattern" value="${ejbJndiPattern}"/>
+            <filter token="seamBootstrapsPu" value="${seamBootstrapsPu}"/>
+            <filter token="seamEmfRef" value="${seamEmfRef}"/>
+            <filter token="puJndiName" value="${puJndiName}"/>
+        </filterset>
+
         <!-- if a .groovy file is in model or action, set groovy.present -->
         <available property="groovy.present" value="true" file="" searchparents="true">
             <filepath>
@@ -176,11 +206,15 @@
 
         <copy tofile="${war.dir}/WEB-INF/classes/components.properties" 
               file="${basedir}/resources/components-${profile}.properties"
-              overwrite="true"/>
+              overwrite="true">
+            <filterset refid="seam"/>
+        </copy>
 
         <copy tofile="${war.dir}/WEB-INF/classes/META-INF/persistence.xml" 
               file="${basedir}/resources/META-INF/persistence-${profile}.xml"
-              overwrite="true"/>
+              overwrite="true">
+            <filterset refid="persistence"/>
+        </copy>
         
         <copy tofile="${war.dir}/WEB-INF/classes/import.sql" 
               file="${basedir}/resources/import-${profile}.sql"
@@ -210,25 +244,26 @@
             <fileset dir="${lib.dir}">
                 <includesfile name="deployed-jars.list"/>
                 <exclude name="jboss-seam-gen.jar"/>
+                <exclude name="icefaces-ahs.jar" if="icefaces.present"/>
                 <include name="groovy-*.jar" if="groovy.present"/>
             </fileset>
         </copy>
 
         <copy todir="${war.dir}/WEB-INF/classes">
             <fileset dir="${basedir}/resources"> 
-                <include name="**/*.xcss"/>
+                <include name="**/*.xcss" if="richfaces.present"/>
             </fileset>
             <!-- move XCSS into classpath for now
                  loading from web context only works in JBoss AS 4 -->
             <fileset dir="${basedir}/view"> 
-                <include name="**/*.xcss"/>
+                <include name="**/*.xcss" if="richfaces.present"/>
             </fileset>
         </copy>
         
         <copy todir="${war.dir}/WEB-INF/classes">
             <fileset dir="${basedir}/resources"> 
                 <include name="messages*.properties"/>
-                <include name="*.skin.properties"/>
+                <include name="*.skin.properties" if="ricfaces.present"/>
                 <include name="*_theme.properties"/>
             </fileset>
         </copy>
@@ -441,5 +476,13 @@
         </unjar>
         <ant antfile="validate.xml" target="validateConfiguration"/>
     </target>
-    
+
+    <target name="purge" depends="undeploy" description="Clean out JBoss AS temporary deployment files">
+        <delete dir="${jboss.home}/server/default/tmp/deploy"/>
+        <mkdir dir="${jboss.home}/server/default/tmp/deploy/"/>
+        <delete dir="${jboss.home}/server/default/tmp/sessions"/>
+        <mkdir dir="${jboss.home}/server/default/tmp/sessions"/>
+        <delete dir="${jboss.home}/server/default/work/jboss.web/localhost/${project.name}"/>
+    </target>
+
 </project>

Modified: trunk/seam-gen/build-scripts/build.properties
===================================================================
--- trunk/seam-gen/build-scripts/build.properties	2009-03-12 23:39:22 UTC (rev 10153)
+++ trunk/seam-gen/build-scripts/build.properties	2009-03-14 00:01:28 UTC (rev 10154)
@@ -1,2 +1,4 @@
-jboss.home = @jbossHome@
-jboss.domain = default
+jboss.home=@jbossHome@
+jboss.domain=default
+glassfish.home=@glassfishHome@
+glassfish.domain=domain1

Modified: trunk/seam-gen/build-scripts/build.xml
===================================================================
--- trunk/seam-gen/build-scripts/build.xml	2009-03-12 23:39:22 UTC (rev 10153)
+++ trunk/seam-gen/build-scripts/build.xml	2009-03-14 00:01:28 UTC (rev 10154)
@@ -9,6 +9,8 @@
 
     <!-- set global properties for this build -->
     <property name="project.name" value="@projectName@"/>
+    <property name="project.ear" value="true"/>
+    <property name="richfaces.present" value="true"/>
     <property name="dist.dir" value="dist"/>
     <property name="src.model.dir" value="src/main"/>
     <property name="src.action.dir" value="src/hot"/>
@@ -16,8 +18,9 @@
     <property name="lib.dir" value="lib"/>
     <property name="endorsed.dir" value="${lib.dir}/endorsed"/>
     <property name="ear.dir" value="exploded-archives/${project.name}.ear"/>
-    <property name="jar.dir" value="${ear.dir}/${project.name}.jar"/>
-    <property name="war.dir" value="${ear.dir}/${project.name}.war"/>
+    <property name="exploded.archive.dir" value="${ear.dir}"/>
+    <property name="jar.dir" value="${ear.dir}/${project.name}_jar"/>
+    <property name="war.dir" value="${ear.dir}/${project.name}_war"/>
     <property name="test.dir" value="test-build"/>
     <property name="bootstrap.dir" value="${basedir}/bootstrap"/>
     <property name="jboss.domain" value="default"/>
@@ -25,6 +28,7 @@
     <property name="ear.deploy.dir" value="${deploy.dir}/${project.name}.ear"/>
     <property name="jar.deploy.dir" value="${ear.deploy.dir}/${project.name}.jar"/>
     <property name="war.deploy.dir" value="${ear.deploy.dir}/${project.name}.war"/>
+    <property name="packaged.archive" value="${dist.dir}/${project.name}.ear"/>
     <property name="testng.jar" value="${basedir}/lib/testng.jar"/>
     <property name="javac.debug" value="true"/>
     <property name="javac.deprecation" value="false"/>
@@ -44,6 +48,9 @@
         <fileset refid="lib"/>
     </path>
 
+    <!-- Import GlassFish deployment targets -->
+    <import file="${basedir}/glassfish-build.xml"/>
+
     <target name="init" description="Initialize the build">
         <taskdef name="groovyc"
             classname ="org.codehaus.groovy.ant.Groovyc"
@@ -52,6 +59,25 @@
         <mkdir dir="${ear.dir}"/>
         <mkdir dir="${war.dir}"/>
         <mkdir dir="${dist.dir}"/>
+
+        <property name="transactionManagerLookupClass" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
+        <property name="ejbJndiPattern" value="${project.name}/#{ejbName}/local"/>
+        <property name="seamBootstrapsPu" value="false"/>
+        <property name="seamEmfRef" value="#{null}"/>
+        <condition property="puJndiName" value="java:comp/env/${project.name}/pu" else="java:/${project.name}EntityManagerFactory">
+            <available file="${jboss.home}/lib/jboss-vfs.jar"/> <!-- JBoss AS >= 5.0 -->
+        </condition>
+
+        <filterset id="persistence">
+            <filter token="transactionManagerLookupClass" value="${transactionManagerLookupClass}"/>
+        </filterset>
+        <filterset id="seam">
+            <filter token="ejbJndiPattern" value="${ejbJndiPattern}"/>
+            <filter token="seamBootstrapsPu" value="${seamBootstrapsPu}"/>
+            <filter token="seamEmfRef" value="${seamEmfRef}"/>
+            <filter token="puJndiName" value="${puJndiName}"/>
+        </filterset>
+
         <!-- if a .groovy file is in model or action, set groovy.present -->
         <available property="groovy.present" value="true" file="" searchparents="true">
             <filepath>
@@ -158,7 +184,9 @@
         </copy>
         <copy tofile="${jar.dir}/META-INF/persistence.xml"
             file="${basedir}/resources/META-INF/persistence-${profile}.xml"
-            overwrite="true"/>
+            overwrite="true">
+            <filterset refid="persistence"/>
+        </copy>
         <copy tofile="${jar.dir}/import.sql"
             file="${basedir}/resources/import-${profile}.sql"
             overwrite="true"/>
@@ -171,7 +199,9 @@
         </copy>
         <copy tofile="${war.dir}/WEB-INF/classes/components.properties"
             file="${basedir}/resources/components-${profile}.properties"
-            overwrite="true"/>
+            overwrite="true">
+            <filterset refid="seam"/>
+        </copy>
         <copy todir="${war.dir}/WEB-INF">
             <fileset dir="${basedir}/resources/WEB-INF">
                 <include name="*.*"/>
@@ -193,18 +223,18 @@
         </copy>
         <copy todir="${war.dir}/WEB-INF/classes">
             <fileset dir="${basedir}/resources">
-                <include name="**/*.xcss"/>
+                <include name="**/*.xcss" if="richfaces.present"/>
             </fileset>
             <!-- move XCSS into classpath for now
                  loading from web context only works in JBoss AS 4 -->
             <fileset dir="${basedir}/view">
-                <include name="**/*.xcss"/>
+                <include name="**/*.xcss" if="richfaces.present"/>
             </fileset>
         </copy>
         <copy todir="${war.dir}/WEB-INF/classes">
             <fileset dir="${basedir}/resources">
                 <include name="messages*.properties"/>
-                <include name="*.skin.properties"/>
+                <include name="*.skin.properties" if="richfaces.present"/>
                 <include name="*_theme.properties"/>
             </fileset>
         </copy>
@@ -224,6 +254,7 @@
         <copy todir="${ear.dir}/lib">
             <fileset dir="${lib.dir}">
                 <includesfile name="deployed-jars-ear.list"/>
+                <exclude name="icefaces-ahs.jar" if="icefaces.present"/>
             </fileset>
         </copy>
         <copy todir="${ear.dir}/META-INF">
@@ -242,8 +273,8 @@
         <jar jarfile="${dist.dir}/${project.name}.war" basedir="${war.dir}"/>
         <jar jarfile="${dist.dir}/${project.name}.ear">
             <fileset dir="${ear.dir}">
-                <exclude name="${project.name}.jar/**"/>
-                <exclude name="${project.name}.war/**"/>
+                <exclude name="${project.name}_jar/**"/>
+                <exclude name="${project.name}_war/**"/>
             </fileset>
             <fileset dir="${dist.dir}">
                 <include name="${project.name}.jar"/>
@@ -263,8 +294,18 @@
         <fail unless="jboss.home">jboss.home not set</fail>
 
         <copy todir="${ear.deploy.dir}">
-            <fileset dir="${ear.dir}"/>
+            <fileset dir="${ear.dir}">
+				<include name="**/*"/>
+				<exclude name="${project.name}_jar/**"/>
+				<exclude name="${project.name}_war/**"/>
+			</fileset>
         </copy>
+		<copy todir="${jar.deploy.dir}">
+			<fileset dir="${jar.dir}"/>
+		</copy>
+		<copy todir="${war.deploy.dir}">
+			<fileset dir="${war.dir}"/>
+		</copy>
     </target>
 
     <target name="unexplode" description="Undeploy the exploded archive">
@@ -443,4 +484,12 @@
         <ant antfile="validate.xml" target="validateConfiguration"/>
     </target>
 
+    <target name="purge" depends="undeploy" description="Clean out JBoss AS temporary deployment files">
+        <delete dir="${jboss.home}/server/default/tmp/deploy"/>
+        <mkdir dir="${jboss.home}/server/default/tmp/deploy/"/>
+        <delete dir="${jboss.home}/server/default/tmp/sessions"/>
+        <mkdir dir="${jboss.home}/server/default/tmp/sessions"/>
+        <delete dir="${jboss.home}/server/default/work/jboss.web/localhost/${project.name}"/>
+    </target>
+
 </project>

Added: trunk/seam-gen/build-scripts/glassfish-build.xml
===================================================================
--- trunk/seam-gen/build-scripts/glassfish-build.xml	                        (rev 0)
+++ trunk/seam-gen/build-scripts/glassfish-build.xml	2009-03-14 00:01:28 UTC (rev 10154)
@@ -0,0 +1,191 @@
+<?xml version="1.0"?>
+<project name="@projectName at -glassfish" basedir=".">
+    <!-- This file consists of Ant deployment targets for the GlassFish Application Server -->
+    <!-- Import this script into your Ant build using <import file="${basedir}/glassfish.build.xml"/> -->
+
+    <macrodef name="asadmin">
+        <attribute name="cmd"/>
+        <attribute name="args" default=""/>
+        <attribute name="log" default="true"/>
+        <element name="pre-conditions" optional="true"/>
+        <sequential>
+            <fail message="glassfish.home not set" unless="glassfish.home"/>
+            <fail message="glassfish.home does not point to a valid GlassFish installation">
+                <condition>
+                    <or>
+                        <length string="${glassfish.home}" trim="true" length="0"/>
+                        <not><available file="${glassfish.home}/bin/asadmin"/></not>
+                    </or>
+                </condition>
+            </fail>
+            <condition property="glassfish.domains.dir" value="${glassfish.home}/glassfish/domains" else="${glassfish.home}/domains">
+                <available file="${glassfish.home}/glassfish" type="dir"/>
+            </condition>
+            <fail message="glassfish.domain not set" unless="glassfish.domain"/>
+            <fail message="glassfish.domain not a valid GlassFish domain">
+                <condition>
+                    <or>
+                        <length string="${glassfish.domain}" trim="true" length="0"/>
+                        <not><available file="${glassfish.domains.dir}/${glassfish.domain}" type="dir"/></not>
+                    </or>
+                </condition>
+            </fail>
+            <pre-conditions/>
+            <exec executable="${glassfish.home}/bin/asadmin">
+                <arg value="@{cmd}"/>
+                <arg line="@{args}"/>
+                <redirector outputproperty="gf.cmd.output" alwayslog="@{log}"/>
+            </exec> 
+        </sequential>
+    </macrodef>
+
+    <target name="gf-init" description="Prepare properties for GlassFish">
+        <property name="transactionManagerLookupClass" value="org.hibernate.transaction.SunONETransactionManagerLookup"/>
+        <property name="ejbJndiPattern" value="java:comp/env/${project.name}/#{ejbName}/local"/>
+        <property name="seamBootstrapsPu" value="false"/>
+        <property name="seamEmfRef" value="#{null}"/>
+        <property name="puJndiName" value="java:comp/env/${project.name}/pu"/>
+    </target>
+
+    <target name="gf-start" description="Starts GlassFish">
+        <asadmin cmd="start-domain" args="${glassfish.domain}"/>
+    </target>
+
+    <target name="gf-debug" description="Starts GlassFish in debug mode">
+        <asadmin cmd="start-domain" args="--debug=true ${glassfish.domain}"/>
+    </target>
+
+    <target name="gf-stop" description="Stops GlassFish">
+        <asadmin cmd="stop-domain" args="${glassfish.domain}"/>
+    </target>
+
+    <target name="gf-reboot" depends="gf-stop,gf-start" description="Restarts GlassFish"/>
+
+    <target name="gf-list-components" description="List archives deployed to GlassFish">
+        <asadmin cmd="list-components"/>
+    </target>
+
+    <target name="gf-list-jdbc-resources" description="List archives deployed to GlassFish">
+        <asadmin cmd="list-jdbc-resources"/>
+    </target>
+
+    <target name="gf-check-datasource" description="Check if the datasource is registered with GlassFish">
+        <asadmin cmd="list-jdbc-resources" log="false"/>
+        <condition property="gf.needs.datasource">
+            <not><contains string="${gf.cmd.output}" substring="${project.name}Datasource"/></not>
+        </condition>
+    </target>
+
+    <target name="gf-datasource" depends="gf-check-datasource" if="gf.needs.datasource"
+        description="Register the datasource in GlassFish">
+        <asadmin cmd="add-resources" args="${basedir}/resources/glassfish-resources-${profile}.xml"/>
+    </target>
+
+    <target name="gf-cleanup-ear" if="project.ear">
+        <move todir="${war.dir}/WEB-INF/classes">
+            <fileset dir="${jar.dir}">
+                <include name="META-INF/orm.xml" if="project.ear"/>
+                <include name="META-INF/persistence.xml" if="project.ear"/>
+            </fileset>
+        </move>
+	</target>
+
+    <target name="gf-check-seam-exploded" if="project.ear">
+        <!-- This file has to be deleted each time since the exploded directory has a different name (doesn't block it) -->
+        <delete file="${ear.dir}/jboss-seam.jar"/>
+        <condition property="gf.explode.seam">
+            <and>
+                <isset property="project.ear"/>
+                <not><available file="${ear.dir}/jboss-seam_jar" type="dir"/></not>
+            </and>
+        </condition>
+    </target>
+
+    <target name="gf-explode-seam" depends="gf-check-seam-exploded" if="gf.explode.seam">
+        <mkdir dir="${ear.dir}/jboss-seam_jar"/>
+        <unjar src="${lib.dir}/jboss-seam.jar" dest="${ear.dir}/jboss-seam_jar"/>
+    </target>
+
+    <target name="gf-explode" depends="gf-stage,gf-explode-seam,gf-datasource"
+        description="Deploy the exploded archive to GlassFish">
+        <asadmin cmd="deploy" args="--name ${project.name} ${exploded.archive.dir}"/>
+    </target>
+
+    <target name="gf-reexplode" depends="clean,gf-undeploy,gf-explode"
+        description="Clean and deploy the exploded archive to GlassFish"/>
+
+    <target name="gf-hotdeploy" depends="gf-stage" description="Publish hot deployable artifacts."/>
+
+    <target name="gf-stage" depends="gf-init,stage" description="Prepare the exploded archive targeting GlassFish.">
+		<antcall target="gf-cleanup-ear"/>
+	</target>
+
+    <target name="gf-archive" depends="gf-stage,archive" description="Prepare a packaged archive targeting GlassFish."/>
+
+    <target name="gf-deploy" depends="gf-archive,gf-datasource"
+        description="Deploy the packaged archive to GlassFish">
+        <asadmin cmd="deploy" args="--name ${project.name} ${packaged.archive}"/>
+    </target>
+
+    <target name="gf-unexplode" depends="gf-undeploy"/>
+
+    <target name="gf-undeploy" description="Undeploy the archive from GlassFish">
+        <asadmin cmd="undeploy" args="${project.name}"/>
+        <asadmin cmd="delete-jdbc-resource" args="${project.name}Datasource"/>
+        <asadmin cmd="delete-jdbc-connection-pool" args="${project.name}Pool"/>
+        <!-- Duplicate last two lines for each JDBC resource -->
+    </target>
+
+    <target name="gf-prepare" depends="gf-stop,gf-deploy-hibernate"
+        description="Prepares GlassFish to run a Seam application"/>
+
+    <target name="gf-deploy-hibernate" description="Deploys Hibernate to be a JPA provider on GlassFish">
+        <fail message="glassfish.home not set" unless="glassfish.home"/>
+        <fail message="glassfish.home does not point to a valid GlassFish installation">
+            <condition>
+                <or>
+                    <length string="${glassfish.home}" trim="true" length="0"/>
+                    <not><available file="${glassfish.home}/bin/asadmin"/></not>
+                </or>
+            </condition>
+        </fail>
+        <condition property="glassfish.v3" value="true">
+            <available file="${glassfish.home}/glassfish" type="dir"/>
+        </condition>
+        <condition property="glassfish.domains.dir" value="${glassfish.home}/glassfish/domains" else="${glassfish.home}/domains">
+            <isset property="glassfish.v3"/>
+        </condition>
+        <fail message="glassfish.domain not set" unless="glassfish.domain"/>
+        <fail message="glassfish.domain not a valid GlassFish domain">
+            <condition>
+                <or>
+                    <length string="${glassfish.domain}" trim="true" length="0"/>
+                    <not><available file="${glassfish.domains.dir}/${glassfish.domain}" type="dir"/></not>
+                </or>
+            </condition>
+        </fail>
+        <copy todir="${glassfish.domains.dir}/${glassfish.domain}/lib/ext" overwrite="true">
+            <fileset dir="${basedir}/lib">
+                <include name="antlr.jar"/>
+                <include name="asm.jar" unless="glassfish.v3"/>
+                <include name="asm-attrs.jar" unless="glassfish.v3"/>
+                <include name="cglib.jar" unless="glassfish.v3"/>
+                <include name="cglib-nodep.jar" if="glassfish.v3"/>
+                <include name="commons-collections.jar"/>
+                <include name="commons-logging.jar"/>
+                <include name="concurrent.jar"/>
+                <include name="dom4j.jar"/>
+                <include name="hibernate.jar"/>
+                <include name="hibernate-*.jar"/>
+                <exclude name="hibernate-search.jar"/>
+                <include name="javassist.jar"/>
+                <include name="jboss-common-core.jar"/>
+                <include name="jta.jar"/>
+                <include name="persistence-api.jar"/>
+                <!-- Include any required JDBC driver JARs below -->
+                <include name="@driverJar@"/>
+            </fileset>
+        </copy>
+    </target>
+
+</project>

Added: trunk/seam-gen/build-scripts/glassfish-readme.txt
===================================================================
--- trunk/seam-gen/build-scripts/glassfish-readme.txt	                        (rev 0)
+++ trunk/seam-gen/build-scripts/glassfish-readme.txt	2009-03-14 00:01:28 UTC (rev 10154)
@@ -0,0 +1,21 @@
+GlassFish deployment works out of the box for WAR projects. To deploy an EAR project, make the following changes:
+
+1. Uncomment the <ejb-local-ref> entries in resources/WEB-INF/web.xml (include additional entries as necessary)
+2. Strip the contents up to and including the # in the element <persistence-unit-name> in resources/WEB-INF/web.xml
+3. Uncomment the <jar-file> element in resources/META-INF/persistence-dev.xml & resources/META-INF/persistence-prod.xml
+
+GlassFish command reference:
+
+gf-start - Starts GlassFish
+gf-debug - Starts GlassFish in debug mode
+gf-stop - Stops GlassFish
+gf-reboot - Restarts GlassFish
+gf-datasource - Registers the datasource and connection pool
+gf-explode - Deploys the exploded archive to GlassFish (restarts application if already deployed)
+gf-hotdeploy - Hot deploys Java classes, Seam components, and view resources
+gf-deploy - Deploys the packaged archive to GlassFish
+gf-undeploy - Undeploys the exploded or packaged archive from GlassFish
+gf-stage - Prepares an exploded archive targeting GlassFish
+gf-archive - Prepares a packaged archive targeting GlassFish
+gf-prepare - Prepares GlassFish for a seam-gen project deployment (calls gf-deploy-hibernate)
+gf-deploy-hibernate - Deploys Hibernate as a JPA provider to GlassFish

Modified: trunk/seam-gen/build.xml
===================================================================
--- trunk/seam-gen/build.xml	2009-03-12 23:39:22 UTC (rev 10153)
+++ trunk/seam-gen/build.xml	2009-03-14 00:01:28 UTC (rev 10154)
@@ -24,6 +24,7 @@
     </condition>
 
     <property file="${seam-gen.properties}"/>
+    <property name="glassfish.home" value=""/>
     <import file="${seam.dir}/build/common.build.xml"/>
 
     <target name="init">
@@ -137,6 +138,7 @@
         <filterset id="jdbc">
             <filter token="jdbcUrl" value="${hibernate.connection.url}"/>
             <filter token="driverClass" value="${hibernate.connection.driver_class}"/>
+            <filter token="dataSourceClass" value="${hibernate.connection.dataSource_class}"/>
             <filter token="username" value="${hibernate.connection.username}"/>
             <filter token="password" value="${hibernate.connection.password}"/>
             <filter token="catalogProperty" value="${catalog.property}"/>
@@ -153,6 +155,7 @@
             <filter token="testPackage" value="${test.package}"/>
             <filter token="deploymentType" value="${project.type}"/>
             <filter token="jbossHome" value="${jboss.home}"/>
+            <filter token="glassfishHome" value="${glassfish.home}"/>
             <filter token="iceHome" value="${icefaces.home}"/>
             <filter token="hbm2ddl" value="${hibernate.hbm2ddl.auto}"/>
             <filter token="driverJar" value="${driver.file}"/>
@@ -258,7 +261,7 @@
         <property name="database.type.default" value="hsql"/>
         <input addproperty="database.type.new"
                    message="What kind of database are you using? [${database.type.default}]"
-                 validargs="hsql,mysql,oracle,postgres,mssql,db2,sybase,enterprisedb,h2"
+                 validargs="hsql,mysql,derby,oracle,postgres,mssql,db2,sybase,enterprisedb,h2"
               defaultvalue="${database.type.default}"/>
 
         <!-- if the database type did not change, default to the previous values -->
@@ -284,6 +287,9 @@
         <condition property="hibernate.dialect.default" value="org.hibernate.dialect.MySQLDialect">
             <equals arg1="${database.type.new}" arg2="mysql"/>
         </condition>
+        <condition property="hibernate.dialect.default" value="org.hibernate.dialect.DerbyDialect">
+            <equals arg1="${database.type.new}" arg2="derby"/>
+        </condition>
         <condition property="hibernate.dialect.default" value="org.hibernate.dialect.OracleDialect">
             <equals arg1="${database.type.new}" arg2="oracle"/>
         </condition>
@@ -311,6 +317,9 @@
         <condition property="hibernate.connection.driver_class.default" value="com.mysql.jdbc.Driver">
             <equals arg1="${database.type.new}" arg2="mysql"/>
         </condition>
+        <condition property="hibernate.connection.driver_class.default" value="org.apache.derby.jdbc.EmbeddedDriver">
+            <equals arg1="${database.type.new}" arg2="derby"/>
+        </condition>
         <condition property="hibernate.connection.driver_class.default" value="oracle.jdbc.driver.OracleDriver">
             <equals arg1="${database.type.new}" arg2="oracle"/>
         </condition>
@@ -329,6 +338,36 @@
         <condition property="hibernate.connection.driver_class.default" value="com.edb.Driver">
             <equals arg1="${database.type.new}" arg2="enterprisedb"/>
         </condition>
+        <condition property="hibernate.connection.dataSource_class.default" value="org.h2.jdbcx.JdbcDataSource">
+            <equals arg1="${database.type.new}" arg2="h2"/>
+        </condition>
+        <condition property="hibernate.connection.dataSource_class.default" value="org.hsqldb.jdbc.jdbcDataSource">
+            <equals arg1="${database.type.new}" arg2="hsql"/>
+        </condition>
+        <condition property="hibernate.connection.dataSource_class.default" value="com.mysql.jdbc.jdbc2.optional.MysqlDataSource">
+            <equals arg1="${database.type.new}" arg2="mysql"/>
+        </condition>
+        <condition property="hibernate.connection.dataSource_class.default" value="org.apache.derby.jdbc.EmbeddedDataSource">
+            <equals arg1="${database.type.new}" arg2="derby"/>
+        </condition>
+        <condition property="hibernate.connection.dataSource_class.default" value="oracle.jdbc.pool.OracleDataSource">
+            <equals arg1="${database.type.new}" arg2="oracle"/>
+        </condition>
+        <condition property="hibernate.connection.dataSource_class.default" value="org.postgresql.jdbc3.Jdbc3ConnectionPool">
+            <equals arg1="${database.type.new}" arg2="postgres"/>
+        </condition>
+        <condition property="hibernate.connection.dataSource_class.default" value="com.microsoft.sqlserver.jdbc.SQLServerDataSource">
+            <equals arg1="${database.type.new}" arg2="mssql"/>
+        </condition>
+        <condition property="hibernate.connection.dataSource_class.default" value="com.ibm.db2.jcc.DB2SimpleDataSource">
+            <equals arg1="${database.type.new}" arg2="db2"/>
+        </condition>
+        <condition property="hibernate.connection.dataSource_class.default" value="com.sybase.jdbc3.jdbc.SybDataSource">
+            <equals arg1="${database.type.new}" arg2="sybase"/>
+        </condition>
+        <condition property="hibernate.connection.dataSource_class.default" value="com.edb.jdbc3.Jdbc3Connection">
+            <equals arg1="${database.type.new}" arg2="enterprisedb"/>
+        </condition>
 
         <condition property="hibernate.connection.url.default" value="jdbc:h2:.">
             <equals arg1="${database.type.new}" arg2="h2"/>
@@ -339,6 +378,9 @@
         <condition property="hibernate.connection.url.default" value="jdbc:mysql:///test">
             <equals arg1="${database.type.new}" arg2="mysql"/>
         </condition>
+        <condition property="hibernate.connection.url.default" value="jdbc:derby:test;create=true">
+            <equals arg1="${database.type.new}" arg2="derby"/>
+        </condition>
         <condition property="hibernate.connection.url.default" value="jdbc:oracle:thin:@localhost:1521:test">
             <equals arg1="${database.type.new}" arg2="oracle"/>
         </condition>
@@ -362,6 +404,7 @@
 
         <property name="hibernate.dialect.default" value="org.hibernate.dialect.HSQLDialect"/>
         <property name="hibernate.connection.driver_class.default" value="org.hsqldb.jdbcDriver"/>
+        <property name="hibernate.connection.dataSource_class.default" value="org.hsqldb.jdbc.jdbcDataSource"/>
         <property name="hibernate.connection.url.default" value="jdbc:hsqldb:."/>
 
         <input addproperty="hibernate.dialect.new"
@@ -377,6 +420,10 @@
                    message="Enter JDBC driver class for your database [${hibernate.connection.driver_class.default}]"
               defaultvalue="${hibernate.connection.driver_class.default}"/>
 
+        <input addproperty="hibernate.connection.dataSource_class.new"
+                   message="Enter JDBC DataSource class for your database [${hibernate.connection.dataSource_class.default}]"
+              defaultvalue="${hibernate.connection.dataSource_class.default}"/>
+
         <input addproperty="hibernate.connection.url.new"
                    message="Enter the JDBC URL for your database [${hibernate.connection.url.default}]"
               defaultvalue="${hibernate.connection.url.default}"/>
@@ -455,6 +502,7 @@
             <entry key="driver.jar" value="${driver.jar.new}"/>
             <entry key="hibernate.dialect" value="${hibernate.dialect.new}"/>
             <entry key="hibernate.connection.driver_class" value="${hibernate.connection.driver_class.new}"/>
+            <entry key="hibernate.connection.dataSource_class" value="${hibernate.connection.dataSource_class.new}"/>
             <entry key="hibernate.connection.url" value="${hibernate.connection.url.new}"/>
             <entry key="hibernate.connection.username" value="${hibernate.connection.username.new}"/>
             <entry key="hibernate.connection.password" value="${hibernate.connection.password.new}"/>
@@ -471,11 +519,13 @@
     </target>
 
     <target name="icefaces-staging-copy" if="icefaces.property">
-        <echo message="Set up the icefaces directory"/>
+        <echo message="Setting up the ICEfaces staging directory"/>
+        <delete dir="icefaces-staging"/>
         <copy todir="icefaces-staging">
             <fileset dir="${seam-gen.dir}">
                 <include name="build-scripts/**"/>
                 <include name="ide-project-files/**"/>
+                <include name="ivy/**"/>
                 <include name="hibernatetools/**"/>
                 <include name="lib/**"/>
                 <include name="resources/**"/>
@@ -495,8 +545,50 @@
                 <include name="view/**"/>
             </fileset>
         </copy>
+        <replace dir="icefaces-staging/build-scripts">
+            <include name="build.xml"/>
+            <include name="build-war.xml"/>
+            <replacetoken><![CDATA[<property name="richfaces.present" value="true"/>]]></replacetoken>
+            <replacevalue><![CDATA[<property name="icefaces.present" value="true"/>]]></replacevalue>
+        </replace>
+        <replace dir="icefaces-staging/build-scripts">
+            <include name="build.xml"/>
+            <include name="build-war.xml"/>
+            <replacetoken><![CDATA[</project>]]></replacetoken>
+            <replacevalue><![CDATA[    <target name="freshen" description="Grab fresh ICEfaces jars">
+        <fail message="icefaces.home not set" unless="icefaces.home"/>
+        <fail message="icefaces.home is not a valid directory">
+            <condition>
+                <or>
+                    <length string="${icefaces.home}" trim="true" length="0"/>
+                    <not><available file="${icefaces.home}" type="dir"/></not>
+                </or>
+            </condition>
+        </fail>
+        <copy todir="${lib.dir}">
+            <fileset dir="${icefaces.home}/lib">
+                <include name="icefaces*.jar"/>
+                <include name="backport-util-concurrent.jar"/>
+                <include name="commons-fileupload.jar"/>
+                <include name="commons-digester.jar"/>
+                <exclude name="icefaces-ahs.jar"/>
+            </fileset>
+        </copy>
     </target>
 
+</project>]]></replacevalue>
+        </replace>
+        <replace dir="icefaces-staging/resources">
+            <include name="WEB-INF/components.xml"/>
+            <include name="WEB-INF/components-war.xml"/>
+            <replacetoken><![CDATA[<core:init debug="@debug@" jndi-pattern="@jndiPattern@"/>]]></replacetoken>
+            <replacevalue><![CDATA[<core:init debug="@debug@" jndi-pattern="@jndiPattern@"/>
+
+   <component name="renderManager" scope="application" class="com.icesoft.faces.async.render.RenderManager" auto-create="true"/>]]></replacevalue>
+        </replace>
+        <echo file="icefaces-staging/build-scripts/build.properties" append="true">icefaces.home=@iceHome@</echo>
+    </target>
+
     <target name="action-input" depends="init">
 
         <input addproperty="component.name" message="Enter the Seam component name"/>
@@ -573,7 +665,6 @@
             The entity ${entity.name} was not found.  It was expected to be in ${entity.file}.
         </fail>
 
-
         <uncapitalizeProperty name="component.name.default" value="${entity.name}Query"/>
         <input addproperty="component.name"
             message="Enter the Seam query component name [${component.name.default}]"
@@ -658,57 +749,74 @@
     </target>
 
     <target name="file-copy-war" if="project.war">
-        <echo message="Copying resources needed for WAR deployment to the ${project.home}/resources directory..."/>
 
-        <copy tofile="${project.home}/resources/WEB-INF/components.xml"
-                file="${templates.dir}/resources/WEB-INF/components-war.xml">
+        <echo message="Copying build scripts for WAR deployment to the ${project.home} directory..."/>
+        <copy todir="${project.home}">
+            <fileset dir="${templates.dir}/build-scripts">
+                <include name="glassfish-build.xml"/>
+                <include name="build-war.xml"/>
+            </fileset>
             <filterset refid="project"/>
+            <filterset refid="jdbc"/>
+            <filtermapper>
+                <replacestring from="-war.xml" to=".xml"/>
+            </filtermapper>
         </copy>
         <copy tofile="${project.home}/deployed-jars.list"
                 file="${templates.dir}/build-scripts/deployed-jars-war.list"/>
-        <copy tofile="${project.home}/build.xml"
-                file="${templates.dir}/build-scripts/build-war.xml">
-            <filterset refid="project"/>
-        </copy>
         <copy file="${seam.dir}/build/validate.xml" todir="${project.home}" overwrite="true"/>
+
+        <echo message="Copying resources needed for WAR deployment to the ${project.home}/resources directory..."/>
         <copy todir="${project.home}/resources">
-            <fileset dir="${templates.dir}/resources/">
+            <fileset dir="${templates.dir}/resources">
                 <include name="META-INF/orm.xml"/>
                 <include name="META-INF/persistence*-war.xml"/>
+                <include name="WEB-INF/components-war.xml"/>
                 <include name="WEB-INF/jboss-web.xml"/>
             </fileset>
             <filterset refid="project"/>
             <filterset refid="jdbc"/>
-            <globmapper from="*-war.xml" to="*.xml"/>
+            <filtermapper>
+                <replacestring from="-war.xml" to=".xml"/>
+            </filtermapper>
         </copy>
+        <!--
         <copy todir="${project.home}/src/hot" file="${templates.dir}/resources/seam.properties"/>
         <copy todir="${project.home}/src/main" file="${templates.dir}/resources/seam.properties"/>
+        -->
+        <copy tofile="${project.home}/src/${action.dir}/Authenticator.java"
+            file="${templates.dir}/src/AuthenticatorJavaBean.java">
+            <filterset refid="filters"/>
+        </copy>
     </target>
 
     <target name="file-copy-ear" unless="project.war">
-        <echo message="Copying resources needed for EAR deployment to the ${project.home}/resources directory..."/>
 
-        <copy tofile="${project.home}/resources/WEB-INF/components.xml"
-                 file="${templates.dir}/resources/WEB-INF/components.xml">
-             <filterset refid="project"/>
-         </copy>
+        <echo message="Copying build scripts for EAR deployment to the ${project.home} directory..."/>
+        <copy todir="${project.home}">
+            <fileset dir="${templates.dir}/build-scripts">
+                <include name="build.xml"/>
+                <include name="glassfish-build.xml"/>
+            </fileset>
+            <filterset refid="project"/>
+            <filterset refid="jdbc"/>
+        </copy>
         <copy tofile="${project.home}/deployed-jars-ear.list"
                 file="${templates.dir}/build-scripts/deployed-jars-ear.list"/>
         <copy tofile="${project.home}/deployed-jars-war.list"
                 file="${templates.dir}/build-scripts/deployed-jars-ear-war.list"/>
-        <copy tofile="${project.home}/build.xml"
-                file="${templates.dir}/build-scripts/build.xml">
-            <filterset refid="project"/>
-        </copy>
         <copy file="${seam.dir}/build/validate.xml" todir="${project.home}" overwrite="true"/>
+
+        <echo message="Copying resources needed for EAR deployment to the ${project.home}/resources directory..."/>
         <copy todir="${project.home}/resources">
-            <fileset dir="${templates.dir}/resources/">
+            <fileset dir="${templates.dir}/resources">
                 <include name="META-INF/application.xml"/>
+                <include name="META-INF/ejb-jar.xml"/>
                 <include name="META-INF/jboss-app.xml"/>
-                <include name="META-INF/ejb-jar.xml"/>
                 <include name="META-INF/orm.xml"/>
                 <include name="META-INF/persistence*.xml"/>
                 <exclude name="META-INF/persistence*-war.xml"/>
+                <include name="WEB-INF/components.xml"/>
             </fileset>
             <filterset refid="project"/>
             <filterset refid="jdbc"/>
@@ -732,6 +840,7 @@
         <copy todir="${project.home}/resources">
             <fileset dir="${templates.dir}/resources/">
                 <exclude name="datasource-ds.xml"/>
+                <exclude name="glassfish-resources.xml"/>
                 <exclude name="import.sql"/>
                 <exclude name="components-*.properties"/>
                 <exclude name="WEB-INF/components*.xml"/>
@@ -745,6 +854,48 @@
             <filterset refid="jdbc"/>
         </copy>
 
+        <replace dir="${project.home}/resources">
+            <include name="WEB-INF/web.xml" if="project.war"/>
+            <replacetoken><![CDATA[</web-app>]]></replacetoken>
+            <replacevalue><![CDATA[   <persistence-unit-ref>
+      <persistence-unit-ref-name>@projectName@/pu</persistence-unit-ref-name>
+      <persistence-unit-name>@projectName@</persistence-unit-name>
+   </persistence-unit-ref>
+
+</web-app>]]></replacevalue>
+
+        </replace>
+
+        <replace dir="${project.home}/resources">
+            <include name="WEB-INF/web.xml" if="project.ear"/>
+            <replacetoken><![CDATA[</web-app>]]></replacetoken>
+            <replacevalue><![CDATA[   <!-- uncomment <ejb-local-ref> entries when deploying to GlassFish and (optionally) JBoss AS 5 -->
+   <!--
+   <ejb-local-ref>
+      <ejb-ref-name>vehicles/AuthenticatorBean/local</ejb-ref-name>
+      <ejb-ref-type>Session</ejb-ref-type>
+      <local-home/>
+      <local>org.example.vehicles.action.Authenticator</local>
+   </ejb-local-ref>
+   -->
+
+   <!-- Add entries for each EJB session bean which is also a Seam component (not required on JBoss AS) -->
+
+   <persistence-unit-ref>
+      <persistence-unit-ref-name>@projectName@/pu</persistence-unit-ref-name>
+      <!-- The relative reference doesn't work on GlassFish. Instead, set the <persistence-unit-name> to "@projectName@",
+           package persistence.xml in the WAR, and add a <jar-file> element in persistence.xml with value "../../@projectName at .jar". -->
+      <persistence-unit-name>../@projectName at .jar#@projectName@</persistence-unit-name>
+   </persistence-unit-ref>
+
+</web-app>]]></replacevalue>
+
+        </replace>
+
+        <replace file="${project.home}/resources/WEB-INF/web.xml">
+            <replacefilter token="@projectName@" value="${project.name}"/>
+        </replace>
+
         <!-- Eclipse project files -->
         <copy todir="${project.home}">
             <fileset dir="${templates.dir}/ide-project-files/eclipse">
@@ -821,6 +972,18 @@
             <filterset refid="jdbc"/>
         </copy>
 
+        <copy tofile="${project.home}/resources/glassfish-resources-dev.xml"
+                file="${templates.dir}/resources/glassfish-resources.xml">
+            <filterset refid="project"/>
+            <filterset refid="jdbc"/>
+        </copy>
+
+        <copy tofile="${project.home}/resources/glassfish-resources-prod.xml"
+                file="${templates.dir}/resources/glassfish-resources.xml">
+            <filterset refid="project"/>
+            <filterset refid="jdbc"/>
+        </copy>
+
         <copy tofile="${project.home}/resources/import-dev.sql"
                 file="${templates.dir}/resources/import.sql">
             <filterset refid="project"/>
@@ -862,7 +1025,8 @@
 
         <copy todir="${project.home}/src/${action.dir}">
             <fileset dir="${templates.dir}/src/">
-                <include name="Authenticator.java"/>
+                <include name="Authenticator.java" if="project.ear"/>
+                <include name="AuthenticatorBean.java" if="project.ear"/>
                 <include name="Timer*.java" if="icefaces.property"/>
             </fileset>
             <filterset refid="filters"/>
@@ -875,6 +1039,8 @@
             <filterset refid="project"/>
         </copy>
 
+        <copy todir="${project.home}" file="${templates.dir}/build-scripts/glassfish-readme.txt"/>
+
         <mkdir dir="${project.home}/src/${model.dir}"/>
         <mkdir dir="${project.home}/src/${action.dir}"/>
         <mkdir dir="${project.home}/src/${test.dir}"/>
@@ -1122,6 +1288,21 @@
         <echo message="Type '${seam.cmd} restart' and go to http://localhost:8080/${project.name}/${masterPage.name}.seam"/>
     </target>
 
+    <target name="add-ivy" depends="validate-project" description="Add Ivy to the project for downloading dependencies">
+        <fail message="Currently the Ivy build is only configured to support RichFaces projects" if="icefaces.property"/>
+        <copy todir="${project.home}">
+            <fileset dir="${templates.dir}/ivy"/>
+            <filterset refid="project"/>
+        </copy>
+        <replace file="${project.home}/build.xml">
+            <replacetoken><![CDATA[<target name="init"]]></replacetoken>
+            <replacevalue><![CDATA[<!-- Import Ivy targets for downloading dependencies -->
+    <import file="${basedir}/ivy-build.xml"/>
+
+    <target name="init"]]></replacevalue>
+        </replace>
+    </target>
+
     <!-- Do not remove generate-entities, netbeans depends on it -->
     <target name="generate-entities" depends="generate"/>
     <target name="generate" depends="validate-project,generate-model,generate-ui"
@@ -1205,6 +1386,7 @@
                     <include name="**/*.war/WEB-INF/classes" if="project.war"/>
                     <include name="**/*.war/WEB-INF/dev" if="project.war"/>
                     <include name="**/*.jar" if="project.ear"/>
+                    <include name="**/*_jar" if="project.ear"/>
                 </dirset>
             </classpath>
             <property key="hibernatetool.util.toolclass" value="org.jboss.seam.tool.Util"/>
@@ -1325,6 +1507,7 @@
         <echo message="Hibernate dialect: ${hibernate.dialect}"/>
         <echo message="JDBC URL: ${hibernate.connection.url}"/>
         <echo message="JDBC driver class: ${hibernate.connection.driver_class}"/>
+        <echo message="JDBC DataSource class: ${hibernate.connection.dataSource_class}"/>
         <echo message="Database username: ${hibernate.connection.username}"/>
         <echo message="Database password: ${hibernate.connection.password}"/>
     </target>

Deleted: trunk/seam-gen/icefaces/build-scripts/build-war.xml
===================================================================
--- trunk/seam-gen/icefaces/build-scripts/build-war.xml	2009-03-12 23:39:22 UTC (rev 10153)
+++ trunk/seam-gen/icefaces/build-scripts/build-war.xml	2009-03-14 00:01:28 UTC (rev 10154)
@@ -1,454 +0,0 @@
-<?xml version="1.0"?>
-<project name="@projectName@" default="deploy" basedir=".">
-
-    <!-- Give user a chance to override without editing this file or typing -D -->
-    <property file="${basedir}/build.properties" />
-
-    <property name="profile" value="dev" />
-    <property file="build-${profile}.properties" />
-
-    <!-- set global properties for this build -->
-    <property name="project.name" value="@projectName@"/>
-    <property name="dist.dir" value="dist" />
-    <property name="src.model.dir" value="src/main" />
-    <property name="src.action.dir" value="src/hot" />
-    <property name="src.test.dir" value="src/test" />
-    <property name="lib.dir" value="lib" />
-    <property name="endorsed.dir" value="${lib.dir}/endorsed" />
-    <property name="war.dir" value="exploded-archives/${project.name}.war" />
-    <property name="classes.model.dir" value="${war.dir}/WEB-INF/classes" />
-    <property name="action.dir" value="WEB-INF/classes" />
-    <property name="classes.action.dir" value="${war.dir}/${action.dir}" />
-    <property name="test.dir" value="test-build" />
-    <property name="bootstrap.dir" value="${basedir}/bootstrap" />
-    <property name="jboss.domain" value="default"/>
-    <property name="deploy.dir" value="${jboss.home}/server/${jboss.domain}/deploy" />
-    <property name="war.deploy.dir" value="${deploy.dir}/${project.name}.war" />
-    <property name="testng.jar" value="${basedir}/lib/testng.jar" />
-    <property name="javac.debug" value="true" />
-    <property name="javac.deprecation" value="false" />
-    <property name="debug" value="false" />
-
-    <!--Properties for validating configuration files -->
-    <property name="validate.resources.dir" value="${basedir}/exploded-archives"/>
-    <property name="schema.dir" value="${basedir}/exploded-archives/schemas"/>
-    <property name="src.schema.dir" value="${schema.dir}/org/jboss/seam"/>
-    <property name="schema.version" value="@schemaVersion@"/>
-    
-    <fileset id="lib" dir="${lib.dir}">
-        <include name="*.jar" />
-    </fileset>
-    
-    <path id="build.classpath">
-        <fileset refid="lib" />
-    </path>
-
-    <target name="init" description="Initialize the build">
-
-        <taskdef name="groovyc"
-            classname ="org.codehaus.groovy.ant.Groovyc"
-            classpathref="build.classpath"/> <!-- really only the groovy jar is necessary -->
-
-        <mkdir dir="${classes.model.dir}" />
-        <mkdir dir="${classes.action.dir}" />
-        <mkdir dir="${dist.dir}" />
-        <!-- if a .groovy file is in model or action, set groovy.present -->
-        <available property="groovy.present" value="true" file="" searchparents="true">
-            <filepath>
-                <fileset dir="${src.action.dir}">
-                    <include name="**/*.groovy"/>
-                </fileset>
-                <fileset dir="${src.model.dir}">
-                  <include name="**/*.groovy"/>
-                </fileset>
-            </filepath>
-        </available>
-        <condition property="groovy.test.present" value="true">
-            <or>
-                <isset property="groovy.present"/>
-                <available file="" searchparents="true">
-                    <filepath>
-                        <fileset dir="${src.test.dir}">
-                            <include name="**/*.groovy"/>
-                        </fileset>
-                    </filepath>
-                </available>
-            </or>
-        </condition>
-        <condition property="groovy.dynamic" value="true">
-            <and>
-                <isset property="groovy.present"/>
-                <istrue value="${debug}"/>
-            </and>
-        </condition>
-        <condition property="groovy.static" value="true">
-            <and>
-                <isset property="groovy.present"/>
-                <isfalse value="${debug}"/>
-            </and>
-        </condition>
-    </target>
-    
-    <target name="compilemodel" depends="init,groovy.compilemodel"
-            description="Compile the Java source code"
-            unless="eclipse.running">
-        <javac classpathref="build.classpath" 
-               destdir="${classes.model.dir}" 
-               debug="${javac.debug}" 
-               deprecation="${javac.deprecation}" 
-               nowarn="on">
-            <src path="${src.model.dir}" />
-        </javac>
-    </target>
-
-    <target name="groovy.compilemodel" if="groovy.present">
-        <!-- model is always compiled -->
-        <groovyc classpathref="build.classpath"
-               destdir="${classes.model.dir}"
-               srcdir="${src.model.dir}" >
-        </groovyc>
-    </target>
-    
-    <target name="compileactions" depends="init,groovy.compileactions,groovy.copyactions"
-            description="Compile the Java source code"
-            unless="eclipse.running">
-        <javac classpathref="build.classpath" 
-               destdir="${classes.action.dir}"
-               debug="${javac.debug}" 
-               deprecation="${javac.deprecation}" 
-               nowarn="on">
-            <classpath path="${classes.model.dir}"/>
-            <src path="${src.action.dir}" />
-        </javac>
-    </target>
-
-    <target name="groovy.compileactions" if="groovy.static">
-        <path id="groovy.action.classpath">
-            <path refid="build.classpath"/>
-            <dirset dir="${classes.model.dir}"/>
-        </path>
-        <groovyc classpathref="groovy.action.classpath"
-               destdir="${classes.action.dir}"
-               srcdir="${src.action.dir}" >
-        </groovyc>
-    </target>
-
-    <target name="groovy.copyactions" if="groovy.dynamic">
-        <!-- copy the action groovy files into action if not compiled -->
-        <copy todir="${classes.action.dir}">
-            <fileset dir="${src.action.dir}">
-                <include name="**/*.groovy"/>
-            </fileset>
-        </copy>
-    </target>
-    
-    <target name="copyclasses" depends="init,groovy.copyactions"
-            description="Copy the classes that were compiled by eclipse"
-            if="eclipse.running">
-        <!-- TODO check how the groovy eclipse plugin works, does it compile? -->
-        <copy todir="${classes.model.dir}">
-            <fileset dir="classes/main">
-                <include name="**/*.class"/>
-            </fileset>
-        </copy>
-        <copy todir="${classes.action.dir}">
-            <fileset dir="classes/hot">
-                <include name="**/*.class"/>
-            </fileset>
-        </copy>
-    </target>
-
-    <target name="compile" depends="compilemodel,compileactions,copyclasses"
-            description="Compile the various source paths"/>
-    
-    <target name="war" depends="compile" 
-            description="Build the WAR structure in a staging directory">
-        
-        <copy todir="${war.dir}/WEB-INF/classes">
-            <fileset dir="${basedir}/resources">
-                <include name="seam.properties" />
-                <include name="*.drl" />
-            </fileset>
-            <fileset dir="${src.model.dir}">
-                <include name="**/*.component.xml" />
-            </fileset>
-        </copy>
-
-        <copy tofile="${war.dir}/WEB-INF/classes/components.properties" 
-              file="${basedir}/resources/components-${profile}.properties"
-              overwrite="true"/>
-
-        <copy tofile="${war.dir}/WEB-INF/classes/META-INF/persistence.xml" 
-              file="${basedir}/resources/META-INF/persistence-${profile}-war.xml"
-              overwrite="true"/>
-        
-        <copy tofile="${war.dir}/WEB-INF/classes/import.sql" 
-              file="${basedir}/resources/import-${profile}.sql"
-              overwrite="true"/>
-        
-        <copy todir="${war.dir}">
-            <fileset dir="${basedir}/view" />
-        </copy>
-        
-        <copy todir="${war.dir}/WEB-INF">
-            <fileset dir="${basedir}/resources/WEB-INF">
-                <include name="*.*"/>
-                <include name="classes/**/*.*"/>
-                <exclude name="classes/**/*.class"/>
-                <exclude name="classes/**/*.groovy"/>
-            </fileset>
-        </copy>
-        
-        <copy todir="${war.dir}/WEB-INF">
-            <fileset dir="${basedir}/resources/WEB-INF">
-                <include name="lib/*.*"/>
-                <include name="classes/**/*.class"/>
-            </fileset>
-        </copy>
-        
-        <copy todir="${war.dir}/WEB-INF/lib">
-            <fileset dir="${lib.dir}">
-                <includesfile name="deployed-jars.list"/>
-                <exclude name="jboss-seam-gen.jar"/>
-                <exclude name="icefaces-ahs.jar"/>
-                <include name="groovy-*.jar" if="groovy.present"/>
-            </fileset>
-        </copy>
-        
-        <copy todir="${war.dir}/WEB-INF/classes">
-            <fileset dir="${basedir}/resources"> 
-                <include name="messages*.properties"/>
-                <include name="*_theme.properties"/>
-            </fileset>
-        </copy>
-        
-        <copy todir="${war.dir}/WEB-INF/classes">
-            <fileset dir="${basedir}/resources">
-                <include name="*jpdl.xml" />
-                <include name="*hibernate.cfg.xml" />
-                <include name="jbpm.cfg.xml" />
-                <include name="META-INF/orm.xml" />
-            </fileset>
-        </copy>
-        
-    </target>
-
-    <target name="stage" depends="war"/>
-    
-    <target name="archive" depends="stage" 
-            description="Package the WAR archive">
-        <jar jarfile="${dist.dir}/${project.name}.war" basedir="${war.dir}"/>
-    </target>
-    
-    <target name="datasource">
-        <fail unless="jboss.home">jboss.home not set</fail>
-        <copy file="${basedir}/resources/${project.name}-${profile}-ds.xml"
-            tofile="${deploy.dir}/${project.name}-ds.xml"/>
-    </target>
-    
-    <target name="explode" depends="stage,datasource" 
-            description="Deploy the exploded archive">
-        <fail unless="jboss.home">jboss.home not set</fail>
-        
-        <mkdir dir="${war.deploy.dir}"/>
-        <copy todir="${war.deploy.dir}">
-            <fileset dir="${war.dir}"/>
-        </copy>
-    </target>
-    
-    <target name="unexplode" description="Undeploy the exploded archive">
-        <delete failonerror="no">
-            <fileset dir="${war.deploy.dir}">
-                <exclude name="**/*.jar"/>
-            </fileset>
-        </delete>
-        <delete file="${deploy.dir}/${project.name}-ds.xml" failonerror="no"/>
-        <delete dir="${war.deploy.dir}" failonerror="no"/>
-    </target>
-
-    <target name="reexplode" depends="unexplode,clean,explode"
-        description="Undeploy the exploded archive, clean, then deploy the exploded archive"/>
-    
-    <target name="check-deployed" description="Check to see if packaged archive is currently deployed">
-        <fail unless="jboss.home">jboss.home not set</fail>
-        <condition property="archive.deployed" value="true">
-            <available file="${war.deploy.dir}" type="file"/>
-        </condition>
-    </target>
-
-    <target name="restart-exploded" unless="archive.deployed" description="Deploy exploded archive if not deployed as packaged archive">
-        <antcall target="explode"/>
-        <touch file="${war.deploy.dir}/WEB-INF/web.xml"/>
-    </target>
-
-    <target name="restart-deployed" if="archive.deployed" description="Deploy packaged archive if deployed as packaged archive">
-        <antcall target="deploy"/>
-    </target>
-    
-    <target name="restart" depends="check-deployed,restart-exploded,restart-deployed" description="Restart the exploded archive"/>
-    
-    <target name="deploy" depends="archive,datasource" description="Deploy the packaged archive">
-        <fail unless="jboss.home">jboss.home not set</fail>
-        <copy todir="${deploy.dir}" file="${dist.dir}/${project.name}.war" />
-    </target>
-    
-    <target name="undeploy" description="Undeploy the packaged archive">
-        <delete file="${deploy.dir}/${project.name}.war" />
-        <delete file="${deploy.dir}/${project.name}-ds.xml" />
-    </target>
-
-    <target name="redeploy" depends="undeploy,clean,deploy"
-        description="Undeploy the packaged archive, clean, then deploy the packaged archive"/>
-    
-    <target name="clean" description="Clean out the staging directory">
-        <delete dir="${dist.dir}"/>
-        <delete dir="${basedir}/exploded-archives"/>
-        <delete dir="${basedir}/test-report"/>
-        <delete dir="${basedir}/test-output"/>
-        <delete failonerror="no" includeemptydirs="true">
-            <fileset dir="${test.dir}">
-                <exclude name="**/*.class" if="eclipse.running"/>
-            </fileset>
-        </delete>
-    </target>
-    
-    <target name="compiletest" depends="groovy.compiletest" unless="eclipse.running" description="Compile the Java source code for the tests">
-        <mkdir dir="${test.dir}"/>
-        <javac classpathref="build.classpath"
-               destdir="${test.dir}"
-               debug="${javac.debug}"
-               deprecation="${javac.deprecation}"
-               nowarn="on">
-            <src path="${src.action.dir}" />
-            <src path="${src.model.dir}" />
-            <src path="${src.test.dir}" />
-        </javac>
-    </target>
-
-    <target name="groovy.compiletest" if="groovy.test.present" description="Compile the Groovy source code for the tests">
-        <mkdir dir="${test.dir}"/>
-        <groovyc classpathref="build.classpath"
-               destdir="${test.dir}">
-            <src path="${src.action.dir}"/>
-            <src path="${src.model.dir}"/>
-            <src path="${src.test.dir}"/>
-        </groovyc>
-    </target>
-    
-    <target name="copytestclasses" if="eclipse.running" description="Copy classes compiled by eclipse to the test dir">
-        <mkdir dir="${test.dir}"/>
-        <copy todir="${test.dir}">
-            <fileset dir="classes/main">
-                <include name="**/*.class"/>
-            </fileset>
-        </copy>
-        <copy todir="${test.dir}">
-            <fileset dir="classes/hot">
-                <include name="**/*.class"/>
-            </fileset>
-        </copy>
-        <copy todir="${test.dir}">
-            <fileset dir="classes/test">
-                <include name="**/*.class"/>
-            </fileset>
-        </copy>
-    </target>
-    
-    <target name="buildtest" depends="init,compiletest,copytestclasses" description="Build the tests">
-        <copy todir="${test.dir}">
-            <fileset dir="${basedir}/resources">
-                <exclude name="META-INF/persistence*.xml"/>
-                <exclude name="import*.sql"/>
-                <exclude name="${project.name}-*-ds.xml"/>
-                <exclude name="components-*.properties"/>
-            </fileset>
-            <fileset dir="${basedir}/view"/>
-        </copy>
-        <copy tofile="${test.dir}/META-INF/persistence.xml" 
-              file="${basedir}/resources/META-INF/persistence-test-war.xml"
-              overwrite="true"/>
-        <copy tofile="${test.dir}/import.sql" 
-              file="${basedir}/resources/import-test.sql"
-              overwrite="true"/>
-        <copy tofile="${test.dir}/components.properties" 
-              file="${basedir}/resources/components-test.properties"
-              overwrite="true"/>
-        <copy todir="${test.dir}" flatten="true">
-            <fileset dir="${src.test.dir}">
-                <include name="**/*Test.xml" />
-            </fileset>
-        </copy>
-    </target>
-    
-    <target name="test" depends="buildtest" description="Run the tests">            
-        <condition property="incompatible.jdk">
-            <and>
-                <equals arg1="${ant.java.version}" arg2="1.6"/>
-                <not><available classname="javax.xml.bind.JAXB"/></not>
-            </and>
-        </condition>
-        <fail if="incompatible.jdk">You are using an incompatible JDK 6. Please use Sun JDK 6 Update 4 (1.6.0_04) or newer or use Open JDK 6.</fail>
-        <taskdef resource="testngtasks" classpath="${testng.jar}" />
-        <path id="test.path">
-            <path path="${test.dir}" />
-            <fileset dir="${lib.dir}/test">
-                <include name="*.jar"/>
-            </fileset>
-            <path path="${bootstrap.dir}" />
-            <path refid="build.classpath" />
-        </path>
-        <testng outputdir="${basedir}/test-report">
-            <jvmarg line="-Djava.endorsed.dirs=${endorsed.dir}"/>
-            <jvmarg line="-Dsun.lang.ClassLoader.allowArraySyntax=true"/>
-            <classpath refid="test.path" />
-            <xmlfileset dir="${test.dir}" includes="*Test.xml" />
-        </testng>
-    </target>
-
-    <target name="javadoc" depends="compile">
-        <mkdir dir="${dist.dir}/apidoc" />
-        <javadoc classpathref="build.classpath" destdir="${dist.dir}/apidoc" use="true" protected="true" version="true" windowtitle="${project.name} API Documentation" doctitle="${project.name} API Documentation" link="http://java.sun.com/j2se/5.0/docs/api">
-
-            <packageset dir="${src.action.dir}" defaultexcludes="yes">
-                <include name="*/**" />
-            </packageset>
-
-            <packageset dir="${src.model.dir}" defaultexcludes="yes">
-                <include name="*/**" />
-            </packageset>
-
-        </javadoc>
-    </target>
-
-    <target name="validate" depends="stage" description="Validate the XML configuration files">
-        <mkdir dir="${schema.dir}"/>
-        <unjar src="${lib.dir}/jboss-seam.jar" dest="${schema.dir}">
-            <patternset>
-                <include name="org/jboss/seam/*.xsd"/>
-                <include name="org/jboss/seam/*.dtd"/>
-            </patternset>
-        </unjar>
-        <ant antfile="validate.xml" target="validateConfiguration"/>
-    </target>
-    
-    <target name="freshen" description="grab fresh icefaces jars">
-        <copy todir="${lib.dir}">
-            <fileset dir="${icefaces.home}/lib">
-                <include name="icefaces*.jar" />
-                <include name="backport-util-concurrent.jar" />    
-                <include name="commons-fileupload.jar"/>     
-                <include name="commons-digester.jar"/>
-                <exclude name="icefaces-ahs.jar"/>
-              </fileset>
-        </copy>
-    </target>
-
-    <target name="purge" depends="undeploy" description="clean out jboss deployments of crashing applications"> 
-      <delete dir="${jboss.home}/server/default/tmp/deploy" />
-      <mkdir dir="${jboss.home}/server/default/tmp/deploy/" />
-      <delete dir="${jboss.home}/server/default/tmp/sessions" />
-      <mkdir dir="${jboss.home}/server/default/tmp/sessions" />
-        <delete dir="${jboss.home}/server/default/work/jboss.web/localhost/${project.name}" />
-    </target>
-    
-</project>

Deleted: trunk/seam-gen/icefaces/build-scripts/build.properties
===================================================================
--- trunk/seam-gen/icefaces/build-scripts/build.properties	2009-03-12 23:39:22 UTC (rev 10153)
+++ trunk/seam-gen/icefaces/build-scripts/build.properties	2009-03-14 00:01:28 UTC (rev 10154)
@@ -1,3 +0,0 @@
-jboss.home = @jbossHome@
-jboss.domain = default
-icefaces.home = @iceHome@

Deleted: trunk/seam-gen/icefaces/build-scripts/build.xml
===================================================================
--- trunk/seam-gen/icefaces/build-scripts/build.xml	2009-03-12 23:39:22 UTC (rev 10153)
+++ trunk/seam-gen/icefaces/build-scripts/build.xml	2009-03-14 00:01:28 UTC (rev 10154)
@@ -1,456 +0,0 @@
-<?xml version="1.0"?>
-<project name="@projectName@" default="deploy" basedir=".">
-
-    <!-- Give user a chance to override without editing this file or typing -D -->
-    <property file="${basedir}/build.properties"/>
-
-    <property name="profile" value="dev"/>
-    <property file="build-${profile}.properties"/>
-
-    <!-- set global properties for this build -->
-    <property name="project.name" value="@projectName@"/>
-    <property name="dist.dir" value="dist"/>
-    <property name="src.model.dir" value="src/main"/>
-    <property name="src.action.dir" value="src/hot"/>
-    <property name="src.test.dir" value="src/test"/>
-    <property name="lib.dir" value="lib"/>
-    <property name="endorsed.dir" value="${lib.dir}/endorsed"/>
-    <property name="ear.dir" value="exploded-archives/${project.name}.ear"/>
-    <property name="jar.dir" value="${ear.dir}/${project.name}.jar"/>
-    <property name="war.dir" value="${ear.dir}/${project.name}.war"/>
-    <property name="test.dir" value="test-build"/>
-    <property name="bootstrap.dir" value="${basedir}/bootstrap"/>
-    <property name="jboss.domain" value="default"/>
-    <property name="deploy.dir" value="${jboss.home}/server/${jboss.domain}/deploy"/>
-    <property name="ear.deploy.dir" value="${deploy.dir}/${project.name}.ear"/>
-    <property name="jar.deploy.dir" value="${ear.deploy.dir}/${project.name}.jar"/>
-    <property name="war.deploy.dir" value="${ear.deploy.dir}/${project.name}.war"/>
-    <property name="testng.jar" value="${basedir}/lib/testng.jar"/>
-    <property name="javac.debug" value="true"/>
-    <property name="javac.deprecation" value="false"/>
-    <property name="debug" value="false"/>
-
-    <!--Properties for validating configuration files -->
-    <property name="validate.resources.dir" value="${basedir}/exploded-archives"/>
-    <property name="schema.dir" value="${basedir}/exploded-archives/schemas"/>
-    <property name="src.schema.dir" value="${schema.dir}/org/jboss/seam"/>
-    <property name="schema.version" value="@schemaVersion@"/>
-
-    <fileset id="lib" dir="${lib.dir}">
-        <include name="*.jar"/>
-    </fileset>
-
-    <path id="build.classpath">
-        <fileset refid="lib"/>
-    </path>
-
-    <target name="init" description="Initialize the build">
-        <taskdef name="groovyc"
-            classname ="org.codehaus.groovy.ant.Groovyc"
-            classpathref="build.classpath"/> <!-- really only the groovy jar is necessary -->
-        <mkdir dir="${jar.dir}"/>
-        <mkdir dir="${ear.dir}"/>
-        <mkdir dir="${war.dir}"/>
-        <mkdir dir="${dist.dir}"/>
-        <!-- if a .groovy file is in model or action, set groovy.present -->
-        <available property="groovy.present" value="true" file="" searchparents="true">
-            <filepath>
-                <fileset dir="${src.action.dir}">
-                    <include name="**/*.groovy"/>
-                </fileset>
-                <fileset dir="${src.model.dir}">
-                    <include name="**/*.groovy"/>
-                </fileset>
-            </filepath>
-        </available>
-        <condition property="groovy.test.present" value="true">
-            <or>
-                <isset property="groovy.present"/>
-                <available file="" searchparents="true">
-                    <filepath>
-                        <fileset dir="${src.test.dir}">
-                            <include name="**/*.groovy"/>
-                        </fileset>
-                    </filepath>
-                </available>
-            </or>
-        </condition>
-        <!-- NOTE: Seam does not properly detect uncompiled groovy classes in an EAR -->
-        <condition property="groovy.dynamic" value="true">
-            <and>
-                <isset property="groovy.present"/>
-                <istrue value="${debug}"/>
-            </and>
-        </condition>
-        <condition property="groovy.static" value="true">
-            <and>
-                <isset property="groovy.present"/>
-                <isfalse value="${debug}"/>
-            </and>
-        </condition>
-    </target>
-
-    <target name="groovy.compile" if="groovy.static">
-        <groovyc classpathref="build.classpath"
-            destdir="${jar.dir}"
-            srcdir="${src.model.dir}">
-        </groovyc>
-        <path id="groovy.action.classpath">
-            <path refid="build.classpath"/>
-            <dirset dir="${jar.dir}"/>
-        </path>
-        <groovyc classpathref="groovy.action.classpath"
-            destdir="${jar.dir}"
-            srcdir="${src.action.dir}">
-        </groovyc>
-    </target>
-
-    <target name="groovy.copy" if="groovy.dynamic">
-        <copy todir="${jar.dir}">
-            <fileset dir="${src.action.dir}">
-                <include name="**/*.groovy"/>
-            </fileset>
-        </copy>
-    </target>
-
-    <target name="compile" depends="init,groovy.compile,groovy.copy"
-        description="Compile the Java source code"
-        unless="eclipse.running">
-        <javac classpathref="build.classpath"
-            destdir="${jar.dir}"
-            debug="${javac.debug}"
-            deprecation="${javac.deprecation}"
-            nowarn="on">
-            <src path="${src.model.dir}"/>
-            <src path="${src.action.dir}"/>
-        </javac>
-    </target>
-
-    <target name="copyclasses" depends="init"
-        description="Copy the classes that were compiled by eclipse"
-        if="eclipse.running">
-        <copy todir="${jar.dir}">
-            <fileset dir="classes/main">
-                <include name="**/*.class"/>
-            </fileset>
-            <fileset dir="classes/hot">
-                <include name="**/*.class"/>
-            </fileset>
-        </copy>
-    </target>
-
-    <target name="jar" depends="compile,copyclasses"
-        description="Build the JAR structure in a staging directory">
-        <copy todir="${jar.dir}">
-            <fileset dir="${basedir}/resources">
-                <include name="seam.properties"/>
-                <include name="*.drl"/>
-            </fileset>
-            <fileset dir="${src.model.dir}">
-                <include name="**/*.component.xml" />
-            </fileset>
-        </copy>
-        <copy todir="${jar.dir}/META-INF">
-            <fileset dir="${basedir}/resources/META-INF">
-                <include name="ejb-jar.xml"/>
-                <include name="orm.xml"/>
-            </fileset>
-        </copy>
-        <copy tofile="${jar.dir}/META-INF/persistence.xml"
-            file="${basedir}/resources/META-INF/persistence-${profile}.xml"
-            overwrite="true"/>
-        <copy tofile="${jar.dir}/import.sql"
-            file="${basedir}/resources/import-${profile}.sql"
-            overwrite="true"/>
-    </target>
-
-    <target name="war" depends="compile"
-        description="Build the WAR structure in a staging directory">
-        <copy todir="${war.dir}">
-            <fileset dir="${basedir}/view"/>
-        </copy>
-        <copy tofile="${war.dir}/WEB-INF/classes/components.properties"
-            file="${basedir}/resources/components-${profile}.properties"
-            overwrite="true"/>
-        <copy todir="${war.dir}/WEB-INF">
-            <fileset dir="${basedir}/resources/WEB-INF">
-                <include name="*.*"/>
-                <include name="classes/**/*.*"/>
-                <exclude name="classes/**/*.class"/>
-            </fileset>
-        </copy>
-        <copy todir="${war.dir}/WEB-INF">
-            <fileset dir="${basedir}/resources/WEB-INF">
-                <include name="lib/*.*"/>
-                <include name="classes/**/*.class"/>
-            </fileset>
-        </copy>
-        <copy todir="${war.dir}/WEB-INF/lib">
-            <fileset dir="${lib.dir}">
-                <includesfile name="deployed-jars-war.list"/>
-                <exclude name="jboss-seam-gen.jar"/>
-            </fileset>
-        </copy>
-        <copy todir="${war.dir}/WEB-INF/classes">
-            <fileset dir="${basedir}/resources">
-                <include name="messages*.properties"/>
-                <include name="*_theme.properties"/>
-            </fileset>
-        </copy>
-    </target>
-
-    <target name="ear" description="Build the EAR structure in a staging directory">
-        <copy todir="${ear.dir}">
-            <fileset dir="${basedir}/resources">
-                <include name="*jpdl.xml"/>
-                <include name="*hibernate.cfg.xml"/>
-                <include name="jbpm.cfg.xml"/>
-            </fileset>
-            <fileset dir="${lib.dir}">
-                <include name="jboss-seam.jar"/>
-            </fileset>
-        </copy>
-        <copy todir="${ear.dir}/lib">
-            <fileset dir="${lib.dir}">
-                <includesfile name="deployed-jars-ear.list"/>
-                <exclude name="icefaces-ahs.jar"/>
-            </fileset>
-        </copy>
-        <copy todir="${ear.dir}/META-INF">
-            <fileset dir="${basedir}/resources/META-INF">
-                <include name="application.xml"/>
-                <include name="jboss-app.xml"/>
-            </fileset>
-        </copy>
-    </target>
-
-    <target name="stage" depends="jar,war,ear"/>
-
-    <target name="archive" depends="stage"
-        description="Package the archives">
-        <jar jarfile="${dist.dir}/${project.name}.jar" basedir="${jar.dir}"/>
-        <jar jarfile="${dist.dir}/${project.name}.war" basedir="${war.dir}"/>
-        <jar jarfile="${dist.dir}/${project.name}.ear">
-            <fileset dir="${ear.dir}">
-                <exclude name="${project.name}.jar/**"/>
-                <exclude name="${project.name}.war/**"/>
-            </fileset>
-            <fileset dir="${dist.dir}">
-                <include name="${project.name}.jar"/>
-                <include name="${project.name}.war"/>
-            </fileset>
-        </jar>
-    </target>
-
-    <target name="datasource">
-        <fail unless="jboss.home">jboss.home not set</fail>
-        <copy file="${basedir}/resources/${project.name}-${profile}-ds.xml"
-            tofile="${deploy.dir}/${project.name}-ds.xml"/>
-    </target>
-
-    <target name="explode" depends="stage,datasource"
-        description="Deploy the exploded archive">
-        <fail unless="jboss.home">jboss.home not set</fail>
-
-        <copy todir="${ear.deploy.dir}">
-            <fileset dir="${ear.dir}"/>
-        </copy>
-    </target>
-
-    <target name="unexplode" description="Undeploy the exploded archive">
-        <delete failonerror="no">
-            <fileset dir="${ear.deploy.dir}">
-                <exclude name="**/*.jar"/>
-            </fileset>
-        </delete>
-        <delete file="${deploy.dir}/${project.name}-ds.xml" failonerror="no"/>
-        <delete dir="${ear.deploy.dir}" failonerror="no"/>
-    </target>
-
-    <target name="reexplode" depends="unexplode,clean,explode"
-        description="Undeploy the exploded archive, clean, then deploy the exploded archive"/>
-
-    <target name="check-deployed" description="Check to see if packaged archive is currently deployed">
-        <fail unless="jboss.home">jboss.home not set</fail>
-        <condition property="archive.deployed" value="true">
-            <available file="${ear.deploy.dir}" type="file"/>
-        </condition>
-    </target>
-
-    <target name="restart-exploded" unless="archive.deployed" description="Deploy exploded archive if not deployed as packaged archive">
-        <antcall target="explode"/>
-        <touch file="${ear.deploy.dir}/META-INF/application.xml"/>
-    </target>
-
-    <target name="restart-deployed" if="archive.deployed" description="Deploy packaged archive if deployed as packaged archive">
-        <antcall target="deploy"/>
-    </target>
-
-    <target name="restart" depends="check-deployed,restart-exploded,restart-deployed" description="Restart the exploded archive"/>
-
-    <target name="deploy" depends="archive,datasource" description="Deploy the packaged archive">
-        <fail unless="jboss.home">jboss.home not set</fail>
-        <copy todir="${deploy.dir}" file="${dist.dir}/${project.name}.ear"/>
-    </target>
-
-    <target name="undeploy" description="Undeploy the packaged archive">
-        <delete file="${deploy.dir}/${project.name}.ear"/>
-        <delete file="${deploy.dir}/${project.name}-ds.xml"/>
-    </target>
-
-    <target name="redeploy" depends="undeploy,clean,deploy"
-        description="Undeploy the packaged archive, clean, then deploy the packaged archive"/>
-
-    <target name="clean" description="Cleans up the staging directory">
-        <delete dir="${dist.dir}"/>
-        <delete dir="${basedir}/exploded-archives"/>
-        <delete dir="${src.schema.dir}" failonerror="no"/>
-        <delete dir="${basedir}/test-report"/>
-        <delete dir="${basedir}/test-output"/>
-        <delete failonerror="no" includeemptydirs="true">
-            <fileset dir="${test.dir}">
-                <exclude name="**/*.class" if="eclipse.running"/>
-            </fileset>
-        </delete>
-    </target>
-
-    <target name="compiletest" depends="groovy.compiletest" unless="eclipse.running" description="Compile the Java source code for the tests">
-        <mkdir dir="${test.dir}"/>
-        <javac classpathref="build.classpath"
-            destdir="${test.dir}"
-            debug="${javac.debug}"
-            deprecation="${javac.deprecation}"
-            nowarn="on">
-            <src path="${src.action.dir}"/>
-            <src path="${src.model.dir}"/>
-            <src path="${src.test.dir}"/>
-        </javac>
-    </target>
-
-    <target name="groovy.compiletest" if="groovy.test.present" description="Compile the Groovy source code for the tests">
-        <mkdir dir="${test.dir}"/>
-        <groovyc classpathref="build.classpath"
-            destdir="${test.dir}">
-            <src path="${src.action.dir}"/>
-            <src path="${src.model.dir}"/>
-            <src path="${src.test.dir}"/>
-        </groovyc>
-    </target>
-
-    <target name="copytestclasses" if="eclipse.running" description="Copy classes compiled by eclipse to the test dir">
-    <mkdir dir="${test.dir}"/>
-        <copy todir="${test.dir}">
-            <fileset dir="classes/main">
-                <include name="**/*.class"/>
-            </fileset>
-        </copy>
-        <copy todir="${test.dir}">
-            <fileset dir="classes/hot">
-                <include name="**/*.class"/>
-            </fileset>
-        </copy>
-        <copy todir="${test.dir}">
-            <fileset dir="classes/test">
-                <include name="**/*.class"/>
-            </fileset>
-        </copy>
-    </target>
-
-    <target name="buildtest" depends="init,compiletest,copytestclasses" description="Build the tests">
-        <copy todir="${test.dir}">
-            <fileset dir="${basedir}/resources">
-                <exclude name="META-INF/persistence*.xml"/>
-                <exclude name="import*.sql"/>
-                <exclude name="${project.name}-*-ds.xml"/>
-                <exclude name="components-*.properties"/>
-            </fileset>
-            <fileset dir="${basedir}/view"/>
-        </copy>
-        <copy tofile="${test.dir}/META-INF/persistence.xml"
-            file="${basedir}/resources/META-INF/persistence-test.xml"
-            overwrite="true"/>
-        <copy tofile="${test.dir}/import.sql"
-            file="${basedir}/resources/import-test.sql"
-            overwrite="true"/>
-        <copy tofile="${test.dir}/components.properties"
-            file="${basedir}/resources/components-test.properties"
-            overwrite="true"/>
-        <copy todir="${test.dir}" flatten="true">
-            <fileset dir="${src.test.dir}">
-                <include name="**/*Test.xml"/>
-            </fileset>
-        </copy>
-    </target>
-
-    <target name="test" depends="buildtest" description="Run the tests">
-        <condition property="incompatible.jdk">
-            <and>
-                <equals arg1="${ant.java.version}" arg2="1.6"/>
-                <not><available classname="javax.xml.bind.JAXB"/></not>
-            </and>
-        </condition>
-        <fail if="incompatible.jdk">You are using an incompatible JDK 6. Please use Sun JDK 6 Update 4 (1.6.0_04) or newer or use Open JDK 6.</fail>
-        <taskdef resource="testngtasks" classpath="${testng.jar}"/>
-        <path id="test.path">
-            <path path="${test.dir}"/>
-            <fileset dir="${lib.dir}/test">
-                <include name="*.jar"/>
-            </fileset>
-            <path path="${bootstrap.dir}"/>
-            <path refid="build.classpath"/>
-        </path>
-        <testng outputdir="${basedir}/test-report">
-            <jvmarg line="-Djava.endorsed.dirs=${endorsed.dir}"/>
-            <jvmarg line="-Dsun.lang.ClassLoader.allowArraySyntax=true"/>
-            <classpath refid="test.path"/>
-            <xmlfileset dir="${test.dir}" includes="*Test.xml"/>
-        </testng>
-    </target>
-
-    <target name="javadoc" depends="compile">
-        <mkdir dir="${dist.dir}/apidoc"/>
-        <javadoc classpathref="build.classpath" destdir="${dist.dir}/apidoc" use="true" protected="true" version="true" windowtitle="${project.name} API Documentation" doctitle="${project.name} API Documentation" link="http://java.sun.com/j2se/5.0/docs/api">
-            <packageset dir="${src.action.dir}" defaultexcludes="yes">
-                <include name="*/**"/>
-            </packageset>
-            <packageset dir="${src.model.dir}" defaultexcludes="yes">
-                <include name="*/**"/>
-            </packageset>
-        </javadoc>
-    </target>
-
-    <!-- deprecated -->
-    <target name="validateConfiguration" depends="validate"/>
-
-    <target name="validate" depends="stage" description="Validate the XML configuration files">
-        <mkdir dir="${schema.dir}"/>
-        <unjar src="${lib.dir}/jboss-seam.jar" dest="${schema.dir}">
-            <patternset>
-                <include name="org/jboss/seam/*.xsd"/>
-                <include name="org/jboss/seam/*.dtd"/>
-            </patternset>
-        </unjar>
-        <ant antfile="validate.xml" target="validateConfiguration"/>
-    </target>
-
-    <target name="freshen" description="grab fresh icefaces jars">
-        <copy todir="${lib.dir}">
-            <fileset dir="${icefaces.home}/lib">
-                <include name="icefaces*.jar"/>
-                <include name="backport-util-concurrent.jar"/>
-                <include name="commons-fileupload.jar"/>
-                <include name="commons-digester.jar"/>
-                <exclude name="icefaces-ahs.jar"/>
-            </fileset>
-        </copy>
-    </target>
-
-    <target name="purge" depends="undeploy" description="clean out jboss deployments of crashing applications">
-        <delete dir="${jboss.home}/server/default/tmp/deploy"/>
-        <mkdir dir="${jboss.home}/server/default/tmp/deploy/"/>
-        <delete dir="${jboss.home}/server/default/tmp/sessions"/>
-        <mkdir dir="${jboss.home}/server/default/tmp/sessions"/>
-        <delete dir="${jboss.home}/server/default/work/jboss.web/localhost/${project.name}"/>
-    </target>
-
-</project>

Deleted: trunk/seam-gen/icefaces/resources/WEB-INF/components-war.xml
===================================================================
--- trunk/seam-gen/icefaces/resources/WEB-INF/components-war.xml	2009-03-12 23:39:22 UTC (rev 10153)
+++ trunk/seam-gen/icefaces/resources/WEB-INF/components-war.xml	2009-03-14 00:01:28 UTC (rev 10154)
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<components xmlns="http://jboss.com/products/seam/components"
-            xmlns:core="http://jboss.com/products/seam/core"
-            xmlns:persistence="http://jboss.com/products/seam/persistence"
-            xmlns:drools="http://jboss.com/products/seam/drools"
-            xmlns:bpm="http://jboss.com/products/seam/bpm"
-            xmlns:security="http://jboss.com/products/seam/security"
-            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation=
-                "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.1.xsd
-                 http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.1.xsd
-                 http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.1.xsd
-                 http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.1.xsd
-                 http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.1.xsd
-                 http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd">
-
-   <core:init debug="@debug@" jndi-pattern="@jndiPattern@"/>
-
-   <component scope="APPLICATION" auto-create="true" name="renderManager" class="com.icesoft.faces.async.render.RenderManager" />
-
-   <core:manager concurrent-request-timeout="500"
-                 conversation-timeout="120000"
-                 conversation-id-parameter="cid"
-                 parent-conversation-id-parameter="pid"/>
-
-   <component name="org.jboss.seam.debug.hotDeployFilter">
-      <property name="urlPattern">*.seam</property>
-   </component>
-
-   <persistence:managed-persistence-context name="entityManager"
-                                     auto-create="true"
-                          entity-manager-factory="#{@projectName at EntityManagerFactory}"/>
-
-   <persistence:entity-manager-factory name="@projectName at EntityManagerFactory"
-                      persistence-unit-name="@projectName@"/>
-
-   <drools:rule-base name="securityRules">
-       <drools:rule-files><value>/security.drl</value></drools:rule-files>
-   </drools:rule-base>
-
-   <security:rule-based-permission-resolver security-rules="#{securityRules}"/>
-   <security:identity authenticate-method="#{authenticator.authenticate}"
-                              remember-me="true"/>
-
-   <event type="org.jboss.seam.security.notLoggedIn">
-       <action execute="#{redirect.captureCurrentView}"/>
-   </event>
-   <event type="org.jboss.seam.security.loginSuccessful">
-       <action execute="#{redirect.returnToCapturedView}"/>
-   </event>
-
-   <!-- For use with jBPM pageflow or process management -->
-   <!--
-   <bpm:jbpm>
-      <bpm:process-definitions></bpm:process-definitions>
-      <bpm:pageflow-definitions></bpm:pageflow-definitions>
-   </bpm:jbpm>
-   -->
-
-</components>

Deleted: trunk/seam-gen/icefaces/resources/WEB-INF/components.xml
===================================================================
--- trunk/seam-gen/icefaces/resources/WEB-INF/components.xml	2009-03-12 23:39:22 UTC (rev 10153)
+++ trunk/seam-gen/icefaces/resources/WEB-INF/components.xml	2009-03-14 00:01:28 UTC (rev 10154)
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<components xmlns="http://jboss.com/products/seam/components"
-            xmlns:core="http://jboss.com/products/seam/core"
-            xmlns:persistence="http://jboss.com/products/seam/persistence"
-            xmlns:drools="http://jboss.com/products/seam/drools"
-            xmlns:bpm="http://jboss.com/products/seam/bpm"
-            xmlns:security="http://jboss.com/products/seam/security"
-            xmlns:web="http://jboss.com/products/seam/web"
-            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation=
-                "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.1.xsd
-                 http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.1.xsd
-                 http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.1.xsd
-                 http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.1.xsd
-                 http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.1.xsd
-                 http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.1.xsd
-                 http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd">
-
-   <core:init debug="@debug@" jndi-pattern="@jndiPattern@"/>
-
-   <component scope="APPLICATION" auto-create="true" name="renderManager" class="com.icesoft.faces.async.render.RenderManager" />
-
-   <core:manager concurrent-request-timeout="500"
-                 conversation-timeout="120000"
-                 conversation-id-parameter="cid"
-                 parent-conversation-id-parameter="pid"/>
-
-   <web:hot-deploy-filter url-pattern="*.seam"/>
-
-   <persistence:managed-persistence-context name="entityManager"
-                                     auto-create="true"
-                      persistence-unit-jndi-name="java:/@projectName at EntityManagerFactory"/>
-
-   <drools:rule-base name="securityRules">
-       <drools:rule-files>
-           <value>/security.drl</value>
-       </drools:rule-files>
-   </drools:rule-base>
-
-   <security:rule-based-permission-resolver security-rules="#{securityRules}"/>
-
-   <security:identity authenticate-method="#{authenticator.authenticate}" remember-me="true"/>
-
-   <event type="org.jboss.seam.security.notLoggedIn">
-       <action execute="#{redirect.captureCurrentView}"/>
-   </event>
-   <event type="org.jboss.seam.security.loginSuccessful">
-       <action execute="#{redirect.returnToCapturedView}"/>
-   </event>
-
-   <!-- For use with jBPM pageflow or process management -->
-   <!--
-   <bpm:jbpm>
-      <bpm:process-definitions></bpm:process-definitions>
-      <bpm:pageflow-definitions></bpm:pageflow-definitions>
-   </bpm:jbpm>
-   -->
-
-</components>

Added: trunk/seam-gen/ivy/ivy-build.xml
===================================================================
--- trunk/seam-gen/ivy/ivy-build.xml	                        (rev 0)
+++ trunk/seam-gen/ivy/ivy-build.xml	2009-03-14 00:01:28 UTC (rev 10154)
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+<project basedir="." xmlns:ivy="antlib:org.apache.ivy.ant" name="@projectName at -ivy">
+	<!-- At this point we cannot upgrade to 2.0.0-rc1 because of a bug regarding when the variables are loaded -->
+	<property name="ivy.install.version" value="2.0.0-beta2"/>
+	<property name="ivy.jar.dir" value="${lib.dir}/ivy"/>
+	<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar"/>
+	<property name="ivy.sync" value="false"/>
+	<property name="ivy.use.symlinks" value="false"/>
+	<property name="central.repo" value="http://repo1.maven.org/maven2"/>
+	<property name="jboss.repo" value="http://repository.jboss.org/maven2"/>
+
+	<!-- centralize some key artifact versions -->
+	<property name="seam.version" value="2.1.1.GA"/>
+	<property name="jsf.version" value="1.2_12"/>
+	<property name="richfaces.version" value="3.3.0.GA"/>
+	<property name="jboss-embedded.version" value="beta3"/>
+
+	<target name="init-ivy">
+		<available property="ivy.installed" value="true" file="${ivy.jar.file}" type="file"/>
+	</target>
+
+	<target name="load-ivy" depends="init-ivy,download-ivy">
+		<path id="ivy.lib.path">
+			<fileset dir="${ivy.jar.dir}" includes="*.jar"/>
+		</path>
+		<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
+		<ivy:settings file="${basedir}/ivy.settings.xml"/>
+	</target>   
+
+	<target name="download-ivy" depends="init-ivy" unless="ivy.installed">
+		<mkdir dir="${ivy.jar.dir}"/>
+		<echo message="Installing ivy..."/>
+		<get src="${central.repo}/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
+			 dest="${ivy.jar.file}"/>
+	</target>
+
+	<target name="inflate-core" depends="load-ivy">
+		<ivy:retrieve pattern="${lib.dir}/[artifact].[ext]" type="jar" sync="${ivy.sync}" symlink="${ivy.use.symlinks}"/>
+		<move file="${lib.dir}/mvel.jar" tofile="${lib.dir}/mvel14.jar" failonerror="false"/>
+	</target>
+
+	<target name="inflate-source" depends="load-ivy">
+		<ivy:retrieve pattern="${lib.dir}/src/[artifact]-[type]s.[ext]" type="source" sync="${ivy.sync}" symlink="${ivy.use.symlinks}"/>
+	</target>
+
+	<target name="inflate-test" depends="load-ivy">
+		<ivy:retrieve pattern="${lib.dir}/test/[artifact].[ext]" type="test-jar" sync="${ivy.sync}" symlink="${ivy.use.symlinks}"/>
+	</target>
+
+	<target name="inflate" depends="inflate-core,inflate-source,inflate-test"/>
+
+	<target name="uninflate">
+		<delete includeemptydirs="true" failonerror="false">
+			 <fileset dir="${lib.dir}">
+				  <include name="**/*"/>
+			 </fileset>
+		</delete>
+   </target>
+
+	<target name="clean-ivy" depends="load-ivy">
+		<ivy:cleancache/>
+	</target>
+
+	<target name="dependency-report" depends="inflate">
+		<ivy:report todir="${dist.dir}/dependency-report"/>
+	</target>
+</project>

Added: trunk/seam-gen/ivy/ivy.settings.xml
===================================================================
--- trunk/seam-gen/ivy/ivy.settings.xml	                        (rev 0)
+++ trunk/seam-gen/ivy/ivy.settings.xml	2009-03-14 00:01:28 UTC (rev 10154)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ivysettings>
+	<settings defaultResolver="seam"/>
+	<include url="${ivy.default.settings.dir}/ivysettings.xml" />
+	<resolvers>
+		<ibiblio name="central" m2compatible="true" usepoms="false" root="${central.repo}" pattern="[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"/>
+		<ibiblio name="jboss" m2compatible="true" usepoms="false" root="${jboss.repo}" pattern="[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"/>
+		<chain name="seam" returnFirst="true">
+      		<!-- local is always checked; central is before jboss since Ivy will only get sources from where it got binaries -->
+			<resolver ref="central"/>
+			<resolver ref="jboss"/>
+		</chain>
+	</resolvers>
+</ivysettings>

Added: trunk/seam-gen/ivy/ivy.xml
===================================================================
--- trunk/seam-gen/ivy/ivy.xml	                        (rev 0)
+++ trunk/seam-gen/ivy/ivy.xml	2009-03-14 00:01:28 UTC (rev 10154)
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ivy-module version="1.0" xmlns:m="http://ant.apache.org/ivy/maven">
+	<info organisation="@projectName@" module="@projectName@"/>
+	<configurations>
+		<conf name="default" transitive="false"/>
+	</configurations>
+	<dependencies defaultconf="default">
+		<dependency org="com.h2database" name="h2" rev="1.0.72">
+			<artifact name="h2" type="jar"/>
+		</dependency>
+		<dependency org="com.sun.facelets" name="jsf-facelets" rev="1.1.15.B1">
+			<artifact name="jsf-facelets" type="jar"/>
+			<artifact name="jsf-facelets" type="source" ext="jar" m:classifier="sources"/>
+		</dependency>
+		<dependency org="commons-beanutils" name="commons-beanutils" rev="1.7.0">
+			<artifact name="commons-beanutils" type="jar"/>
+			<artifact name="commons-beanutils" type="source" ext="jar" m:classifier="sources"/>
+		</dependency>
+		<dependency org="commons-digester" name="commons-digester" rev="1.7">
+			<artifact name="commons-digester" type="jar"/>
+			<artifact name="commons-digester" type="source" ext="jar" m:classifier="sources"/>
+		</dependency>
+		<dependency org="janino" name="janino" rev="2.5.10">
+			<artifact name="janino" type="jar"/>
+		</dependency>
+		<dependency org="javax.ejb" name="ejb-api" rev="3.0">
+			<artifact name="ejb-api" type="jar"/>
+		</dependency>
+		<dependency org="javax.el" name="el-api" rev="1.0">
+			<artifact name="el-api" type="jar"/>
+		</dependency>
+		<dependency org="javax.faces" name="jsf-api" rev="${jsf.version}">
+			<artifact name="jsf-api" type="jar"/>
+			<artifact name="jsf-api" type="source" ext="jar" m:classifier="sources"/>
+		</dependency>
+		<dependency org="javax.faces" name="jsf-impl" rev="${jsf.version}">
+			<artifact name="jsf-impl" type="jar"/>
+			<artifact name="jsf-impl" type="source" ext="jar" m:classifier="sources"/>
+		</dependency>
+		<dependency org="javax.persistence" name="persistence-api" rev="1.0">
+			<artifact name="persistence-api" type="jar"/>
+		</dependency>
+		<dependency org="javax.servlet" name="servlet-api" rev="2.5">
+			<artifact name="servlet-api" type="jar"/>
+		</dependency>
+		<dependency org="javax.transaction" name="jta" rev="1.1">
+			<artifact name="jta" type="jar"/>
+		</dependency>
+		<dependency org="net.sourceforge.jexcelapi" name="jxl" rev="2.6.8-seam">
+			<artifact name="jxl" type="jar"/>
+		</dependency>
+		<dependency org="org.antlr" name="antlr-runtime" rev="3.0">
+			<artifact name="antlr-runtime" type="jar"/>
+		</dependency>
+		<dependency org="org.drools" name="drools-compiler" rev="4.0.7">
+			<artifact name="drools-compiler" type="jar"/>
+		</dependency>
+		<dependency org="org.drools" name="drools-core" rev="4.0.7">
+			<artifact name="drools-core" type="jar"/>
+		</dependency>
+		<dependency org="org.eclipse.jdt" name="core" rev="3.2.3.v_686_R32x">
+			<artifact name="core" type="jar"/>
+		</dependency>
+		<dependency org="org.codehaus.groovy" name="groovy-all" rev="1.5.4">
+			<artifact name="groovy-all" type="jar"/>
+		</dependency>
+		<dependency org="org.hibernate" name="hibernate-validator" rev="3.0.0.GA">
+			<artifact name="hibernate-validator" type="jar"/>
+		</dependency>
+		<dependency org="org.jboss.el" name="jboss-el" rev="1.0_02.CR3">
+			<artifact name="jboss-el" type="jar"/>
+		</dependency>
+		<dependency org="org.jboss.seam" name="jboss-seam" rev="${seam.version}">
+			<artifact name="jboss-seam" type="jar"/>
+			<artifact name="jboss-seam" type="source" ext="jar" m:classifier="sources"/>
+		</dependency>
+		<dependency org="org.jboss.seam" name="jboss-seam-debug" rev="${seam.version}">
+			<artifact name="jboss-seam-debug" type="jar"/>
+			<artifact name="jboss-seam-debug" type="source" ext="jar" m:classifier="sources"/>
+		</dependency>
+		<dependency org="org.jboss.seam" name="jboss-seam-excel" rev="${seam.version}">
+			<artifact name="jboss-seam-excel" type="jar"/>
+			<artifact name="jboss-seam-excel" type="source" ext="jar" m:classifier="sources"/>
+		</dependency>
+		<dependency org="org.jboss.seam" name="jboss-seam-ioc" rev="${seam.version}">
+			<artifact name="jboss-seam-ioc" type="jar"/>
+			<artifact name="jboss-seam-ioc" type="source" ext="jar" m:classifier="sources"/>
+		</dependency>
+		<dependency org="org.jboss.seam" name="jboss-seam-jul" rev="${seam.version}">
+			<artifact name="jboss-seam-jul" type="jar"/>
+			<artifact name="jboss-seam-jul" type="source" ext="jar" m:classifier="sources"/>
+		</dependency>
+		<dependency org="org.jboss.seam" name="jboss-seam-mail" rev="${seam.version}">
+			<artifact name="jboss-seam-mail" type="jar"/>
+			<artifact name="jboss-seam-mail" type="source" ext="jar" m:classifier="sources"/>
+		</dependency>
+		<dependency org="org.jboss.seam" name="jboss-seam-pdf" rev="${seam.version}">
+			<artifact name="jboss-seam-pdf" type="jar"/>
+			<artifact name="jboss-seam-pdf" type="source" ext="jar" m:classifier="sources"/>
+		</dependency>
+		<dependency org="org.jboss.seam" name="jboss-seam-remoting" rev="${seam.version}">
+			<artifact name="jboss-seam-remoting" type="jar"/>
+			<artifact name="jboss-seam-remoting" type="source" ext="jar" m:classifier="sources"/>
+		</dependency>
+		<dependency org="org.jboss.seam" name="jboss-seam-rss" rev="${seam.version}">
+			<artifact name="jboss-seam-rss" type="jar"/>
+			<artifact name="jboss-seam-rss" type="source" ext="jar" m:classifier="sources"/>
+		</dependency>
+		<dependency org="org.jboss.seam" name="jboss-seam-ui" rev="${seam.version}">
+			<artifact name="jboss-seam-ui" type="jar"/>
+			<artifact name="jboss-seam-ui" type="source" ext="jar" m:classifier="sources"/>
+		</dependency>
+		<dependency org="org.jbpm" name="jbpm-jpdl" rev="3.2.2">
+			<artifact name="jbpm-jpdl" type="jar"/>
+		</dependency>
+		<dependency org="org.mvel" name="mvel" rev="1.3.1-java1.5">
+			<artifact name="mvel" type="jar"/>
+		</dependency>
+		<dependency org="org.richfaces.framework" name="richfaces-api" rev="${richfaces.version}">
+			<artifact name="richfaces-api" type="jar"/>
+			<artifact name="richfaces-api" type="source" ext="jar" m:classifier="sources"/>
+		</dependency>
+		<dependency org="org.richfaces.framework" name="richfaces-impl" rev="${richfaces.version}">
+			<artifact name="richfaces-impl" type="jar"/>
+			<artifact name="richfaces-impl" type="source" ext="jar" m:classifier="sources"/>
+		</dependency>
+		<dependency org="org.richfaces.ui" name="richfaces-ui" rev="${richfaces.version}">
+			<artifact name="richfaces-ui" type="jar"/>
+			<artifact name="richfaces-ui" type="source" ext="jar" m:classifier="sources"/>
+		</dependency>
+		<dependency org="org.testng" name="testng" rev="5.6">
+			<artifact name="testng" type="jar"/>
+		</dependency>
+		<!-- I tried to use conf="test" but I simply didn't understand how it worked -->
+		<dependency org="org.jboss.seam.embedded" name="hibernate-all" rev="${jboss-embedded.version}">
+			<artifact name="hibernate-all" type="test-jar" ext="jar"/>
+		</dependency>
+		<dependency org="org.jboss.seam.embedded" name="thirdparty-all" rev="${jboss-embedded.version}">
+			<artifact name="thirdparty-all" type="test-jar" ext="jar"/>
+		</dependency>
+		<dependency org="org.jboss.seam.embedded" name="jboss-embedded-all" rev="${jboss-embedded.version}">
+			<artifact name="jboss-embedded-all" type="test-jar" ext="jar"/>
+		</dependency>
+		<dependency org="org.jboss.seam.embedded" name="jboss-embedded-api" rev="${jboss-embedded.version}">
+			<artifact name="jboss-embedded-api" type="test-jar" ext="jar"/>
+		</dependency>
+	</dependencies>
+</ivy-module>

Modified: trunk/seam-gen/resources/META-INF/persistence-dev-war.xml
===================================================================
--- trunk/seam-gen/resources/META-INF/persistence-dev-war.xml	2009-03-12 23:39:22 UTC (rev 10153)
+++ trunk/seam-gen/resources/META-INF/persistence-dev-war.xml	2009-03-14 00:01:28 UTC (rev 10154)
@@ -7,13 +7,14 @@
              
    <persistence-unit name="@projectName@" transaction-type="JTA">
       <provider>org.hibernate.ejb.HibernatePersistence</provider>
-      <jta-data-source>java:/@projectName at Datasource</jta-data-source>
+      <jta-data-source>@projectName at Datasource</jta-data-source>
       <properties>
          <property name="hibernate.dialect" value="@hibernate.dialect@"/>
          <property name="hibernate.hbm2ddl.auto" value="@hbm2ddl@"/>
          <property name="hibernate.show_sql" value="true"/>
-         <property name="hibernate.format_sql" value="true"/>
-         <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
+         <property name="hibernate.format_sql" value="true"/>@catalogProperty@@schemaProperty@
+         <!-- Only relevant if Seam is loading the persistence unit (Java SE bootstrap) -->
+         <property name="hibernate.transaction.manager_lookup_class" value="@transactionManagerLookupClass@"/>
       </properties>
    </persistence-unit>
     

Modified: trunk/seam-gen/resources/META-INF/persistence-dev.xml
===================================================================
--- trunk/seam-gen/resources/META-INF/persistence-dev.xml	2009-03-12 23:39:22 UTC (rev 10153)
+++ trunk/seam-gen/resources/META-INF/persistence-dev.xml	2009-03-14 00:01:28 UTC (rev 10154)
@@ -7,13 +7,17 @@
              
    <persistence-unit name="@projectName@">
       <provider>org.hibernate.ejb.HibernatePersistence</provider>
-      <jta-data-source>java:/@projectName at Datasource</jta-data-source>
+      <jta-data-source>@projectName at Datasource</jta-data-source>
+      <!-- The <jar-file> element is necessary if you put the persistence.xml in the WAR and the classes in the JAR -->
+      <!--
+      <jar-file>../../vehicles.jar</jar-file>
+      -->
       <properties>
          <property name="hibernate.dialect" value="@hibernate.dialect@"/>
          <property name="hibernate.hbm2ddl.auto" value="@hbm2ddl@"/>
          <property name="hibernate.show_sql" value="true"/>
-         <property name="hibernate.format_sql" value="true"/>
-         <property name="jboss.entity.manager.factory.jndi.name" value="java:/@projectName at EntityManagerFactory"/>@catalogProperty@@schemaProperty@
+         <property name="hibernate.format_sql" value="true"/>@catalogProperty@@schemaProperty@
+         <property name="jboss.entity.manager.factory.jndi.name" value="java:/@projectName at EntityManagerFactory"/>
       </properties>
    </persistence-unit>
     

Modified: trunk/seam-gen/resources/META-INF/persistence-prod-war.xml
===================================================================
--- trunk/seam-gen/resources/META-INF/persistence-prod-war.xml	2009-03-12 23:39:22 UTC (rev 10153)
+++ trunk/seam-gen/resources/META-INF/persistence-prod-war.xml	2009-03-14 00:01:28 UTC (rev 10154)
@@ -7,12 +7,13 @@
              
    <persistence-unit name="@projectName@" transaction-type="JTA">
       <provider>org.hibernate.ejb.HibernatePersistence</provider>
-      <jta-data-source>java:/@projectName at Datasource</jta-data-source>
+      <jta-data-source>@projectName at Datasource</jta-data-source>
       <properties>
          <property name="hibernate.dialect" value="@hibernate.dialect@"/>
          <property name="hibernate.hbm2ddl.auto" value="validate"/>
-         <property name="hibernate.jdbc.batch_size" value="20"/>
-         <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
+         <property name="hibernate.jdbc.batch_size" value="20"/>@catalogProperty@@schemaProperty@
+         <!-- Only relevant if Seam is loading the persistence unit (Java SE bootstrap) -->
+         <property name="hibernate.transaction.manager_lookup_class" value="@transactionManagerLookupClass@"/>
       </properties>
    </persistence-unit>
     

Modified: trunk/seam-gen/resources/META-INF/persistence-prod.xml
===================================================================
--- trunk/seam-gen/resources/META-INF/persistence-prod.xml	2009-03-12 23:39:22 UTC (rev 10153)
+++ trunk/seam-gen/resources/META-INF/persistence-prod.xml	2009-03-14 00:01:28 UTC (rev 10154)
@@ -7,12 +7,16 @@
              
    <persistence-unit name="@projectName@">
       <provider>org.hibernate.ejb.HibernatePersistence</provider>
-      <jta-data-source>java:/@projectName at Datasource</jta-data-source>
+      <jta-data-source>@projectName at Datasource</jta-data-source>
+      <!-- The <jar-file> element is necessary if you put the persistence.xml in the WAR and the classes in the JAR -->
+      <!--
+      <jar-file>../../vehicles.jar</jar-file>
+      -->
       <properties>
          <property name="hibernate.dialect" value="@hibernate.dialect@"/>
          <property name="hibernate.hbm2ddl.auto" value="validate"/>
-         <property name="hibernate.jdbc.batch_size" value="20"/>
-         <property name="jboss.entity.manager.factory.jndi.name" value="java:/@projectName at EntityManagerFactory"/>@catalogProperty@@schemaProperty@
+         <property name="hibernate.jdbc.batch_size" value="20"/>@catalogProperty@@schemaProperty@
+         <property name="jboss.entity.manager.factory.jndi.name" value="java:/@projectName at EntityManagerFactory"/>
       </properties>
    </persistence-unit>
     

Modified: trunk/seam-gen/resources/WEB-INF/components-war.xml
===================================================================
--- trunk/seam-gen/resources/WEB-INF/components-war.xml	2009-03-12 23:39:22 UTC (rev 10153)
+++ trunk/seam-gen/resources/WEB-INF/components-war.xml	2009-03-14 00:01:28 UTC (rev 10154)
@@ -6,6 +6,7 @@
             xmlns:bpm="http://jboss.com/products/seam/bpm"
             xmlns:security="http://jboss.com/products/seam/security"
             xmlns:mail="http://jboss.com/products/seam/mail"
+            xmlns:web="http://jboss.com/products/seam/web"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation=
                 "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.1.xsd
@@ -14,26 +15,27 @@
                  http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.1.xsd
                  http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.1.xsd
                  http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.1.xsd
+                 http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.1.xsd
                  http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd">
 
    <core:init debug="@debug@" jndi-pattern="@jndiPattern@"/>
 
-   <component name="org.jboss.seam.debug.hotDeployFilter">
-      <property name="urlPattern">*.seam</property>
-   </component>
-
    <core:manager concurrent-request-timeout="500"
                  conversation-timeout="120000"
                  conversation-id-parameter="cid"
                  parent-conversation-id-parameter="pid"/>
 
-   <persistence:managed-persistence-context name="entityManager"
-                                     auto-create="true"
-                          entity-manager-factory="#{@projectName at EntityManagerFactory}"/>
+   <!-- Make sure this URL pattern is the same as that used by the Faces Servlet -->
+   <web:hot-deploy-filter url-pattern="*.seam"/>
 
-   <persistence:entity-manager-factory name="@projectName at EntityManagerFactory"
-                      persistence-unit-name="@projectName@"/>
+   <persistence:entity-manager-factory name="entityManagerFactory"
+                      persistence-unit-name="@projectName@"
+                                  installed="@seamBootstrapsPu@"/>
 
+   <persistence:managed-persistence-context name="entityManager" auto-create="true"
+                          entity-manager-factory="@seamEmfRef@"
+                      persistence-unit-jndi-name="@puJndiName@"/>
+
    <drools:rule-base name="securityRules">
       <drools:rule-files><value>/security.drl</value></drools:rule-files>
    </drools:rule-base>

Modified: trunk/seam-gen/resources/WEB-INF/components.xml
===================================================================
--- trunk/seam-gen/resources/WEB-INF/components.xml	2009-03-12 23:39:22 UTC (rev 10153)
+++ trunk/seam-gen/resources/WEB-INF/components.xml	2009-03-14 00:01:28 UTC (rev 10154)
@@ -25,11 +25,11 @@
                  conversation-id-parameter="cid"
                  parent-conversation-id-parameter="pid"/>
 
+   <!-- Make sure this URL pattern is the same as that used by the Faces Servlet -->
    <web:hot-deploy-filter url-pattern="*.seam"/>
 
-   <persistence:managed-persistence-context name="entityManager"
-                                     auto-create="true"
-                      persistence-unit-jndi-name="java:/@projectName at EntityManagerFactory"/>
+   <persistence:managed-persistence-context name="entityManager" auto-create="true"
+                      persistence-unit-jndi-name="@puJndiName@"/>
 
    <drools:rule-base name="securityRules">
       <drools:rule-files>

Modified: trunk/seam-gen/resources/components-dev.properties
===================================================================
--- trunk/seam-gen/resources/components-dev.properties	2009-03-12 23:39:22 UTC (rev 10153)
+++ trunk/seam-gen/resources/components-dev.properties	2009-03-14 00:01:28 UTC (rev 10154)
@@ -1,3 +1,6 @@
 # These properties are used to replace Ant-style tokens in the component descriptor (components.xml) at runtime.
-jndiPattern=@projectName@/#{ejbName}/local
+jndiPattern=@ejbJndiPattern@
 debug=true
+seamBootstrapsPu=@seamBootstrapsPu@
+seamEmfRef=@seamEmfRef@
+puJndiName=@puJndiName@

Modified: trunk/seam-gen/resources/components-prod.properties
===================================================================
--- trunk/seam-gen/resources/components-prod.properties	2009-03-12 23:39:22 UTC (rev 10153)
+++ trunk/seam-gen/resources/components-prod.properties	2009-03-14 00:01:28 UTC (rev 10154)
@@ -1,3 +1,6 @@
 # These properties are used to replace Ant-style tokens in the component descriptor (components.xml) at runtime.
-jndiPattern=@projectName@/#{ejbName}/local
+jndiPattern=@ejbJndiPattern@
 debug=false
+seamBootstrapsPu=@seamBootstrapsPu@
+seamEmfRef=@seamEmfRef@
+puJndiName=@puJndiName@

Modified: trunk/seam-gen/resources/components-test.properties
===================================================================
--- trunk/seam-gen/resources/components-test.properties	2009-03-12 23:39:22 UTC (rev 10153)
+++ trunk/seam-gen/resources/components-test.properties	2009-03-14 00:01:28 UTC (rev 10154)
@@ -1,3 +1,6 @@
 # These properties are used to replace Ant-style tokens in the component descriptor (components.xml) at runtime.
 jndiPattern=#{ejbName}/local
 debug=true
+seamBootstrapsPu=true
+seamEmfRef=#{entityManagerFactory}
+puJndiName=#{null}

Modified: trunk/seam-gen/resources/datasource-ds.xml
===================================================================
--- trunk/seam-gen/resources/datasource-ds.xml	2009-03-12 23:39:22 UTC (rev 10153)
+++ trunk/seam-gen/resources/datasource-ds.xml	2009-03-14 00:01:28 UTC (rev 10154)
@@ -1,26 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
-
 <!DOCTYPE datasources
     PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
     "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
-    
 <datasources>
    
    <local-tx-datasource>
       <jndi-name>@projectName at Datasource</jndi-name>
+      <use-java-context>false</use-java-context>
       <connection-url>@jdbcUrl@</connection-url>
       <driver-class>@driverClass@</driver-class>
       <user-name>@username@</user-name>
       <password>@password@</password>
-<!-- 
-      <exception-sorter-class-name>
-         org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter
-      </exception-sorter-class-name>
-      <metadata>
-         <type-mapping>mySQL</type-mapping>
-      </metadata>
--->
    </local-tx-datasource>
     
 </datasources>
-

Added: trunk/seam-gen/resources/glassfish-resources.xml
===================================================================
--- trunk/seam-gen/resources/glassfish-resources.xml	                        (rev 0)
+++ trunk/seam-gen/resources/glassfish-resources.xml	2009-03-14 00:01:28 UTC (rev 10154)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE resources PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Resource Definitions //EN"
+    "http://www.sun.com/software/appserver/dtds/sun-resources_1_3.dtd">
+<resources>
+    <jdbc-connection-pool
+        name="@projectName at Pool"
+        datasource-classname="@dataSourceClass@"
+        res-type="javax.sql.DataSource">
+        <property name="user" value="@username@"/>
+        <property name="password" value="@password@"/>
+        <property name="url" value="@jdbcUrl@"/>
+    </jdbc-connection-pool>
+    <jdbc-resource
+        jndi-name="@projectName at Datasource"
+        pool-name="@projectName at Pool"
+        enabled="true"
+        object-type="user"/>
+</resources>

Modified: trunk/seam-gen/src/Authenticator.java
===================================================================
--- trunk/seam-gen/src/Authenticator.java	2009-03-12 23:39:22 UTC (rev 10153)
+++ trunk/seam-gen/src/Authenticator.java	2009-03-14 00:01:28 UTC (rev 10154)
@@ -1,32 +1,10 @@
 package @actionPackage@;
 
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Logger;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.log.Log;
-import org.jboss.seam.security.Credentials;
-import org.jboss.seam.security.Identity;
+import javax.ejb.Local;
 
- at Name("authenticator")
-public class Authenticator
-{
-    @Logger private Log log;
+ at Local
+public interface Authenticator {
 
-    @In Identity identity;
-    @In Credentials credentials;
+    boolean authenticate();
 
-    public boolean authenticate()
-    {
-        log.info("authenticating {0}", credentials.getUsername());
-        //write your authentication logic here,
-        //return true if the authentication was
-        //successful, false otherwise
-        if ("admin".equals(credentials.getUsername()))
-        {
-            identity.addRole("admin");
-            return true;
-        }
-        return false;
-    }
-
 }

Added: trunk/seam-gen/src/AuthenticatorBean.java
===================================================================
--- trunk/seam-gen/src/AuthenticatorBean.java	                        (rev 0)
+++ trunk/seam-gen/src/AuthenticatorBean.java	2009-03-14 00:01:28 UTC (rev 10154)
@@ -0,0 +1,34 @@
+package @actionPackage@;
+
+import javax.ejb.Stateless;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.security.Credentials;
+import org.jboss.seam.security.Identity;
+
+ at Stateless
+ at Name("authenticator")
+public class AuthenticatorBean implements Authenticator
+{
+    @Logger private Log log;
+
+    @In Identity identity;
+    @In Credentials credentials;
+
+    public boolean authenticate()
+    {
+        log.info("authenticating {0}", credentials.getUsername());
+        //write your authentication logic here,
+        //return true if the authentication was
+        //successful, false otherwise
+        if ("admin".equals(credentials.getUsername()))
+        {
+            identity.addRole("admin");
+            return true;
+        }
+        return false;
+    }
+
+}

Added: trunk/seam-gen/src/AuthenticatorJavaBean.java
===================================================================
--- trunk/seam-gen/src/AuthenticatorJavaBean.java	                        (rev 0)
+++ trunk/seam-gen/src/AuthenticatorJavaBean.java	2009-03-14 00:01:28 UTC (rev 10154)
@@ -0,0 +1,32 @@
+package @actionPackage@;
+
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.security.Credentials;
+import org.jboss.seam.security.Identity;
+
+ at Name("authenticator")
+public class Authenticator
+{
+    @Logger private Log log;
+
+    @In Identity identity;
+    @In Credentials credentials;
+
+    public boolean authenticate()
+    {
+        log.info("authenticating {0}", credentials.getUsername());
+        //write your authentication logic here,
+        //return true if the authentication was
+        //successful, false otherwise
+        if ("admin".equals(credentials.getUsername()))
+        {
+            identity.addRole("admin");
+            return true;
+        }
+        return false;
+    }
+
+}




More information about the seam-commits mailing list