Seam SVN: r10625 - in branches/enterprise/JBPAPP_4_3_FP01: seam-gen and 1 other directories.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2009-04-24 08:34:42 -0400 (Fri, 24 Apr 2009)
New Revision: 10625
Modified:
branches/enterprise/JBPAPP_4_3_FP01/build/common.build.xml
branches/enterprise/JBPAPP_4_3_FP01/seam-gen/build.xml
branches/enterprise/JBPAPP_4_3_FP01/seam-gen/src/EntityList.java.ftl
Log:
JBPAPP-1916
Modified: branches/enterprise/JBPAPP_4_3_FP01/build/common.build.xml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/build/common.build.xml 2009-04-24 01:03:45 UTC (rev 10624)
+++ branches/enterprise/JBPAPP_4_3_FP01/build/common.build.xml 2009-04-24 12:34:42 UTC (rev 10625)
@@ -20,7 +20,7 @@
<property name="tmp.dir" value="${seam.dir}/classes" />
<property name="lib.dir" value="${seam.dir}/lib" />
<property name="endorsed.dir" value="${tmp.dir}/endorsed" />
- <property name="server.profile" value="production" />
+ <property name="jboss.domain" value="production" />
<property name="maven.settings.xml" location="${build.dir}/settings.xml" />
Modified: branches/enterprise/JBPAPP_4_3_FP01/seam-gen/build.xml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/seam-gen/build.xml 2009-04-24 01:03:45 UTC (rev 10624)
+++ branches/enterprise/JBPAPP_4_3_FP01/seam-gen/build.xml 2009-04-24 12:34:42 UTC (rev 10625)
@@ -1,253 +1,257 @@
<?xml version="1.0"?>
-<project name="seam-gen" default="help" basedir="." xmlns:artifact="urn:maven-artifact-ant">
+<project name="seam-gen" default="help" basedir="." xmlns:artifact="urn:maven-artifact-ant">
<!-- Build resources -->
<property name="seam.dir" value="${ant.file.seam-gen}/../../" />
<!-- Order is important -->
<property file="./build.properties" />
<import file="${seam.dir}/build/common.build.xml" />
-
- <target name="init">
- <path id="seam-gen.path" path="${seam.dir}/lib/gen/jboss-seam-gen.jar" />
- <!-- taskdefs -->
- <taskdef name="normalizeProjectName"
+ <target name="init">
+ <path id="seam-gen.path" path="${seam.dir}/lib/gen/jboss-seam-gen.jar" />
+
+ <!-- taskdefs -->
+ <taskdef name="normalizeProjectName"
classname="org.jboss.seam.tool.NormalizeProjectNameTask"
classpathref="seam-gen.path"/>
-
- <taskdef name="packageDirectory"
+
+ <taskdef name="packageDirectory"
classname="org.jboss.seam.tool.PackageDirectoryTask"
classpathref="seam-gen.path"/>
-
- <taskdef name="pathFilename"
+
+ <taskdef name="pathFilename"
classname="org.jboss.seam.tool.PathFilenameTask"
classpathref="seam-gen.path"/>
-
- <taskdef name="lowercaseProperty"
+
+ <taskdef name="lowercaseProperty"
classname="org.jboss.seam.tool.LowercasePropertyTask"
classpathref="seam-gen.path"/>
-
- <taskdef name="uppercaseProperty"
+
+ <taskdef name="uppercaseProperty"
classname="org.jboss.seam.tool.UppercasePropertyTask"
classpathref="seam-gen.path"/>
-
- <taskdef name="print"
+
+ <taskdef name="print"
classname="org.jboss.seam.tool.PrintTask"
classpathref="seam-gen.path"/>
-
- <taskdef name="pathFixer"
+
+ <taskdef name="pathFixer"
classname="org.jboss.seam.tool.FixPathTask"
classpathref="seam-gen.path"/>
</target>
-
- <target name="init-properties" depends="init">
-
- <packageDirectory property="action.dir" package="action/${action.package}"/>
- <packageDirectory property="model.dir" package="model/${model.package}"/>
- <packageDirectory property="test.dir" package="test/${test.package}"/>
- <pathFilename property="driver.file" path="${driver.jar}"/>
-
- <condition property="hibernate.hbm2ddl.auto" value="update">
- <and>
- <equals arg1="${database.exists}" arg2="n"/>
- <equals arg1="${database.drop}" arg2="n"/>
- </and>
- </condition>
- <condition property="hibernate.hbm2ddl.auto" value="validate">
- <and>
- <equals arg1="${database.exists}" arg2="y"/>
- <equals arg1="${database.drop}" arg2="n"/>
- </and>
- </condition>
- <condition property="hibernate.hbm2ddl.auto" value="create-drop">
- <equals arg1="${database.drop}" arg2="y"/>
- </condition>
- <condition property="project.war" value="true">
- <equals arg1="${project.type}" arg2="war"/>
- </condition>
- <condition property="project.ear" value="true">
- <equals arg1="${project.type}" arg2="ear"/>
- </condition>
- <property name="project.home" value="${workspace.home}/${project.name}"/>
-
- <!-- filtersets and filesets -->
-
- <condition property="schema.property" value="
 <property name="hibernate.default_schema" value="${hibernate.default_schema}"/>">
- <isset property="hibernate.default_schema"/>
- </condition>
- <condition property="schema.property" value="">
- <not><isset property="hibernate.default_schema"/></not>
+
+ <target name="init-properties" depends="init">
+
+ <packageDirectory property="action.dir" package="action/${action.package}"/>
+ <packageDirectory property="model.dir" package="model/${model.package}"/>
+ <packageDirectory property="test.dir" package="test/${test.package}"/>
+ <pathFilename property="driver.file" path="${driver.jar}"/>
+
+ <condition property="hibernate.hbm2ddl.auto" value="update">
+ <and>
+ <equals arg1="${database.exists}" arg2="n"/>
+ <equals arg1="${database.drop}" arg2="n"/>
+ </and>
</condition>
-
+ <condition property="hibernate.hbm2ddl.auto" value="validate">
+ <and>
+ <equals arg1="${database.exists}" arg2="y"/>
+ <equals arg1="${database.drop}" arg2="n"/>
+ </and>
+ </condition>
+ <condition property="hibernate.hbm2ddl.auto" value="create-drop">
+ <equals arg1="${database.drop}" arg2="y"/>
+ </condition>
+ <condition property="project.war" value="true">
+ <equals arg1="${project.type}" arg2="war"/>
+ </condition>
+ <condition property="project.ear" value="true">
+ <equals arg1="${project.type}" arg2="ear"/>
+ </condition>
+ <property name="project.home" value="${workspace.home}/${project.name}"/>
+
+ <!-- filtersets and filesets -->
+
+ <condition property="schema.property" value="
 <property name="hibernate.default_schema" value="${hibernate.default_schema}"/>">
+ <isset property="hibernate.default_schema"/>
+ </condition>
+ <condition property="schema.property" value="">
+ <not>
+ <isset property="hibernate.default_schema"/>
+ </not>
+ </condition>
+
<condition property="catalog.property" value="
 <property name="hibernate.default_catalog" value="${hibernate.default_catalog}"/>">
- <isset property="hibernate.default_catalog"/>
+ <isset property="hibernate.default_catalog"/>
</condition>
<condition property="catalog.property" value="">
- <not><isset property="hibernate.default_catalog"/></not>
+ <not>
+ <isset property="hibernate.default_catalog"/>
+ </not>
</condition>
-
- <condition property="base.dir" value="icefaces-staging" else=".">
- <equals arg1="${icefaces}" arg2="y"/>
- </condition>
-
- <filterset id="jdbc">
- <filter token="jdbcUrl" value="${hibernate.connection.url}"/>
- <filter token="driverClass" value="${hibernate.connection.driver_class}"/>
- <filter token="username" value="${hibernate.connection.username}"/>
- <filter token="password" value="${hibernate.connection.password}"/>
- <filter token="catalogProperty" value="${catalog.property}"/>
- <filter token="schemaProperty" value="${schema.property}"/>
- <filter token="hibernate.dialect" value="${hibernate.dialect}"/>
- </filterset>
-
- <echo message="${jboss.home}"/>
-
- <filterset id="project">
- <filter token="projectName" value="${project.name}" />
- <filter token="jbossHome" value="${jboss.home}" />
- <filter token="jbossDomain" value="${jboss.domain}"/>
- <filter token="hbm2ddl" value="${hibernate.hbm2ddl.auto}"/>
- <filter token="driverJar" value="${driver.file}"/>
- <filter token="skin" value="${richfaces.skin}" />
- <filter token="schemaVersion" value="${version}" />
- </filterset>
-
- </target>
-
+
+ <condition property="base.dir" value="icefaces-staging" else=".">
+ <equals arg1="${icefaces}" arg2="y"/>
+ </condition>
+
+ <filterset id="jdbc">
+ <filter token="jdbcUrl" value="${hibernate.connection.url}"/>
+ <filter token="driverClass" value="${hibernate.connection.driver_class}"/>
+ <filter token="username" value="${hibernate.connection.username}"/>
+ <filter token="password" value="${hibernate.connection.password}"/>
+ <filter token="catalogProperty" value="${catalog.property}"/>
+ <filter token="schemaProperty" value="${schema.property}"/>
+ <filter token="hibernate.dialect" value="${hibernate.dialect}"/>
+ </filterset>
+
+ <echo message="${jboss.home}"/>
+
+ <filterset id="project">
+ <filter token="projectName" value="${project.name}" />
+ <filter token="jbossHome" value="${jboss.home}" />
+ <filter token="jbossDomain" value="${jboss.domain}"/>
+ <filter token="hbm2ddl" value="${hibernate.hbm2ddl.auto}"/>
+ <filter token="driverJar" value="${driver.file}"/>
+ <filter token="skin" value="${richfaces.skin}" />
+ <filter token="schemaVersion" value="${version}" />
+ </filterset>
+
+ </target>
+
<!-- targets -->
- <target name="setup-filters">
-
- <filterset id="filters">
- <filter token="interfaceName" value="${interface.name}"/>
- <filter token="beanName" value="${bean.name}"/>
- <filter token="entityName" value="${entity.name}"/>
- <filter token="methodName" value="${method.name}"/>
- <filter token="componentName" value="${component.name}"/>
- <filter token="pageName" value="${page.name}"/>
- <filter token="masterPageName" value="${masterPage.name}"/>
- <filter token="actionPackage" value="${action.package}"/>
- <filter token="modelPackage" value="${model.package}"/>
- <filter token="testPackage" value="${test.package}"/>
- <filter token="listName" value="${component.name}List"/>
- <filter token="homeName" value="${component.name}Home"/>
- <filter token="query" value="${query.text}"/>
- </filterset>
-
- </target>
-
- <target name="setup"
+ <target name="setup-filters">
+
+ <filterset id="filters">
+ <filter token="interfaceName" value="${interface.name}"/>
+ <filter token="beanName" value="${bean.name}"/>
+ <filter token="entityName" value="${entity.name}"/>
+ <filter token="methodName" value="${method.name}"/>
+ <filter token="componentName" value="${component.name}"/>
+ <filter token="pageName" value="${page.name}"/>
+ <filter token="masterPageName" value="${masterPage.name}"/>
+ <filter token="actionPackage" value="${action.package}"/>
+ <filter token="modelPackage" value="${model.package}"/>
+ <filter token="testPackage" value="${test.package}"/>
+ <filter token="listName" value="${component.name}List"/>
+ <filter token="homeName" value="${component.name}Home"/>
+ <filter token="query" value="${query.text}"/>
+ </filterset>
+
+ </target>
+
+ <target name="setup"
description="Prompt for settings" depends="init">
- <property file="./build.properties" prefix="old" />
+ <property file="./build.properties" prefix="old" />
- <echo message="Welcome to seam-gen :-)"/>
- <echo message="Answer each question or hit ENTER to accept the default (in brackets)"/>
- <echo message=""/>
- <property name="old.workspace.home" value="C:/Projects"/>
- <input addproperty="workspace.home.new"
+ <echo message="Welcome to seam-gen ${complete.version} :-)"/>
+ <echo message="Answer each question or hit ENTER to accept the default (in brackets)"/>
+ <echo message=""/>
+ <property name="old.workspace.home" value="C:/Projects"/>
+ <input addproperty="workspace.home.new"
message="Enter the directory where you want the project to be created (should not contain spaces) [${old.workspace.home}]"
defaultvalue="${old.workspace.home}"/>
- <pathFixer property="workspace.home.new" />
-
- <property name="old.jboss.home" value="C:/Program Files/jboss-4.2.2.GA"/>
- <input addproperty="jboss.home.new"
+ <pathFixer property="workspace.home.new" />
+
+ <property name="old.jboss.home" value="C:/Program Files/jboss-4.2.2.GA"/>
+ <input addproperty="jboss.home.new"
message="Enter your JBoss home directory [${old.jboss.home}]"
defaultvalue="${old.jboss.home}"/>
- <pathFixer property="jboss.home.new" />
-
- <property name="old.jboss.domain" value="production"/>
- <input addproperty="jboss.domain.new"
+ <pathFixer property="jboss.home.new" />
+
+ <property name="old.jboss.domain" value="${jboss.domain}"/>
+ <input addproperty="jboss.domain.new"
message="Enter your JBoss AS domain [${old.jboss.domain}]"
defaultvalue="${old.jboss.domain}"/>
-
- <property name="old.project.name" value="myproject"/>
- <input addproperty="project.name.new"
+
+ <property name="old.project.name" value="myproject"/>
+ <input addproperty="project.name.new"
message="Enter the project name [${old.project.name}]"
defaultvalue="${old.project.name}"/>
- <normalizeProjectName property="project.name.new" />
- <echo message="Accepted project name as: ${project.name.new}" />
-
- <property name="old.richfaces.skin" value="blueSky"/>
- <input addproperty="richfaces.skin.new"
+ <normalizeProjectName property="project.name.new" />
+ <echo message="Accepted project name as: ${project.name.new}" />
+
+ <property name="old.richfaces.skin" value="blueSky"/>
+ <input addproperty="richfaces.skin.new"
message="Select a RichFaces skin [${old.richfaces.skin}]"
validargs="blueSky,classic,ruby,wine,deepMarine,emeraldTown,japanCherry,DEFAULT"
defaultvalue="${old.richfaces.skin}"/>
-
- <property name="old.project.type" value="ear"/>
- <input addproperty="project.type.new"
+
+ <property name="old.project.type" value="ear"/>
+ <input addproperty="project.type.new"
message="Is this project deployed as an EAR (with EJB components) or a WAR (with no EJB support) [${old.project.type}]"
validargs="ear,war"
defaultvalue="${old.project.type}"/>
-
- <property name="old.action.package" value="com.mydomain.${project.name.new}"/>
- <input addproperty="action.package.new"
+
+ <property name="old.action.package" value="com.mydomain.${project.name.new}"/>
+ <input addproperty="action.package.new"
message="Enter the Java package name for your session beans [${old.action.package}]"
defaultvalue="${old.action.package}"/>
-
- <property name="old.model.package" value="${action.package.new}"/>
- <input addproperty="model.package.new"
+
+ <property name="old.model.package" value="${action.package.new}"/>
+ <input addproperty="model.package.new"
message="Enter the Java package name for your entity beans [${old.model.package}]"
defaultvalue="${old.model.package}"/>
-
- <property name="old.test.package" value="${action.package.new}.test"/>
- <input addproperty="test.package.new"
+
+ <property name="old.test.package" value="${action.package.new}.test"/>
+ <input addproperty="test.package.new"
message="Enter the Java package name for your test cases [${old.test.package}]"
defaultvalue="${old.test.package}"/>
-
- <condition property="database.type.default" value="${old.database.type}">
- <isset property="old.database.type"/>
- </condition>
- <property name="database.type.default" value="hsql"/>
- <input addproperty="database.type.new"
+
+ <condition property="database.type.default" value="${old.database.type}">
+ <isset property="old.database.type"/>
+ </condition>
+ <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"
defaultvalue="${database.type.default}"/>
-
- <!-- if the database type did not change, default to the previous values -->
-
- <condition property="hibernate.dialect.default" value="${old.hibernate.dialect}">
- <equals arg1="${old.database.type}" arg2="${database.type.new}"/>
- </condition>
- <condition property="hibernate.connection.url.default" value="${old.hibernate.connection.url}">
- <equals arg1="${old.database.type}" arg2="${database.type.new}"/>
- </condition>
- <condition property="hibernate.connection.driver_class.default" value="${old.hibernate.connection.driver_class}">
- <equals arg1="${old.database.type}" arg2="${database.type.new}"/>
- </condition>
-
- <!-- otherwise default to the defaults for the database type -->
-
- <condition property="hibernate.dialect.default" value="org.hibernate.dialect.H2Dialect">
- <equals arg1="${database.type.new}" arg2="h2"/>
- </condition>
- <condition property="hibernate.dialect.default" value="org.hibernate.dialect.HSQLDialect">
- <equals arg1="${database.type.new}" arg2="hsql"/>
- </condition>
- <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.OracleDialect">
- <equals arg1="${database.type.new}" arg2="oracle"/>
- </condition>
- <condition property="hibernate.dialect.default" value="org.hibernate.dialect.PostgreSQLDialect">
- <equals arg1="${database.type.new}" arg2="postgres"/>
- </condition>
- <condition property="hibernate.dialect.default" value="org.hibernate.dialect.SQLServerDialect">
- <equals arg1="${database.type.new}" arg2="mssql"/>
- </condition>
- <condition property="hibernate.dialect.default" value="org.hibernate.dialect.DB2Dialect">
- <equals arg1="${database.type.new}" arg2="db2"/>
- </condition>
- <condition property="hibernate.dialect.default" value="org.hibernate.dialect.SybaseDialect">
- <equals arg1="${database.type.new}" arg2="sybase"/>
- </condition>
- <condition property="hibernate.dialect.default" value="org.hibernate.dialect.PostgreSQLDialect">
- <equals arg1="${database.type.new}" arg2="enterprisedb"/>
- </condition>
- <!-- hibernate tools now correct detects the three available dialects; this detection may no longer be needed -->
- <!--
+ <!-- if the database type did not change, default to the previous values -->
+
+ <condition property="hibernate.dialect.default" value="${old.hibernate.dialect}">
+ <equals arg1="${old.database.type}" arg2="${database.type.new}"/>
+ </condition>
+ <condition property="hibernate.connection.url.default" value="${old.hibernate.connection.url}">
+ <equals arg1="${old.database.type}" arg2="${database.type.new}"/>
+ </condition>
+ <condition property="hibernate.connection.driver_class.default" value="${old.hibernate.connection.driver_class}">
+ <equals arg1="${old.database.type}" arg2="${database.type.new}"/>
+ </condition>
+
+ <!-- otherwise default to the defaults for the database type -->
+
+ <condition property="hibernate.dialect.default" value="org.hibernate.dialect.H2Dialect">
+ <equals arg1="${database.type.new}" arg2="h2"/>
+ </condition>
+ <condition property="hibernate.dialect.default" value="org.hibernate.dialect.HSQLDialect">
+ <equals arg1="${database.type.new}" arg2="hsql"/>
+ </condition>
+ <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.OracleDialect">
+ <equals arg1="${database.type.new}" arg2="oracle"/>
+ </condition>
+ <condition property="hibernate.dialect.default" value="org.hibernate.dialect.PostgreSQLDialect">
+ <equals arg1="${database.type.new}" arg2="postgres"/>
+ </condition>
+ <condition property="hibernate.dialect.default" value="org.hibernate.dialect.SQLServerDialect">
+ <equals arg1="${database.type.new}" arg2="mssql"/>
+ </condition>
+ <condition property="hibernate.dialect.default" value="org.hibernate.dialect.DB2Dialect">
+ <equals arg1="${database.type.new}" arg2="db2"/>
+ </condition>
+ <condition property="hibernate.dialect.default" value="org.hibernate.dialect.SybaseDialect">
+ <equals arg1="${database.type.new}" arg2="sybase"/>
+ </condition>
+ <condition property="hibernate.dialect.default" value="org.hibernate.dialect.PostgreSQLDialect">
+ <equals arg1="${database.type.new}" arg2="enterprisedb"/>
+ </condition>
+
+ <!-- hibernate tools now correct detects the three available dialects; this detection may no longer be needed -->
+ <!--
<condition property="hibernatetool.metadatadialect.new" value="org.hibernate.cfg.reveng.dialect.H2MetaDataDialect">
<equals arg1="${database.type.new}" arg2="h2"/>
</condition>
@@ -266,135 +270,155 @@
</condition>
-->
- <condition property="hibernate.connection.driver_class.default" value="org.h2.Driver">
- <equals arg1="${database.type.new}" arg2="h2"/>
- </condition>
- <condition property="hibernate.connection.driver_class.default" value="org.hsqldb.jdbcDriver">
- <equals arg1="${database.type.new}" arg2="hsql"/>
- </condition>
- <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="oracle.jdbc.driver.OracleDriver">
- <equals arg1="${database.type.new}" arg2="oracle"/>
- </condition>
- <condition property="hibernate.connection.driver_class.default" value="org.postgresql.Driver">
- <equals arg1="${database.type.new}" arg2="postgres"/>
- </condition>
- <condition property="hibernate.connection.driver_class.default" value="com.microsoft.sqlserver.jdbc.SQLServerDriver">
- <equals arg1="${database.type.new}" arg2="mssql"/>
- </condition>
- <condition property="hibernate.connection.driver_class.default" value="COM.ibm.db2.jdbc.app.DB2Driver">
- <equals arg1="${database.type.new}" arg2="db2"/>
- </condition>
- <condition property="hibernate.connection.driver_class.default" value="com.sybase.jdbc2.jdbc.SybDriver">
- <equals arg1="${database.type.new}" arg2="sybase"/>
- </condition>
- <condition property="hibernate.connection.driver_class.default" value="com.edb.Driver">
- <equals arg1="${database.type.new}" arg2="enterprisedb"/>
- </condition>
+ <condition property="hibernate.connection.driver_class.default" value="org.h2.Driver">
+ <equals arg1="${database.type.new}" arg2="h2"/>
+ </condition>
+ <condition property="hibernate.connection.driver_class.default" value="org.hsqldb.jdbcDriver">
+ <equals arg1="${database.type.new}" arg2="hsql"/>
+ </condition>
+ <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="oracle.jdbc.driver.OracleDriver">
+ <equals arg1="${database.type.new}" arg2="oracle"/>
+ </condition>
+ <condition property="hibernate.connection.driver_class.default" value="org.postgresql.Driver">
+ <equals arg1="${database.type.new}" arg2="postgres"/>
+ </condition>
+ <condition property="hibernate.connection.driver_class.default" value="com.microsoft.sqlserver.jdbc.SQLServerDriver">
+ <equals arg1="${database.type.new}" arg2="mssql"/>
+ </condition>
+ <condition property="hibernate.connection.driver_class.default" value="COM.ibm.db2.jdbc.app.DB2Driver">
+ <equals arg1="${database.type.new}" arg2="db2"/>
+ </condition>
+ <condition property="hibernate.connection.driver_class.default" value="com.sybase.jdbc2.jdbc.SybDriver">
+ <equals arg1="${database.type.new}" arg2="sybase"/>
+ </condition>
+ <condition property="hibernate.connection.driver_class.default" value="com.edb.Driver">
+ <equals arg1="${database.type.new}" arg2="enterprisedb"/>
+ </condition>
- <condition property="hibernate.connection.url.default" value="jdbc:h2:.">
- <equals arg1="${database.type.new}" arg2="h2"/>
- </condition>
- <condition property="hibernate.connection.url.default" value="jdbc:hsqldb:.">
- <equals arg1="${database.type.new}" arg2="hsql"/>
- </condition>
- <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:oracle:thin:@localhost:1521:test">
- <equals arg1="${database.type.new}" arg2="oracle"/>
- </condition>
- <condition property="hibernate.connection.url.default" value="jdbc:postgresql:template1">
- <equals arg1="${database.type.new}" arg2="postgres"/>
- </condition>
- <condition property="hibernate.connection.url.default" value="jdbc:sqlserver://localhost">
- <equals arg1="${database.type.new}" arg2="mssql"/>
- </condition>
- <condition property="hibernate.connection.url.default" value="jdbc:db2:test">
- <equals arg1="${database.type.new}" arg2="db2"/>
- </condition>
- <condition property="hibernate.connection.url.default" value="jdbc:sybase:Tds:localhost:5000/test">
- <equals arg1="${database.type.new}" arg2="sybase"/>
- </condition>
- <condition property="hibernate.connection.url.default" value="jdbc:edb://localhost:5444/edb">
- <equals arg1="${database.type.new}" arg2="enterprisedb"/>
- </condition>
-
- <!-- finally, default them to HSQL -->
-
- <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.url.default" value="jdbc:hsqldb:."/>
-
- <input addproperty="hibernate.dialect.new"
+ <condition property="hibernate.connection.url.default" value="jdbc:h2:.">
+ <equals arg1="${database.type.new}" arg2="h2"/>
+ </condition>
+ <condition property="driver.jar.default" value="${seam.dir}/lib/hsqldb.jar">
+ <equals arg1="${database.type.new}" arg2="hsql"/>
+ </condition>
+ <condition property="hibernate.connection.url.default" value="jdbc:hsqldb:.">
+ <equals arg1="${database.type.new}" arg2="hsql"/>
+ </condition>
+ <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:oracle:thin:@localhost:1521:test">
+ <equals arg1="${database.type.new}" arg2="oracle"/>
+ </condition>
+ <condition property="hibernate.connection.url.default" value="jdbc:postgresql:template1">
+ <equals arg1="${database.type.new}" arg2="postgres"/>
+ </condition>
+ <condition property="hibernate.connection.url.default" value="jdbc:sqlserver://localhost">
+ <equals arg1="${database.type.new}" arg2="mssql"/>
+ </condition>
+ <condition property="hibernate.connection.url.default" value="jdbc:db2:test">
+ <equals arg1="${database.type.new}" arg2="db2"/>
+ </condition>
+ <condition property="hibernate.connection.url.default" value="jdbc:sybase:Tds:localhost:5000/test">
+ <equals arg1="${database.type.new}" arg2="sybase"/>
+ </condition>
+ <condition property="hibernate.connection.url.default" value="jdbc:edb://localhost:5444/edb">
+ <equals arg1="${database.type.new}" arg2="enterprisedb"/>
+ </condition>
+
+ <!-- finally, default them to HSQL -->
+
+ <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.url.default" value="jdbc:hsqldb:."/>
+
+ <property name="driver.jar.default" value=""/>
+ <input addproperty="driver.jar.new"
+ message="Enter the filesystem path to the JDBC driver jar [${driver.jar.default}]"
+ defaultvalue="${driver.jar.default}"/>
+
+ <!-- clear extra driver jar name if database isn't DB2
+ ask for license jar if it is -->
+ <condition property="driver.license.jar.new" value="">
+ <not>
+ <equals arg1="${database.type.new}" arg2="db2"/>
+ </not>
+ </condition>
+ <property name="old.driver.license.jar" value=""/>
+ <input addproperty="driver.license.jar.new"
+ message="Enter the filesystem path to the license jar [${old.driver.license.jar}]"
+ defaultvalue="${old.driver.license.jar}"/>
+
+
+ <input addproperty="hibernate.dialect.new"
message="Enter the Hibernate dialect for your database [${hibernate.dialect.default}]"
defaultvalue="${hibernate.dialect.default}"/>
-
- <property name="old.driver.jar" value="../lib/hsqldb.jar"/>
- <input addproperty="driver.jar.new"
+
+ <property name="old.driver.jar" value="${seam.dir}/lib/hsqldb.jar"/>
+ <input addproperty="driver.jar.new"
message="Enter the filesystem path to the JDBC driver jar [${old.driver.jar}]"
defaultvalue="${old.driver.jar}"/>
-
- <input addproperty="hibernate.connection.driver_class.new"
+
+ <input addproperty="hibernate.connection.driver_class.new"
message="Enter the JDBC driver class for your database [${hibernate.connection.driver_class.default}]"
defaultvalue="${hibernate.connection.driver_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}"/>
-
- <property name="old.hibernate.connection.username" value="sa"/>
- <input addproperty="hibernate.connection.username.new"
- message="Enter database username [${old.hibernate.connection.username}]"
- defaultvalue="${old.hibernate.connection.username}"/>
-
- <property name="old.hibernate.connection.password" value=""/>
- <input addproperty="hibernate.connection.password.new"
- message="Enter database password [${old.hibernate.connection.password}]"
- defaultvalue="${old.hibernate.connection.password}"/>
-
- <property name="old.hibernate.default_schema" value=""/>
- <condition property="hibernate.default_schema.new" value="">
- <equals arg1="${database.type.new}" arg2="mysql"/>
- </condition>
- <input addproperty="hibernate.default_schema.new"
+
+ <input addproperty="hibernate.connection.url.new" message="Enter the JDBC URL for your database [${hibernate.connection.url.default}]" defaultvalue="${hibernate.connection.url.default}" />
+
+ <property name="old.hibernate.connection.username" value="sa" />
+ <input addproperty="hibernate.connection.username.new" message="Enter database username [${old.hibernate.connection.username}]" defaultvalue="${old.hibernate.connection.username}" />
+
+ <property name="old.hibernate.connection.password" value="" />
+ <input addproperty="hibernate.connection.password.new" message="Enter database password [${old.hibernate.connection.password}]" defaultvalue="${old.hibernate.connection.password}" />
+
+ <property name="old.hibernate.default_schema" value="" />
+
+ <condition property="hibernate.default_schema.new" value="">
+ <equals arg1="${database.type.new}" arg2="mysql"/>
+ </condition>
+ <input addproperty="hibernate.default_schema.new"
message="Enter the database schema name (it is OK to leave this blank) [${old.hibernate.default_schema}]"
defaultvalue="${old.hibernate.default_schema}"/>
-
- <property name="old.hibernate.default_catalog" value=""/>
- <input addproperty="hibernate.default_catalog.new"
+
+ <property name="old.hibernate.default_catalog" value=""/>
+ <input addproperty="hibernate.default_catalog.new"
message="Enter the database catalog name (it is OK to leave this blank) [${old.hibernate.default_catalog}]"
defaultvalue="${old.hibernate.default_catalog}"/>
-
- <property name="old.database.exists" value="n"/>
- <input addproperty="database.exists.new"
+
+ <property name="old.database.exists" value="n"/>
+ <input addproperty="database.exists.new"
message="Are you working with tables that already exist in the database? [${old.database.exists}]"
validargs="y,n"
defaultvalue="${old.database.exists}"/>
- <property name="old.database.drop" value="n"/>
- <input addproperty="database.drop.new"
+ <property name="old.database.drop" value="n"/>
+ <input addproperty="database.drop.new"
message="Do you want to drop and recreate the database tables and data in import.sql each time you deploy? [${old.database.drop}]"
validargs="y,n"
defaultvalue="${old.database.drop}"/>
-
- <condition property="hibernate.default_schema.key" value="hibernate.default_schema">
- <not><equals arg1="${hibernate.default_schema.new}" arg2=""/></not>
- </condition>
- <condition property="hibernate.default_schema.key" value="hibernate.default_schema.null">
- <equals arg1="${hibernate.default_schema.new}" arg2=""/>
- </condition>
-
- <condition property="hibernate.default_catalog.key" value="hibernate.default_catalog">
- <not><equals arg1="${hibernate.default_catalog.new}" arg2=""/></not>
- </condition>
- <condition property="hibernate.default_catalog.key" value="hibernate.default_catalog.null">
- <equals arg1="${hibernate.default_catalog.new}" arg2=""/>
- </condition>
- <!--
+ <condition property="hibernate.default_schema.key" value="hibernate.default_schema">
+ <not>
+ <equals arg1="${hibernate.default_schema.new}" arg2=""/>
+ </not>
+ </condition>
+ <condition property="hibernate.default_schema.key" value="hibernate.default_schema.null">
+ <equals arg1="${hibernate.default_schema.new}" arg2=""/>
+ </condition>
+
+ <condition property="hibernate.default_catalog.key" value="hibernate.default_catalog">
+ <not>
+ <equals arg1="${hibernate.default_catalog.new}" arg2=""/>
+ </not>
+ </condition>
+ <condition property="hibernate.default_catalog.key" value="hibernate.default_catalog.null">
+ <equals arg1="${hibernate.default_catalog.new}" arg2=""/>
+ </condition>
+
+ <!--
<condition property="hibernatetool.metadatadialect.key" value="hibernatetool.metadatadialect">
<not><equals arg1="${hibernatetool.metadatadialect.new}" arg2=""/></not>
</condition>
@@ -403,409 +427,433 @@
</condition>
-->
- <delete file="build.properties"/>
- <propertyfile file="build.properties" comment="Generated by seam setup">
- <entry key="workspace.home" value="${workspace.home.new}"/>
- <entry key="project.name" value="${project.name.new}"/>
- <entry key="richfaces.skin" value="${richfaces.skin.new}"/>
- <entry key="project.type" value="${project.type.new}"/>
- <entry key="jboss.home" value="${jboss.home.new}"/>
- <entry key="action.package" value="${action.package.new}"/>
- <entry key="model.package" value="${model.package.new}"/>
- <entry key="test.package" value="${test.package.new}"/>
- <entry key="database.type" value="${database.type.new}"/>
- <entry key="database.exists" value="${database.exists.new}"/>
- <entry key="database.drop" value="${database.drop.new}"/>
- <entry key="driver.jar" value="${driver.jar.new}"/>
- <entry key="hibernate.dialect" value="${hibernate.dialect.new}"/>
- <!--<entry key="${hibernatetool.metadatadialect.key}" value="${hibernatetool.metadatadialect.new}" />-->
- <entry key="hibernate.connection.driver_class" value="${hibernate.connection.driver_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}"/>
- <entry key="hibernate.connection.password" value="${hibernate.connection.password.new}"/>
- <entry key="${hibernate.default_schema.key}" value="${hibernate.default_schema.new}"/>
- <entry key="${hibernate.default_catalog.key}" value="${hibernate.default_catalog.new}"/>
- <entry key="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/> <!-- yuck! -->
- </propertyfile>
-
- <echo message="Installing JDBC driver jar to JBoss server"/>
- <copy file="${driver.jar.new}" todir="${jboss.home.new}/server/${jboss.domain.new}/lib"/>
+ <delete file="build.properties"/>
+ <propertyfile file="build.properties" comment="Generated by seam setup">
+ <entry key="workspace.home" value="${workspace.home.new}"/>
+ <entry key="project.name" value="${project.name.new}"/>
+ <entry key="richfaces.skin" value="${richfaces.skin.new}"/>
+ <entry key="project.type" value="${project.type.new}"/>
+ <entry key="jboss.home" value="${jboss.home.new}"/>
+ <entry key="jboss.domain" value="${jboss.domain.new}"/>
+ <entry key="action.package" value="${action.package.new}"/>
+ <entry key="model.package" value="${model.package.new}"/>
+ <entry key="test.package" value="${test.package.new}"/>
+ <entry key="database.type" value="${database.type.new}"/>
+ <entry key="database.exists" value="${database.exists.new}"/>
+ <entry key="database.drop" value="${database.drop.new}"/>
+ <entry key="driver.jar" value="${driver.jar.new}"/>
+ <entry key="driver.license.jar" value="${driver.license.jar.new}"/>
+ <entry key="hibernate.dialect" value="${hibernate.dialect.new}"/>
+ <!--<entry key="${hibernatetool.metadatadialect.key}" value="${hibernatetool.metadatadialect.new}" />-->
+ <entry key="hibernate.connection.driver_class" value="${hibernate.connection.driver_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}"/>
+ <entry key="hibernate.connection.password" value="${hibernate.connection.password.new}"/>
+ <entry key="${hibernate.default_schema.key}" value="${hibernate.default_schema.new}"/>
+ <entry key="${hibernate.default_catalog.key}" value="${hibernate.default_catalog.new}"/>
+ <entry key="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
+ <!-- yuck! -->
+ </propertyfile>
- <echo message="Type 'seam create-project' to create the new project"/>
- </target>
-
- <target name="action-input" depends="init">
-
- <input addproperty="component.name" message="Enter the Seam component name"/>
-
- <uppercaseProperty name="interface.name.default" value="${component.name}"/>
- <condition property="interface.name.prompt" value="local interface">
- <isset property="project.ear"/>
+ <echo message="Installing JDBC driver jar to JBoss server"/>
+ <condition property="has.license.jar">
+ <not><equals arg1="${driver.license.jar.new}" arg2=""/></not>
</condition>
- <condition property="interface.name.prompt" value="bean class">
- <isset property="project.war"/>
- </condition>
- <input message="Enter the ${interface.name.prompt} name [${interface.name.default}]"
+ <copy todir="${jboss.home.new}/server/${jboss.domain.new}/lib" overwrite="true">
+ <fileset file="${driver.jar.new}">
+ <include name="${driver.jar.new}"/>
+ </fileset>
+ <fileset file="${driver.license.jar.new}">
+ <include name="${driver.license.jar.new}" if="has.license.jar"/>
+ <exclude name="**/*" unless="has.license.jar"/>
+ </fileset>
+ </copy>
+
+ <echo message="Type 'seam create-project' to create the new project"/>
+ </target>
+
+ <target name="action-input" depends="init">
+
+ <input addproperty="component.name" message="Enter the Seam component name"/>
+
+ <uppercaseProperty name="interface.name.default" value="${component.name}"/>
+ <condition property="interface.name.prompt" value="local interface">
+ <isset property="project.ear"/>
+ </condition>
+ <condition property="interface.name.prompt" value="bean class">
+ <isset property="project.war"/>
+ </condition>
+ <input message="Enter the ${interface.name.prompt} name [${interface.name.default}]"
addproperty="interface.name"
defaultvalue="${interface.name.default}"/>
-
- <uppercaseProperty name="bean.name.default" value="${component.name}Bean"/>
- <condition property="bean.name" value="${interface.name}">
- <isset property="project.war"/>
- </condition>
- <input message="Enter the bean class name [${bean.name.default}]"
+
+ <uppercaseProperty name="bean.name.default" value="${component.name}Bean"/>
+ <condition property="bean.name" value="${interface.name}">
+ <isset property="project.war"/>
+ </condition>
+ <input message="Enter the bean class name [${bean.name.default}]"
addproperty="bean.name"
defaultvalue="${bean.name.default}"/>
-
- <lowercaseProperty name="method.name.default" value="${component.name}"/>
- <input message="Enter the action method name [${method.name.default}]"
+
+ <lowercaseProperty name="method.name.default" value="${component.name}"/>
+ <input message="Enter the action method name [${method.name.default}]"
addproperty="method.name"
defaultvalue="${method.name.default}"/>
-
- <lowercaseProperty name="page.name.default" value="${component.name}"/>
- <input message="Enter the page name [${page.name.default}]"
+
+ <lowercaseProperty name="page.name.default" value="${component.name}"/>
+ <input message="Enter the page name [${page.name.default}]"
addproperty="page.name"
defaultvalue="${page.name.default}"/>
-
- <property name="bean.file" value="${project.home}/src/${action.dir}/${bean.name}.java"/>
- <property name="interface.file" value="${project.home}/src/${action.dir}/${interface.name}.java"/>
- <property name="page.file" value="${project.home}/view/${page.name}.xhtml"/>
- <property name="test.file" value="${project.home}/src/${test.dir}/${interface.name}Test.java"/>
- <property name="testng.file" value="${project.home}/src/${test.dir}/${interface.name}Test.xml"/>
- </target>
-
- <target name="entity-input" depends="init">
-
- <input addproperty="entity.name" message="Enter the entity class name"/>
- <lowercaseProperty name="component.name" value="${entity.name}"/>
-
- <lowercaseProperty name="masterPage.name.default" value="${component.name}List"/>
- <input message="Enter the master page name [${masterPage.name.default}]"
+ <property name="bean.file" value="${project.home}/src/${action.dir}/${bean.name}.java"/>
+ <property name="interface.file" value="${project.home}/src/${action.dir}/${interface.name}.java"/>
+ <property name="page.file" value="${project.home}/view/${page.name}.xhtml"/>
+ <property name="test.file" value="${project.home}/src/${test.dir}/${interface.name}Test.java"/>
+ <property name="testng.file" value="${project.home}/src/${test.dir}/${interface.name}Test.xml"/>
+
+ </target>
+
+ <target name="entity-input" depends="init">
+
+ <input addproperty="entity.name" message="Enter the entity class name"/>
+ <lowercaseProperty name="component.name" value="${entity.name}"/>
+
+ <lowercaseProperty name="masterPage.name.default" value="${component.name}List"/>
+ <input message="Enter the master page name [${masterPage.name.default}]"
addproperty="masterPage.name"
defaultvalue="${masterPage.name.default}"/>
-
- <lowercaseProperty name="page.name.default" value="${component.name}"/>
- <input message="Enter the detail page name [${page.name.default}]"
+
+ <lowercaseProperty name="page.name.default" value="${component.name}"/>
+ <input message="Enter the detail page name [${page.name.default}]"
addproperty="page.name"
defaultvalue="${page.name.default}"/>
-
- <property name="entity.file" value="${project.home}/src/${model.dir}/${entity.name}.java"/>
- <property name="home.file" value="${project.home}/src/${action.dir}/${entity.name}Home.java"/>
- <property name="list.file" value="${project.home}/src/${action.dir}/${entity.name}List.java"/>
- <property name="page.file" value="${project.home}/view/${page.name}.xhtml"/>
- <property name="masterPage.file" value="${project.home}/view/${masterPage.name}.xhtml"/>
- </target>
-
- <target name="query-input">
- <property name="entity.name.default" value="Entity" />
- <input addproperty="entity.name"
+ <property name="entity.file" value="${project.home}/src/${model.dir}/${entity.name}.java"/>
+ <property name="home.file" value="${project.home}/src/${action.dir}/${entity.name}Home.java"/>
+ <property name="list.file" value="${project.home}/src/${action.dir}/${entity.name}List.java"/>
+ <property name="page.file" value="${project.home}/view/${page.name}.xhtml"/>
+ <property name="masterPage.file" value="${project.home}/view/${masterPage.name}.xhtml"/>
+
+ </target>
+
+ <target name="query-input">
+ <property name="entity.name.default" value="Entity" />
+ <input addproperty="entity.name"
message="Enter the entity class to search for [${entity.name.default}]"
defaultvalue="${entity.name}"/>
- <property name="entity.file" value="${project.home}/src/${model.dir}/${entity.name}.java" />
- <available property="entity.present" file="${entity.file}" />
- <fail unless="entity.present">
+ <property name="entity.file" value="${project.home}/src/${model.dir}/${entity.name}.java" />
+ <available property="entity.present" file="${entity.file}" />
+ <fail unless="entity.present">
The entity ${entity.name} was not found. It was expected to be in ${entity.file}.
</fail>
-
- <lowercaseProperty name="component.name.default" value="${entity.name}Query" />
- <input addproperty="component.name"
+
+ <lowercaseProperty name="component.name.default" value="${entity.name}Query" />
+ <input addproperty="component.name"
message="Enter the Seam query component name [${component.name.default}]"
defaultvalue="${component.name.default}" />
-
- <uppercaseProperty name="bean.name.default" value="${component.name}"/>
- <input message="Enter the query class name [${bean.name.default}]"
+
+ <uppercaseProperty name="bean.name.default" value="${component.name}"/>
+ <input message="Enter the query class name [${bean.name.default}]"
addproperty="bean.name"
defaultvalue="${bean.name.default}"/>
-
- <property name="query.default"
+
+ <property name="query.default"
value="select o from ${entity.name} o" />
- <input message="Enter the EJBQL query string [${query.default}]"
+ <input message="Enter the EJBQL query string [${query.default}]"
addproperty="query.text"
defaultvalue="${query.default}" />
- <lowercaseProperty name="page.name.default" value="${component.name}"/>
- <input message="Enter the query resuls page name [${page.name.default}]"
+ <lowercaseProperty name="page.name.default" value="${component.name}"/>
+ <input message="Enter the query resuls page name [${page.name.default}]"
addproperty="page.name"
defaultvalue="${page.name.default}"/>
-
- <property name="query.file" value="${project.home}/src/${action.dir}/${bean.name}.java"/>
- <property name="page.file" value="${project.home}/view/${page.name}.xhtml"/>
- </target>
+ <property name="query.file" value="${project.home}/src/${action.dir}/${bean.name}.java"/>
+ <property name="page.file" value="${project.home}/view/${page.name}.xhtml"/>
+ </target>
- <target name="copy-lib" depends="copyseam, copyseamdependencies, copyjbossembedded">
- <echo message="Copying Seam and depdencies to the ${project.home}/lib directory..." />
-
- <copy todir="${project.home}/lib" overwrite="true">
- <fileset dir="../lib">
- <exclude name="jboss-container.jar" />
- <exclude name="test/jboss-deplyers.jar" />
- <exclude name="test/jboss-embedded-api.jar" />
- <exclude name="interop/**/*" />
- <exclude name="gen/**/*" />
- </fileset>
- <fileset file="${driver.jar}"/>
- </copy>
- <echo message="Copying JBoss Embedded configuration to the ${project.home}/bootstrap directory..." />
- <copy todir="${project.home}/bootstrap" overwrite="true">
- <fileset dir="../bootstrap" />
- </copy>
-
- </target>
-
+ <target name="copy-lib" depends="copyseam, copyseamdependencies, copyjbossembedded">
+ <echo message="Copying Seam and depdencies to the ${project.home}/lib directory..." />
+
+ <copy todir="${project.home}/lib" overwrite="true">
+ <fileset dir="../lib">
+ <exclude name="jboss-container.jar" />
+ <exclude name="test/jboss-deplyers.jar" />
+ <exclude name="test/jboss-embedded-api.jar" />
+ <exclude name="interop/**/*" />
+ <exclude name="gen/**/*" />
+ </fileset>
+ <fileset file="${driver.jar}"/>
+ </copy>
+
+ <echo message="Copying JBoss Embedded configuration to the ${project.home}/bootstrap directory..." />
+ <copy todir="${project.home}/bootstrap" overwrite="true">
+ <fileset dir="../bootstrap" />
+ </copy>
+
+ </target>
+
<target name="file-copy-war" if="project.war">
- <echo message="Copying resources needed for WAR deployment to the ${project.home}/resources directory..." />
+ <echo message="Copying resources needed for WAR deployment to the ${project.home}/resources directory..." />
<copy tofile="${project.home}/resources/WEB-INF/components.xml"
file="${base.dir}/resources/WEB-INF/components-war.xml">
- <filterset refid="project"/>
- </copy>
- <copy tofile="${project.home}/deployed-jars.list"
+ <filterset refid="project"/>
+ </copy>
+ <copy tofile="${project.home}/deployed-jars.list"
file="${base.dir}/build-scripts/deployed-jars-war.list"/>
- <copy tofile="${project.home}/build.xml"
+ <copy tofile="${project.home}/build.xml"
file="${base.dir}/build-scripts/build-war.xml">
- <filterset refid="project"/>
- </copy>
- <copy todir="${project.home}/resources">
- <fileset dir="${base.dir}/resources/">
- <include name="META-INF/persistence*-war.xml"/>
- <include name="WEB-INF/jboss-web.xml"/>
- </fileset>
- <filterset refid="project"/>
- <filterset refid="jdbc"/>
- </copy>
+ <filterset refid="project"/>
+ </copy>
+ <copy todir="${project.home}/resources">
+ <fileset dir="${base.dir}/resources/">
+ <include name="META-INF/persistence*-war.xml"/>
+ <include name="WEB-INF/jboss-web.xml"/>
+ </fileset>
+ <filterset refid="project"/>
+ <filterset refid="jdbc"/>
+ </copy>
<copy todir="${project.home}/src/action" file="${base.dir}/resources/seam.properties"/>
<copy todir="${project.home}/src/model" file="${base.dir}/resources/seam.properties"/>
</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"
+ <echo message="Copying resources needed for EAR deployment to the ${project.home}/resources directory..." />
+
+ <copy tofile="${project.home}/resources/WEB-INF/components.xml"
file="${base.dir}/resources/WEB-INF/components.xml">
- <filterset refid="project"/>
- </copy>
- <copy tofile="${project.home}/deployed-jars-ear.list"
+ <filterset refid="project"/>
+ </copy>
+ <copy tofile="${project.home}/deployed-jars-ear.list"
file="${base.dir}/build-scripts/deployed-jars-ear.list"/>
- <copy tofile="${project.home}/deployed-jars-war.list"
+ <copy tofile="${project.home}/deployed-jars-war.list"
file="${base.dir}/build-scripts/deployed-jars-ear-war.list"/>
- <copy tofile="${project.home}/build.xml"
+ <copy tofile="${project.home}/build.xml"
file="${base.dir}/build-scripts/build.xml">
- <filterset refid="project"/>
- </copy>
+ <filterset refid="project"/>
+ </copy>
<copy todir="${project.home}" overwrite="true">
- <fileset file="../validate.xml"/>
+ <fileset file="../validate.xml"/>
</copy>
- <copy todir="${project.home}/resources">
- <fileset dir="${base.dir}/resources/">
- <include name="META-INF/application.xml"/>
- <include name="META-INF/jboss-app.xml"/>
- <include name="META-INF/ejb-jar.xml"/>
- <include name="META-INF/persistence*.xml"/>
- <exclude name="META-INF/persistence*-war.xml"/>
- </fileset>
- <filterset refid="project"/>
- <filterset refid="jdbc"/>
- </copy>
+ <copy todir="${project.home}/resources">
+ <fileset dir="${base.dir}/resources/">
+ <include name="META-INF/application.xml"/>
+ <include name="META-INF/jboss-app.xml"/>
+ <include name="META-INF/ejb-jar.xml"/>
+ <include name="META-INF/persistence*.xml"/>
+ <exclude name="META-INF/persistence*-war.xml"/>
+ </fileset>
+ <filterset refid="project"/>
+ <filterset refid="jdbc"/>
+ </copy>
</target>
-
- <target name="file-copy" depends="file-copy-war,file-copy-ear,setup-filters">
- <copy tofile="${project.home}/seam-gen.properties"
+ <target name="file-copy" depends="file-copy-war,file-copy-ear,setup-filters">
+
+ <copy tofile="${project.home}/seam-gen.properties"
file="./build.properties"/>
-
- <copy todir="${project.home}/resources">
- <fileset dir="${base.dir}/resources/">
- <exclude name="datasource-ds.xml"/>
- <exclude name="import.sql"/>
- <exclude name="WEB-INF/components*.xml"/>
- <exclude name="META-INF/persistence*.xml"/>
- <exclude name="META-INF/application.xml"/>
- <exclude name="META-INF/jboss-app.xml"/>
- <exclude name="META-INF/ejb-jar.xml"/>
- <exclude name="WEB-INF/jboss-web.xml"/>
- </fileset>
- <filterset refid="project"/>
- <filterset refid="jdbc"/>
- </copy>
- <copy tofile="${project.home}/debug-jboss-${project.name}.launch"
+ <copy todir="${project.home}/resources">
+ <fileset dir="${base.dir}/resources/">
+ <exclude name="datasource-ds.xml"/>
+ <exclude name="import.sql"/>
+ <exclude name="WEB-INF/components*.xml"/>
+ <exclude name="META-INF/persistence*.xml"/>
+ <exclude name="META-INF/application.xml"/>
+ <exclude name="META-INF/jboss-app.xml"/>
+ <exclude name="META-INF/ejb-jar.xml"/>
+ <exclude name="WEB-INF/jboss-web.xml"/>
+ </fileset>
+ <filterset refid="project"/>
+ <filterset refid="jdbc"/>
+ </copy>
+
+ <copy tofile="${project.home}/debug-jboss-${project.name}.launch"
file="${base.dir}/build-scripts/debug-jboss.launch">
- <filterset refid="project"/>
- </copy>
+ <filterset refid="project"/>
+ </copy>
- <copy tofile="${project.home}/${project.name}.launch"
+ <copy tofile="${project.home}/${project.name}.launch"
file="${base.dir}/hibernatetools/hibernate-console.launch">
- <filterset refid="project"/>
- </copy>
+ <filterset refid="project"/>
+ </copy>
- <copy tofile="${project.home}/hibernate-console.properties"
+ <copy tofile="${project.home}/hibernate-console.properties"
file="${base.dir}/hibernatetools/hibernate-console.properties">
- <filterset refid="project"/>
- <filterset refid="jdbc"/>
- <filterset>
- <filter token="hibernate.dialect" value="${hibernate.dialect}"/>
- </filterset>
- </copy>
+ <filterset refid="project"/>
+ <filterset refid="jdbc"/>
+ <filterset>
+ <filter token="hibernate.dialect" value="${hibernate.dialect}"/>
+ </filterset>
+ </copy>
- <copy tofile="${project.home}/resources/seam-gen.reveng.xml"
+ <copy tofile="${project.home}/resources/seam-gen.reveng.xml"
file="${base.dir}/hibernatetools/seam-gen.reveng.xml">
- <filterset refid="project"/>
- </copy>
+ <filterset refid="project"/>
+ </copy>
- <copy tofile="${project.home}/.settings/org.hibernate.eclipse.console.prefs"
+ <copy tofile="${project.home}/.settings/org.hibernate.eclipse.console.prefs"
file="${base.dir}/hibernatetools/.settings/org.hibernate.eclipse.console.prefs">
- <filterset refid="project"/>
- </copy>
+ <filterset refid="project"/>
+ </copy>
- <copy tofile="${project.home}/resources/${project.name}-dev-ds.xml"
+ <copy tofile="${project.home}/resources/${project.name}-dev-ds.xml"
file="${base.dir}/resources/datasource-ds.xml">
- <filterset refid="project"/>
- <filterset refid="jdbc"/>
- </copy>
-
- <copy tofile="${project.home}/resources/${project.name}-prod-ds.xml"
+ <filterset refid="project"/>
+ <filterset refid="jdbc"/>
+ </copy>
+
+ <copy tofile="${project.home}/resources/${project.name}-prod-ds.xml"
file="${base.dir}/resources/datasource-ds.xml">
- <filterset refid="project"/>
- <filterset refid="jdbc"/>
- </copy>
-
- <copy tofile="${project.home}/resources/import-dev.sql"
+ <filterset refid="project"/>
+ <filterset refid="jdbc"/>
+ </copy>
+
+ <copy tofile="${project.home}/resources/import-dev.sql"
file="${base.dir}/resources/import.sql">
- <filterset refid="project"/>
- <filterset refid="jdbc"/>
- </copy>
-
- <copy tofile="${project.home}/resources/import-prod.sql"
+ <filterset refid="project"/>
+ <filterset refid="jdbc"/>
+ </copy>
+
+ <copy tofile="${project.home}/resources/import-prod.sql"
file="${base.dir}/resources/import.sql">
- <filterset refid="project"/>
- <filterset refid="jdbc"/>
- </copy>
-
- <copy tofile="${project.home}/resources/import-test.sql"
+ <filterset refid="project"/>
+ <filterset refid="jdbc"/>
+ </copy>
+
+ <copy tofile="${project.home}/resources/import-test.sql"
file="${base.dir}/resources/import.sql">
- <filterset refid="project"/>
- <filterset refid="jdbc"/>
- </copy>
-
- <copy todir="${project.home}/view">
- <fileset id="view" dir="${base.dir}/view">
- <include name="home.xhtml"/>
- <include name="error.xhtml"/>
- <include name="login.xhtml"/>
- <include name="login.page.xml"/>
- <include name="index.html"/>
- <include name="layout/*"/>
- <include name="stylesheet/*"/>
- <exclude name="**/*.ftl"/>
- </fileset>
- <filterset refid="project"/>
- </copy>
- <!-- Images have to be copied without filter -->
- <copy todir="${project.home}/view">
- <fileset id="view" dir="${base.dir}/view">
- <include name="img/*"/>
- <include name="favicon.ico"/>
- </fileset>
- </copy>
-
- <copy todir="${project.home}/src/${action.dir}">
- <fileset dir="${base.dir}/src/">
- <include name="Authenticator.java"/>
- </fileset>
- <filterset refid="filters"/>
- </copy>
-
- <copy todir="${project.home}">
- <fileset dir="${base.dir}/build-scripts">
- <exclude name="build*.xml"/>
- <exclude name="*.list"/>
- <exclude name="debug-jboss.launch"/>
- </fileset>
- <filterset refid="project"/>
- </copy>
-
- <mkdir dir="${project.home}/src/model"/>
- <mkdir dir="${project.home}/src/action"/>
- <mkdir dir="${project.home}/src/test"/>
-
- <copy todir="${project.home}/src/test" file="${base.dir}/test/readme.txt" />
+ <filterset refid="project"/>
+ <filterset refid="jdbc"/>
+ </copy>
- <mkdir dir="${project.home}/nbproject"/>
- <copy todir="${project.home}/nbproject">
- <fileset dir="${base.dir}/nbproject" />
- <filterset refid="project"/>
- </copy>
+ <copy todir="${project.home}/view">
+ <fileset id="view" dir="${base.dir}/view">
+ <include name="home.xhtml"/>
+ <include name="error.xhtml"/>
+ <include name="login.xhtml"/>
+ <include name="login.page.xml"/>
+ <include name="index.html"/>
+ <include name="layout/*"/>
+ <include name="stylesheet/*"/>
+ <exclude name="**/*.ftl"/>
+ </fileset>
+ <filterset refid="project"/>
+ </copy>
+ <!-- Images have to be copied without filter -->
+ <copy todir="${project.home}/view">
+ <fileset id="view" dir="${base.dir}/view">
+ <include name="img/*"/>
+ <include name="favicon.ico"/>
+ </fileset>
+ </copy>
- </target>
-
- <target name="validate-project" depends="init-properties, validate-workspace">
- <fail message="No project name specified (run 'seam create-project' first)">
- <condition>
- <or>
- <not><isset property="project.name"/></not>
- <equals arg1="${project.name}" arg2=""/>
- </or>
- </condition>
- </fail>
- <fail message="Invalid package combination. If the default package is used, then all classes (action, model, and test) must be in the default package">
- <condition>
- <and>
- <or>
- <equals arg1="${action.package}" arg2="" />
- <equals arg1="${model.package}" arg2="" />
- <equals arg1="${test.package}" arg2="" />
- </or>
- <or>
- <not><equals arg1="${action.package}" arg2="" /></not>
- <not><equals arg1="${model.package}" arg2="" /></not>
- <not><equals arg1="${test.package}" arg2="" /></not>
- </or>
- </and>
- </condition>
- </fail>
- </target>
+ <copy todir="${project.home}/src/${action.dir}">
+ <fileset dir="${base.dir}/src/">
+ <include name="Authenticator.java"/>
+ </fileset>
+ <filterset refid="filters"/>
+ </copy>
- <target name="validate-workspace">
- <fail message="No project workspace specified (run 'seam setup' first)">
- <condition>
- <or>
- <not><isset property="workspace.home"/></not>
- <equals arg1="${workspace.home}" arg2=""/>
- </or>
- </condition>
- </fail>
- </target>
-
+ <copy todir="${project.home}">
+ <fileset dir="${base.dir}/build-scripts">
+ <exclude name="build*.xml"/>
+ <exclude name="*.list"/>
+ <exclude name="debug-jboss.launch"/>
+ </fileset>
+ <filterset refid="project"/>
+ </copy>
+
+ <mkdir dir="${project.home}/src/model"/>
+ <mkdir dir="${project.home}/src/action"/>
+ <mkdir dir="${project.home}/src/test"/>
+
+ <copy todir="${project.home}/src/test" file="${base.dir}/test/readme.txt" />
+
+ <mkdir dir="${project.home}/nbproject"/>
+ <copy todir="${project.home}/nbproject">
+ <fileset dir="${base.dir}/nbproject" />
+ <filterset refid="project"/>
+ </copy>
+
+ </target>
+
+ <target name="validate-project" depends="init-properties, validate-workspace">
+ <fail message="No project name specified (run 'seam create-project' first)">
+ <condition>
+ <or>
+ <not>
+ <isset property="project.name"/>
+ </not>
+ <equals arg1="${project.name}" arg2=""/>
+ </or>
+ </condition>
+ </fail>
+ <fail message="Invalid package combination. If the default package is used, then all classes (action, model, and test) must be in the default package">
+ <condition>
+ <and>
+ <or>
+ <equals arg1="${action.package}" arg2="" />
+ <equals arg1="${model.package}" arg2="" />
+ <equals arg1="${test.package}" arg2="" />
+ </or>
+ <or>
+ <not>
+ <equals arg1="${action.package}" arg2="" />
+ </not>
+ <not>
+ <equals arg1="${model.package}" arg2="" />
+ </not>
+ <not>
+ <equals arg1="${test.package}" arg2="" />
+ </not>
+ </or>
+ </and>
+ </condition>
+ </fail>
+ </target>
+
+ <target name="validate-workspace">
+ <fail message="No project workspace specified (run 'seam setup' first)">
+ <condition>
+ <or>
+ <not>
+ <isset property="workspace.home"/>
+ </not>
+ <equals arg1="${workspace.home}" arg2=""/>
+ </or>
+ </condition>
+ </fail>
+ </target>
+
<!-- Do not remove new-project, netbeans depends on it -->
<target name="new-project" depends="create-project" />
- <target name="create-project" depends="validate-project,copy-lib,file-copy"
+ <target name="create-project" depends="validate-project,copy-lib,file-copy"
description="Create a new project">
- <echo message="A new Seam project named '${project.name}' was created in the ${workspace.home} directory"/>
- <echo message="Type 'seam explode' and go to http://localhost:8080/${project.name}"/>
- <echo message="Eclipse Users: Add the project into Eclipse using File > New > Project and select General > Project (not Java Project)"/>
- <echo message="NetBeans Users: Open the project in NetBeans"/>
- </target>
+ <echo message="A new Seam project named '${project.name}' was created in the ${workspace.home} directory"/>
+ <echo message="Type 'seam explode' and go to http://localhost:8080/${project.name}"/>
+ <echo message="Eclipse Users: Add the project into Eclipse using File > New > Project and select General > Project (not Java Project)"/>
+ <echo message="NetBeans Users: Open the project in NetBeans"/>
+ </target>
- <target name="update-project" depends="validate-project,copy-lib"
+ <target name="update-project" depends="validate-project,copy-lib"
description="Update project dependencies">
- <echo message="Updated project '${project.name}' with the latest Seam jars" />
- <echo message="Type 'seam restart' to update the exploded deployment"/>
- </target>
+ <echo message="Updated project '${project.name}' with the latest Seam jars" />
+ <echo message="Type 'seam restart' to update the exploded deployment"/>
+ </target>
- <target name="delete-project" depends="validate-project,unexplode,undeploy"
+ <target name="delete-project" depends="validate-project,unexplode,undeploy"
description="Delete the project">
- <echo message="Deleting the entire project in ${project.home}" />
- <delete dir="${project.home}" />
- </target>
-
+ <echo message="Deleting the entire project in ${project.home}" />
+ <delete dir="${project.home}" />
+ </target>
+
<target name="new-action" depends="new-action-ear,new-action-war"
description="Create a new action"/>
<target name="new-form" depends="new-form-ear,new-form-war"
@@ -813,210 +861,213 @@
<target name="new-conversation" depends="new-conversation-ear,new-conversation-war"
description="Create a new conversation controller"/>
- <target name="new-action-ear" depends="validate-project,action-input,setup-filters" unless="project.war">
- <echo message="Creating a new stateless session bean component with an action method" />
- <copy file="${base.dir}/src/ActionBean.java" tofile="${bean.file}">
- <filterset refid="filters"/>
- </copy>
- <copy file="${base.dir}/src/Action.java" tofile="${interface.file}">
- <filterset refid="filters"/>
- </copy>
- <copy file="${base.dir}/test/ActionTest.java" tofile="${test.file}">
- <filterset refid="filters"/>
- </copy>
- <copy file="${base.dir}/test/testng.xml" tofile="${testng.file}">
- <filterset refid="filters"/>
- </copy>
- <copy file="${base.dir}/view/action.xhtml" tofile="${page.file}">
- <filterset refid="filters"/>
- </copy>
- <echo message="Type 'seam restart' and go to http://localhost:8080/${project.name}/${page.name}.seam"/>
- </target>
+ <target name="new-action-ear" depends="validate-project,action-input,setup-filters" unless="project.war">
+ <echo message="Creating a new stateless session bean component with an action method" />
+ <copy file="${base.dir}/src/ActionBean.java" tofile="${bean.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <copy file="${base.dir}/src/Action.java" tofile="${interface.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <copy file="${base.dir}/test/ActionTest.java" tofile="${test.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <copy file="${base.dir}/test/testng.xml" tofile="${testng.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <copy file="${base.dir}/view/action.xhtml" tofile="${page.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <echo message="Type 'seam restart' and go to http://localhost:8080/${project.name}/${page.name}.seam"/>
+ </target>
- <target name="new-action-war" depends="validate-project,action-input,setup-filters" if="project.war">
- <echo message="Creating a new JavaBean component with an action method" />
- <copy file="${base.dir}/src/ActionJavaBean.java" tofile="${interface.file}">
- <filterset refid="filters"/>
- </copy>
- <copy file="${base.dir}/test/ActionTest.java" tofile="${test.file}">
- <filterset refid="filters"/>
- </copy>
- <copy file="${base.dir}/test/testng.xml" tofile="${testng.file}">
- <filterset refid="filters"/>
- </copy>
- <copy file="${base.dir}/view/action.xhtml" tofile="${page.file}">
- <filterset refid="filters"/>
- </copy>
- <echo message="Type 'seam explode' and go to http://localhost:8080/${project.name}/${page.name}.seam"/>
- </target>
+ <target name="new-action-war" depends="validate-project,action-input,setup-filters" if="project.war">
+ <echo message="Creating a new JavaBean component with an action method" />
+ <copy file="${base.dir}/src/ActionJavaBean.java" tofile="${interface.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <copy file="${base.dir}/test/ActionTest.java" tofile="${test.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <copy file="${base.dir}/test/testng.xml" tofile="${testng.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <copy file="${base.dir}/view/action.xhtml" tofile="${page.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <echo message="Type 'seam explode' and go to http://localhost:8080/${project.name}/${page.name}.seam"/>
+ </target>
- <target name="new-form-war" depends="validate-project,action-input,setup-filters" if="project.war">
- <echo message="Creating a new JavaBean component with an action method" />
- <copy file="${base.dir}/src/FormActionJavaBean.java" tofile="${interface.file}">
- <filterset refid="filters"/>
- </copy>
- <copy file="${base.dir}/test/FormTest.java" tofile="${test.file}">
- <filterset refid="filters"/>
- </copy>
- <copy file="${base.dir}/view/form.xhtml" tofile="${page.file}">
- <filterset refid="filters"/>
- </copy>
- <copy file="${base.dir}/test/testng.xml" tofile="${testng.file}">
- <filterset refid="filters"/>
- </copy>
- <echo message="Type 'seam explode' and go to http://localhost:8080/${project.name}/${page.name}.seam"/>
- </target>
+ <target name="new-form-war" depends="validate-project,action-input,setup-filters" if="project.war">
+ <echo message="Creating a new JavaBean component with an action method" />
+ <copy file="${base.dir}/src/FormActionJavaBean.java" tofile="${interface.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <copy file="${base.dir}/test/FormTest.java" tofile="${test.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <copy file="${base.dir}/view/form.xhtml" tofile="${page.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <copy file="${base.dir}/test/testng.xml" tofile="${testng.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <echo message="Type 'seam explode' and go to http://localhost:8080/${project.name}/${page.name}.seam"/>
+ </target>
- <target name="new-form-ear" depends="validate-project,action-input,setup-filters" unless="project.war">
- <echo message="Creating a new stateful session bean component with an action method" />
- <copy file="${base.dir}/src/FormActionBean.java" tofile="${bean.file}">
- <filterset refid="filters"/>
- </copy>
- <copy file="${base.dir}/src/FormAction.java" tofile="${interface.file}">
- <filterset refid="filters"/>
- </copy>
- <copy file="${base.dir}/test/FormTest.java" tofile="${test.file}">
- <filterset refid="filters"/>
- </copy>
- <copy file="${base.dir}/view/form.xhtml" tofile="${page.file}">
- <filterset refid="filters"/>
- </copy>
- <copy file="${base.dir}/test/testng.xml" tofile="${testng.file}">
- <filterset refid="filters"/>
- </copy>
- <echo message="Type 'seam restart' and go to http://localhost:8080/${project.name}/${page.name}.seam"/>
- </target>
+ <target name="new-form-ear" depends="validate-project,action-input,setup-filters" unless="project.war">
+ <echo message="Creating a new stateful session bean component with an action method" />
+ <copy file="${base.dir}/src/FormActionBean.java" tofile="${bean.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <copy file="${base.dir}/src/FormAction.java" tofile="${interface.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <copy file="${base.dir}/test/FormTest.java" tofile="${test.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <copy file="${base.dir}/view/form.xhtml" tofile="${page.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <copy file="${base.dir}/test/testng.xml" tofile="${testng.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <echo message="Type 'seam restart' and go to http://localhost:8080/${project.name}/${page.name}.seam"/>
+ </target>
- <target name="new-query" depends="validate-project,query-input,setup-filters">
- <echo message="Creating a new query" />
- <copy file="${base.dir}/src/Query.java" tofile="${query.file}">
- <filterset refid="filters"/>
- </copy>
+ <target name="new-query" depends="validate-project,query-input,setup-filters">
+ <echo message="Creating a new query" />
+ <copy file="${base.dir}/src/Query.java" tofile="${query.file}">
+ <filterset refid="filters"/>
+ </copy>
- <copy file="${base.dir}/view/query.xhtml" tofile="${page.file}">
- <filterset refid="filters"/>
- </copy>
+ <copy file="${base.dir}/view/query.xhtml" tofile="${page.file}">
+ <filterset refid="filters"/>
+ </copy>
- <echo message="Type 'seam restart' and go to http://localhost:8080/${project.name}/${page.name}.seam"/>
- </target>
+ <echo message="Type 'seam restart' and go to http://localhost:8080/${project.name}/${page.name}.seam"/>
+ </target>
- <target name="new-conversation-ear" depends="validate-project,action-input,setup-filters" unless="project.war">
- <echo message="Creating a new stateful session bean component with @Begin and @End methods" />
- <copy file="${base.dir}/src/ConversationBean.java" tofile="${bean.file}">
- <filterset refid="filters"/>
- </copy>
- <copy file="${base.dir}/src/Conversation.java" tofile="${interface.file}">
- <filterset refid="filters"/>
- </copy>
- <copy file="${base.dir}/view/conversation.xhtml" tofile="${page.file}">
- <filterset refid="filters"/>
- </copy>
- <echo message="Type 'seam restart' and go to http://localhost:8080/${project.name}/${page.name}.seam"/>
- </target>
+ <target name="new-conversation-ear" depends="validate-project,action-input,setup-filters" unless="project.war">
+ <echo message="Creating a new stateful session bean component with @Begin and @End methods" />
+ <copy file="${base.dir}/src/ConversationBean.java" tofile="${bean.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <copy file="${base.dir}/src/Conversation.java" tofile="${interface.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <copy file="${base.dir}/view/conversation.xhtml" tofile="${page.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <echo message="Type 'seam restart' and go to http://localhost:8080/${project.name}/${page.name}.seam"/>
+ </target>
- <target name="new-conversation-war" depends="validate-project,action-input,setup-filters" if="project.war">
- <echo message="Creating a new JavaBean component with @Begin and @End methods" />
- <copy file="${base.dir}/src/ConversationJavaBean.java" tofile="${interface.file}">
- <filterset refid="filters"/>
- </copy>
- <copy file="${base.dir}/view/conversation.xhtml" tofile="${page.file}">
- <filterset refid="filters"/>
- </copy>
- <echo message="Type 'seam explode' and go to http://localhost:8080/${project.name}/${page.name}.seam"/>
- </target>
+ <target name="new-conversation-war" depends="validate-project,action-input,setup-filters" if="project.war">
+ <echo message="Creating a new JavaBean component with @Begin and @End methods" />
+ <copy file="${base.dir}/src/ConversationJavaBean.java" tofile="${interface.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <copy file="${base.dir}/view/conversation.xhtml" tofile="${page.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <echo message="Type 'seam explode' and go to http://localhost:8080/${project.name}/${page.name}.seam"/>
+ </target>
- <target name="new-entity" depends="validate-project,entity-input,setup-filters"
+ <target name="new-entity" depends="validate-project,entity-input,setup-filters"
description="Create a new entity">
- <echo message="Creating a new entity bean, with home and list components" />
- <copy file="${base.dir}/src/Entity.java" tofile="${entity.file}">
- <filterset refid="filters"/>
- </copy>
- <copy file="${base.dir}/src/EntityHome.java" tofile="${home.file}">
- <filterset refid="filters"/>
- </copy>
- <copy file="${base.dir}/src/EntityList.java" tofile="${list.file}">
- <filterset refid="filters"/>
- </copy>
- <copy file="${base.dir}/view/edit.xhtml" tofile="${page.file}">
- <filterset refid="filters"/>
- </copy>
- <copy file="${base.dir}/view/list.xhtml" tofile="${masterPage.file}">
- <filterset refid="filters"/>
- </copy>
- <replace file="${project.home}/view/layout/menu.xhtml">
- <replacetoken><![CDATA[<!-- @newMenuItem@ -->]]></replacetoken>
- <replacevalue><![CDATA[<s:link view="/@masterPageName@.xhtml" value="@entityName@ List" propagation="none"/>
- <!-- @newMenuItem@ -->]]></replacevalue>
- </replace>
- <replace file="${project.home}/view/layout/menu.xhtml">
- <replacefilter token="@masterPageName@" value="${masterPage.name}" />
- <replacefilter token="@entityName@" value="${entity.name}" />
- </replace>
- <echo message="Type 'seam restart' and go to http://localhost:8080/${project.name}/${masterPage.name}.seam"/>
- </target>
+ <echo message="Creating a new entity bean, with home and list components" />
+ <copy file="${base.dir}/src/Entity.java" tofile="${entity.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <copy file="${base.dir}/src/EntityHome.java" tofile="${home.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <copy file="${base.dir}/src/EntityList.java" tofile="${list.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <copy file="${base.dir}/view/edit.xhtml" tofile="${page.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <copy file="${base.dir}/view/list.xhtml" tofile="${masterPage.file}">
+ <filterset refid="filters"/>
+ </copy>
+ <replace file="${project.home}/view/layout/menu.xhtml">
+ <replacetoken>
+ <![CDATA[<!-- @newMenuItem@ -->]]></replacetoken>
+ <replacevalue>
+ <![CDATA[<s:link view="/@masterPageName@.xhtml" value="@entityName@ List" propagation="none"/>
+ <!-- @newMenuItem@ -->]]></replacevalue>
+ </replace>
+ <replace file="${project.home}/view/layout/menu.xhtml">
+ <replacefilter token="@masterPageName@" value="${masterPage.name}" />
+ <replacefilter token="@entityName@" value="${entity.name}" />
+ </replace>
+ <echo message="Type 'seam restart' and go to http://localhost:8080/${project.name}/${masterPage.name}.seam"/>
+ </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"
description="Reverse engineer entities from the database">
</target>
-
+
<target name="init-generate">
<path id="htools.classpath">
- <pathelement path="../lib/ant.jar"/>
- <pathelement path="../lib/gen/hibernate-tools.jar"/>
- <pathelement path="../lib/gen/freemarker.jar"/>
- <pathelement path="../lib/jboss-seam.jar"/>
- <pathelement path="../lib/gen/runtime.jar"/>
- <pathelement path="../lib/gen/common.jar"/>
- <pathelement path="../lib/gen/text.jar"/>
- <pathelement path="../lib/dom4j.jar" />
- <pathelement path="../lib/persistence-api.jar" />
- <pathelement path="../lib/hibernate3.jar" />
- <pathelement path="../lib/hibernate-commons-annotations.jar" />
- <pathelement path="../lib/hibernate-annotations.jar" />
- <pathelement path="../lib/hibernate-entitymanager.jar" />
- <pathelement path="../lib/hibernate-validator.jar"/>
- <pathelement path="../lib/commons-collections.jar" />
- <pathelement path="../lib/commons-logging.jar" />
- <pathelement path="../lib/javassist.jar" />
- <pathelement path="../lib/cglib.jar" />
- <pathelement path="../lib/gen/asm.jar" />
- <pathelement path="../lib/core.jar" />
- <pathelement path="../lib/jboss-common-core.jar" />
- <pathelement path="${driver.jar}"/>
- <pathelement path="../lib/gen/jboss-seam-gen.jar"/>
- </path>
+ <pathelement path="../lib/ant.jar"/>
+ <pathelement path="../lib/gen/hibernate-tools.jar"/>
+ <pathelement path="../lib/gen/freemarker.jar"/>
+ <pathelement path="../lib/jboss-seam.jar"/>
+ <pathelement path="../lib/gen/runtime.jar"/>
+ <pathelement path="../lib/gen/common.jar"/>
+ <pathelement path="../lib/gen/text.jar"/>
+ <pathelement path="../lib/dom4j.jar" />
+ <pathelement path="../lib/persistence-api.jar" />
+ <pathelement path="../lib/hibernate3.jar" />
+ <pathelement path="../lib/hibernate-commons-annotations.jar" />
+ <pathelement path="../lib/hibernate-annotations.jar" />
+ <pathelement path="../lib/hibernate-entitymanager.jar" />
+ <pathelement path="../lib/hibernate-validator.jar"/>
+ <pathelement path="../lib/commons-collections.jar" />
+ <pathelement path="../lib/commons-logging.jar" />
+ <pathelement path="../lib/javassist.jar" />
+ <pathelement path="../lib/cglib.jar" />
+ <pathelement path="../lib/gen/asm.jar" />
+ <pathelement path="../lib/core.jar" />
+ <pathelement path="../lib/jboss-common-core.jar" />
+ <pathelement path="${driver.jar}"/>
+ <pathelement path="${driver.license.jar}"/>
+ <pathelement path="../lib/gen/jboss-seam-gen.jar"/>
+ </path>
<taskdef name="hibernate" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="htools.classpath"/>
</target>
-
+
<target name="generate-model" depends="validate-project,init-generate">
<echo message="Reverse engineering database using JDBC driver ${driver.jar}"/>
- <echo>project=${project.home}</echo>
- <echo>model=${model.package}</echo>
+ <echo>project=${project.home}</echo>
+ <echo>model=${model.package}</echo>
<hibernate templatepath="${base.dir}">
- <jdbcconfiguration propertyfile="build.properties"
+ <jdbcconfiguration propertyfile="build.properties"
packagename="${model.package}"
revengfile="${project.home}/resources/seam-gen.reveng.xml"
detectmanytomany="false"/>
-
- <property key="hibernatetool.util.toolclass"
+
+ <property key="hibernatetool.util.toolclass"
value="org.jboss.seam.tool.Util"/>
-
- <hbm2java jdk5="true" ejb3="true" destdir="${project.home}/src/model"/>
+
+ <hbm2java jdk5="true" ejb3="true" destdir="${project.home}/src/model"/>
</hibernate>
<taskdef name="javaformatter"
classname="org.hibernate.tool.ant.JavaFormatterTask" classpathref="htools.classpath"/>
- <javaformatter>
- <fileset dir="${project.home}/src/model">
- <include name="**/*.java"/>
- </fileset>
+ <javaformatter>
+ <fileset dir="${project.home}/src/model">
+ <include name="**/*.java"/>
+ </fileset>
</javaformatter>
</target>
-
+
<target name="generate-ui" depends="validate-project,init-generate" description="Build the ui based on existing entities">
<echo message="Building project '${project.name}' to generate views and controllers" />
@@ -1029,7 +1080,7 @@
<ant antfile="${project.home}/build.xml" target="${project.jar.target}" inheritall="false"/>
<hibernate templatepath="${base.dir}">
-
+
<jpaconfiguration persistenceunit="${project.name}" />
<classpath>
<dirset dir="${project.home}/exploded-archives">
@@ -1039,43 +1090,43 @@
</dirset>
</classpath>
<property key="hibernatetool.util.toolclass" value="org.jboss.seam.tool.Util"/>
- <hbmtemplate filepattern="{class-name}List.xhtml"
+ <hbmtemplate filepattern="{class-name}List.xhtml"
template="view/list.xhtml.ftl"
destdir="${project.home}/view"
foreach="entity"/>
- <hbmtemplate filepattern="{class-name}.xhtml"
+ <hbmtemplate filepattern="{class-name}.xhtml"
template="view/view.xhtml.ftl"
destdir="${project.home}/view"
foreach="entity"/>
- <hbmtemplate filepattern="{class-name}.page.xml"
+ <hbmtemplate filepattern="{class-name}.page.xml"
template="view/view.page.xml.ftl"
destdir="${project.home}/view"
foreach="entity"/>
- <hbmtemplate filepattern="{class-name}Edit.xhtml"
+ <hbmtemplate filepattern="{class-name}Edit.xhtml"
template="view/edit.xhtml.ftl"
destdir="${project.home}/view"
foreach="entity"/>
- <hbmtemplate filepattern="{class-name}Edit.page.xml"
+ <hbmtemplate filepattern="{class-name}Edit.page.xml"
template="view/edit.page.xml.ftl"
destdir="${project.home}/view"
foreach="entity"/>
- <hbmtemplate filepattern="${action.dir}/{class-name}List.java"
+ <hbmtemplate filepattern="${action.dir}/{class-name}List.java"
template="src/EntityList.java.ftl"
destdir="${project.home}/src"
foreach="entity">
- <property key="actionPackage" value="${action.package}" />
+ <property key="actionPackage" value="${action.package}" />
</hbmtemplate>
- <hbmtemplate filepattern="{class-name}List.page.xml"
+ <hbmtemplate filepattern="{class-name}List.page.xml"
template="view/list.page.xml.ftl"
destdir="${project.home}/view"
foreach="entity"/>
- <hbmtemplate filepattern="${action.dir}/{class-name}Home.java"
+ <hbmtemplate filepattern="${action.dir}/{class-name}Home.java"
template="src/EntityHome.java.ftl"
destdir="${project.home}/src"
foreach="entity">
- <property key="actionPackage" value="${action.package}" />
+ <property key="actionPackage" value="${action.package}" />
</hbmtemplate>
- <hbmtemplate filepattern="menu.xhtml"
+ <hbmtemplate filepattern="menu.xhtml"
template="view/layout/menu.xhtml.ftl"
destdir="${project.home}/view/layout"
foreach="entity"/>
@@ -1084,92 +1135,92 @@
<taskdef name="javaformatter"
classname="org.hibernate.tool.ant.JavaFormatterTask" classpathref="htools.classpath"/>
- <javaformatter>
- <fileset dir="${project.home}/src/action">
- <include name="**/*.java"/>
- </fileset>
+ <javaformatter>
+ <fileset dir="${project.home}/src/action">
+ <include name="**/*.java"/>
+ </fileset>
</javaformatter>
- <echo message="Type 'seam restart' and go to http://localhost:8080/${project.name}"/>
+ <echo message="Type 'seam restart' and go to http://localhost:8080/${project.name}"/>
- </target>
-
- <target name="archive" depends="validate-project"
+ </target>
+
+ <target name="archive" depends="validate-project"
description="Create the EAR or WAR archive">
- <echo message="Building ${project.type} archive for '${project.name}'" />
- <ant antfile="${project.home}/build.xml" target="archive" inheritall="false"/>
- </target>
+ <echo message="Building ${project.type} archive for '${project.name}'" />
+ <ant antfile="${project.home}/build.xml" target="archive" inheritall="false"/>
+ </target>
- <target name="deploy" depends="validate-project"
+ <target name="deploy" depends="validate-project"
description="Deploy the EAR or WAR">
- <echo message="Deploying project '${project.name}' to JBoss" />
- <ant antfile="${project.home}/build.xml" target="deploy" inheritall="false"/>
- </target>
+ <echo message="Deploying project '${project.name}' to JBoss" />
+ <ant antfile="${project.home}/build.xml" target="deploy" inheritall="false"/>
+ </target>
- <target name="undeploy" depends="validate-project"
+ <target name="undeploy" depends="validate-project"
description="Undeploy the EAR or WAR archive">
- <echo message="Undeploying project '${project.name}'" />
- <ant antfile="${project.home}/build.xml" target="undeploy" inheritall="false"/>
- </target>
+ <echo message="Undeploying project '${project.name}'" />
+ <ant antfile="${project.home}/build.xml" target="undeploy" inheritall="false"/>
+ </target>
- <target name="explode" depends="validate-project"
+ <target name="explode" depends="validate-project"
description="Deploy the project as an exploded directory">
- <echo message="Deploying project '${project.name}' to JBoss as an exploded directory" />
- <ant antfile="${project.home}/build.xml" target="explode" inheritall="false"/>
- </target>
+ <echo message="Deploying project '${project.name}' to JBoss as an exploded directory" />
+ <ant antfile="${project.home}/build.xml" target="explode" inheritall="false"/>
+ </target>
- <target name="restart" depends="validate-project"
+ <target name="restart" depends="validate-project"
description="Restart the exploded directory">
- <echo message="Restarting project '${project.name}'" />
- <ant antfile="${project.home}/build.xml" target="restart" inheritall="false"/>
- </target>
+ <echo message="Restarting project '${project.name}'" />
+ <ant antfile="${project.home}/build.xml" target="restart" inheritall="false"/>
+ </target>
- <target name="unexplode" depends="validate-project"
+ <target name="unexplode" depends="validate-project"
description="Undeploy the exploded directory">
- <echo message="Undeploying exploded directory for project '${project.name}'" />
- <ant antfile="${project.home}/build.xml" target="unexplode" inheritall="false"/>
- </target>
-
- <target name="test" depends="validate-project"
+ <echo message="Undeploying exploded directory for project '${project.name}'" />
+ <ant antfile="${project.home}/build.xml" target="unexplode" inheritall="false"/>
+ </target>
+
+ <target name="test" depends="validate-project"
description="Run the automated tests">
- <fail message="Cannot run tests because path to project contains spaces">
- <condition>
- <or>
- <contains string="${workspace.home}" substring=" "/>
- <contains string="${project.name}" substring=" "/>
- </or>
- </condition>
- </fail>
- <echo message="Running tests for project '${project.name}'" />
- <ant antfile="${project.home}/build.xml" target="test" inheritall="false"/>
- </target>
+ <fail message="Cannot run tests because path to project contains spaces">
+ <condition>
+ <or>
+ <contains string="${workspace.home}" substring=" "/>
+ <contains string="${project.name}" substring=" "/>
+ </or>
+ </condition>
+ </fail>
+ <echo message="Running tests for project '${project.name}'" />
+ <ant antfile="${project.home}/build.xml" target="test" inheritall="false"/>
+ </target>
- <target name="clean" depends="validate-project"
+ <target name="clean" depends="validate-project"
description="Clean the project directory">
- <echo message="Cleaning project '${project.name}'" />
- <ant antfile="${project.home}/build.xml" target="clean" inheritall="false"/>
- </target>
+ <echo message="Cleaning project '${project.name}'" />
+ <ant antfile="${project.home}/build.xml" target="clean" inheritall="false"/>
+ </target>
- <target name="reset"
+ <target name="reset"
description="Delete the settings">
- <delete file="build.properties"/>
- </target>
-
- <target name="settings" depends="init-properties"
+ <delete file="build.properties"/>
+ </target>
+
+ <target name="settings" depends="init-properties"
description="Print the settings">
- <echo message="Java project workspace: ${workspace.home}"/>
- <echo message="JBoss home: ${jboss.home}"/>
- <echo message="Project name: ${project.name}"/>
- <echo message="Project type: ${project.type}"/>
- <echo message="Hibernate dialect: ${hibernate.dialect}"/>
- <echo message="JDBC URL: ${hibernate.connection.url}"/>
- <echo message="JDBC driver class: ${hibernate.connection.driver_class}"/>
- <echo message="Database username: ${hibernate.connection.username}"/>
- <echo message="Database password: ${hibernate.connection.password}"/>
- </target>
-
- <target name="help" depends="init">
- <print file="README"/>
- </target>
+ <echo message="Java project workspace: ${workspace.home}"/>
+ <echo message="JBoss home: ${jboss.home}"/>
+ <echo message="Project name: ${project.name}"/>
+ <echo message="Project type: ${project.type}"/>
+ <echo message="Hibernate dialect: ${hibernate.dialect}"/>
+ <echo message="JDBC URL: ${hibernate.connection.url}"/>
+ <echo message="JDBC driver class: ${hibernate.connection.driver_class}"/>
+ <echo message="Database username: ${hibernate.connection.username}"/>
+ <echo message="Database password: ${hibernate.connection.password}"/>
+ </target>
+ <target name="help" depends="init">
+ <print file="README"/>
+ </target>
+
</project>
Modified: branches/enterprise/JBPAPP_4_3_FP01/seam-gen/src/EntityList.java.ftl
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/seam-gen/src/EntityList.java.ftl 2009-04-24 01:03:45 UTC (rev 10624)
+++ branches/enterprise/JBPAPP_4_3_FP01/seam-gen/src/EntityList.java.ftl 2009-04-24 12:34:42 UTC (rev 10625)
@@ -22,12 +22,12 @@
<#if c2j.isComponent(property)>
<#foreach componentProperty in property.value.propertyIterator>
<#if isString(componentProperty)>
- "lower(${componentName}.${property.name}.${componentProperty.name}) like concat(lower(${'#'}{${listName}.${componentName}.${property.name}.${componentProperty.name}}),'%')",
+ "lower(${componentName}.${property.name}.${componentProperty.name}) like lower(concat(${'#'}{${listName}.${componentName}.${property.name}.${componentProperty.name}}),'%')",
</#if>
</#foreach>
<#else>
<#if isString(property)>
- "lower(${componentName}.${property.name}) like concat(lower(${'#'}{${listName}.${componentName}.${property.name}}),'%')",
+ "lower(${componentName}.${property.name}) like lower(concat(${'#'}{${listName}.${componentName}.${property.name}}),'%')",
</#if>
</#if>
</#if>
16 years, 8 months
Seam SVN: r10624 - examples/trunk/booking.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-04-23 21:03:45 -0400 (Thu, 23 Apr 2009)
New Revision: 10624
Modified:
examples/trunk/booking/readme.txt
Log:
update title
Modified: examples/trunk/booking/readme.txt
===================================================================
--- examples/trunk/booking/readme.txt 2009-04-24 01:02:30 UTC (rev 10623)
+++ examples/trunk/booking/readme.txt 2009-04-24 01:03:45 UTC (rev 10624)
@@ -1,5 +1,5 @@
-Seam Booking Example
-====================
+Seam Booking Example (Java EE 5)
+================================
This example demonstrates the use of Seam 3 in a Java EE 6 environment (or a
Java EE 5 environment enhanced with JSR-299 [Web Beans] and JSF 2.0).
16 years, 8 months
Seam SVN: r10623 - in examples/trunk/servlet-booking: src/main/java/org/jboss/seam/examples/booking and 2 other directories.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-04-23 21:02:30 -0400 (Thu, 23 Apr 2009)
New Revision: 10623
Modified:
examples/trunk/servlet-booking/pom.xml
examples/trunk/servlet-booking/readme.txt
examples/trunk/servlet-booking/src/main/java/org/jboss/seam/examples/booking/BeanLookup.java
examples/trunk/servlet-booking/src/main/webapp/META-INF/context.xml
examples/trunk/servlet-booking/src/main/webapp/WEB-INF/
examples/trunk/servlet-booking/src/main/webapp/WEB-INF/faces-config.xml
examples/trunk/servlet-booking/src/main/webapp/WEB-INF/jetty-env.xml
examples/trunk/servlet-booking/src/main/webapp/WEB-INF/web.xml
Log:
change JNDI name for manager from jcdi/Manager to app/Manager
remove all JSF 1.2 left overs
setup build to accomodate war:inplace
update instructions
Modified: examples/trunk/servlet-booking/pom.xml
===================================================================
--- examples/trunk/servlet-booking/pom.xml 2009-04-23 23:49:28 UTC (rev 10622)
+++ examples/trunk/servlet-booking/pom.xml 2009-04-24 01:02:30 UTC (rev 10623)
@@ -21,21 +21,45 @@
<plugins>
<plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <failOnError>false</failOnError>
+ <filesets>
+ <fileset>
+ <!-- clean up files from war:inplace -->
+ <directory>src/main/webapp</directory>
+ <includes>
+ <include>WEB-INF/classes/**</include>
+ <include>WEB-INF/lib/**</include>
+ </includes>
+ <followSymlinks>false</followSymlinks>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <!-- don't stage or package files added to src/main/webapp by war:inplace -->
+ <warSourceExcludes>WEB-INF/classes/**,WEB-INF/lib/**</warSourceExcludes>
+ </configuration>
+ </plugin>
+
+ <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<path>/${project.build.finalName}</path>
- <!-- expecting username to be "admin" and a blank password for manager app -->
- <!-- configure a server in settings.xml containing <username> and <password> to override -->
+ <!-- uncomment to use server configuration override; see readme.txt for details -->
<!--<server>tomcatserver</server>-->
<url>http://localhost:${tomcat.http.port}/manager</url>
<port>${embedded-tomcat.http.port}</port> <!-- port for embedded Tomcat only (putting this configuration in the execution for the run goal doesn't work) -->
+ <!-- if you don't want to use war:inplace, uncomment this setting -->
<!--
<warSourceDirectory>${project.build.directory}/${project.build.finalName}</warSourceDirectory>
-->
</configuration>
- <dependencies>
- </dependencies>
</plugin>
<plugin>
@@ -52,12 +76,11 @@
<webAppConfig>
<contextPath>/${project.build.finalName}</contextPath>
</webAppConfig>
+ <!-- if you don't want to use war:inplace, uncomment this setting -->
<!--
<webAppSourceDirectory>${project.build.directory}/${project.build.finalName}</webAppSourceDirectory>
-->
</configuration>
- <dependencies>
- </dependencies>
</plugin>
</plugins>
@@ -80,16 +103,7 @@
<classifier>jdk15</classifier>
</dependency>
- <!-- disable after upgrading to JSF 2 -->
- <!--
<dependency>
- <groupId>com.sun.facelets</groupId>
- <artifactId>jsf-facelets</artifactId>
- <scope>runtime</scope>
- </dependency>
- -->
-
- <dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
</dependency>
@@ -97,9 +111,6 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
- <!--
- <version>1.2_12</version>
- -->
<version>2.0.0-PR2_1</version>
</dependency>
@@ -107,9 +118,6 @@
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
<scope>runtime</scope>
- <!--
- <version>1.2_12</version>
- -->
<version>2.0.0-PR2_1</version>
</dependency>
Modified: examples/trunk/servlet-booking/readme.txt
===================================================================
--- examples/trunk/servlet-booking/readme.txt 2009-04-23 23:49:28 UTC (rev 10622)
+++ examples/trunk/servlet-booking/readme.txt 2009-04-24 01:02:30 UTC (rev 10623)
@@ -1,8 +1,8 @@
-Seam Booking Example
-====================
+Seam Booking Example (Servlet Container)
+========================================
This example demonstrates the use of Seam 3 in a Servlet container environment
-(Tomcat 6 or Jetty 6). Contextual state management and dependency injection are
+(Tomcat 6 / Jetty 6). Contextual state management and dependency injection are
handled by JSR-299. Transaction and persistence context management is handled
by the EJB 3 container. No alterations are expected to be made to the Servlet
container. All services are self-contained within the deployment.
@@ -13,27 +13,47 @@
mvn
+Now you are ready to deploy.
+
+== Deploying with an embedded servlet container
+
Run this command to execute the application in an embedded Jetty 6 container:
- mvn jetty:run
+ mvn war:inplace jetty:run
You can also execute the application in an embedded Tomcat 6 container:
- mvn tomcat:run
+ mvn war:inplace tomcat:run
-In both cases, any changes to assets in src/main/webapp will take affect
-immediately. If a change to a configuration file is made, the application will
-automatically redeploy. The redeploy behavior can be fined tuned in the plugin
-configuration (at least for Jetty).
+In both cases, any changes to assets in src/main/webapp take affect
+immediately. If a change to a webapp configuration file is made, the
+application may automatically redeploy. The redeploy behavior can be fined
+tuned in the plugin configuration (at least for Jetty). If you make a change
+to a classpath resource, you need to execute a build:
+ mvn compile war:inplace
+
+Note that war:inplace copies the compiled classes and JARs inside WebContent,
+under WEB-INF/classes and WEB-INF/lib, respectively, mixing source and compiled
+files. However, the build does work around these temporary files by excluding
+them from the packaged WAR and cleaning them during the Maven clean phase.
+These folders are also ignored by SVN.
+
+== Deploying to standalone Tomcat
+
If you want to run the application on a standalone Tomcat 6, first download and
-extract Tomcat 6. This build assumes you will be running Tomcat in its default
+extract Tomcat 6. This build assumes you will be running Tomcat in its default
configuration, with a hostname of localhost and port 8080. Before starting
Tomcat, add the following line to conf/tomcat-users.xml to allow the Maven
Tomcat plugin to access the manager application, then start Tomcat:
<user username="admin" password="" roles="manager"/>
+To override this username and password, add a <server> with id tomcat in your
+Maven 2 settings.xml file, set the <username> and <password> elements to the
+appropriate values and uncomment the <server> element inside the
+tomcat-maven-plugin configuration in the pom.xml.
+
You can deploy the packaged archive to Tomcat via HTTP PUT using this command:
mvn package tomcat:deploy
@@ -57,13 +77,3 @@
mvn war:exploded tomcat:redeploy
mvn compile war:exploded tomcat:redeploy
-Use of the war:inplace + tomcat:inplace goals are not recommended as it causes
-files to be copied to your src/main/webapp directory. You may accidently check
-them into the source repository or include them in the deployable archive.
-
------------------------
-Unfinished instructions
------------------------
-Have to decide if you want war:inplace which mixes compiled files w/ source
-files but gives you instant change or change the warSourceDirectory and require
-war:exploded to be run to see changes take affect.
Modified: examples/trunk/servlet-booking/src/main/java/org/jboss/seam/examples/booking/BeanLookup.java
===================================================================
--- examples/trunk/servlet-booking/src/main/java/org/jboss/seam/examples/booking/BeanLookup.java 2009-04-23 23:49:28 UTC (rev 10622)
+++ examples/trunk/servlet-booking/src/main/java/org/jboss/seam/examples/booking/BeanLookup.java 2009-04-24 01:02:30 UTC (rev 10623)
@@ -14,7 +14,7 @@
public void lookupManager() {
try {
InitialContext ic = new InitialContext();
- Manager manager = (Manager) ic.lookup("java:comp/env/jcdi/Manager");
+ Manager manager = (Manager) ic.lookup("java:comp/env/app/Manager");
if (manager != null) {
Logger logger = Logger.getLogger(BeanLookup.class.getName());
logger.log(Level.INFO, "JCDI manager: " + manager.toString());
Modified: examples/trunk/servlet-booking/src/main/webapp/META-INF/context.xml
===================================================================
--- examples/trunk/servlet-booking/src/main/webapp/META-INF/context.xml 2009-04-23 23:49:28 UTC (rev 10622)
+++ examples/trunk/servlet-booking/src/main/webapp/META-INF/context.xml 2009-04-24 01:02:30 UTC (rev 10623)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<Manager pathname=""/> <!-- disables storage of sessions across restarts -->
- <Resource name="jcdi/Manager"
+ <Resource name="app/Manager"
auth="Container"
type="javax.inject.manager.Manager"
factory="org.jboss.webbeans.resources.ManagerObjectFactory"/>
Property changes on: examples/trunk/servlet-booking/src/main/webapp/WEB-INF
___________________________________________________________________
Name: svn:ignore
+ classes
lib
Modified: examples/trunk/servlet-booking/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- examples/trunk/servlet-booking/src/main/webapp/WEB-INF/faces-config.xml 2009-04-23 23:49:28 UTC (rev 10622)
+++ examples/trunk/servlet-booking/src/main/webapp/WEB-INF/faces-config.xml 2009-04-24 01:02:30 UTC (rev 10623)
@@ -3,20 +3,4 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">
-
- <application>
- <!-- disable after upgrading to JSF 2 -->
- <!--
- <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
- -->
- </application>
-
- <!--
- <managed-bean>
- <managed-bean-name>beanLookup</managed-bean-name>
- <managed-bean-class>org.jboss.seam.examples.booking.BeanLookup</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
- </managed-bean>
- -->
-
</faces-config>
Modified: examples/trunk/servlet-booking/src/main/webapp/WEB-INF/jetty-env.xml
===================================================================
--- examples/trunk/servlet-booking/src/main/webapp/WEB-INF/jetty-env.xml 2009-04-23 23:49:28 UTC (rev 10622)
+++ examples/trunk/servlet-booking/src/main/webapp/WEB-INF/jetty-env.xml 2009-04-24 01:02:30 UTC (rev 10623)
@@ -2,19 +2,10 @@
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
"http://jetty.mortbay.org/configure.dtd">
<Configure id="webAppCtx" class="org.mortbay.jetty.webapp.WebAppContext">
- <!--
- <New id="jdci" class="org.mortbay.jetty.plus.naming.Resource">
+ <New id="appManager" class="org.mortbay.jetty.plus.naming.Resource">
<Arg><Ref id="webAppCtx"/></Arg>
- <Arg>jcdi/Manager</Arg>
+ <Arg>app/Manager</Arg>
<Arg>
- <New class="org.jboss.webbeans.resources.ManagerObjectFactoryReference"/>
- </Arg>
- </New>
- -->
- <New id="jdciManager" class="org.mortbay.jetty.plus.naming.Resource">
- <Arg><Ref id="webAppCtx"/></Arg>
- <Arg>jcdi/Manager</Arg>
- <Arg>
<New class="javax.naming.Reference">
<Arg>javax.inject.manager.Manager</Arg>
<Arg>org.jboss.webbeans.resources.ManagerObjectFactory</Arg>
Modified: examples/trunk/servlet-booking/src/main/webapp/WEB-INF/web.xml
===================================================================
--- examples/trunk/servlet-booking/src/main/webapp/WEB-INF/web.xml 2009-04-23 23:49:28 UTC (rev 10622)
+++ examples/trunk/servlet-booking/src/main/webapp/WEB-INF/web.xml 2009-04-24 01:02:30 UTC (rev 10623)
@@ -6,15 +6,7 @@
<display-name>Seam Booking Example (Servlet Container)</display-name>
- <!-- disable after upgrading to JSF 2 -->
- <!--
<context-param>
- <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
- <param-value>.xhtml</param-value>
- </context-param>
- -->
-
- <context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>true</param-value>
</context-param>
@@ -40,7 +32,7 @@
<resource-env-ref>
<description>Object factory for the JCDI Manager</description>
- <resource-env-ref-name>jcdi/Manager</resource-env-ref-name>
+ <resource-env-ref-name>app/Manager</resource-env-ref-name>
<resource-env-ref-type>javax.inject.manager.Manager</resource-env-ref-type>
</resource-env-ref>
16 years, 8 months
Seam SVN: r10622 - modules/trunk/version-matrix.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-04-23 19:49:28 -0400 (Thu, 23 Apr 2009)
New Revision: 10622
Modified:
modules/trunk/version-matrix/pom.xml
Log:
add plugins for jboss, tomcat, and jetty
upgrade war plugin
Modified: modules/trunk/version-matrix/pom.xml
===================================================================
--- modules/trunk/version-matrix/pom.xml 2009-04-23 22:47:40 UTC (rev 10621)
+++ modules/trunk/version-matrix/pom.xml 2009-04-23 23:49:28 UTC (rev 10622)
@@ -122,6 +122,12 @@
<artifactId>jsf-api</artifactId>
<version>1.2_10</version>
</dependency>
+
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>1.2_10</version>
+ </dependency>
<dependency>
<groupId>org.jboss.el</groupId>
@@ -149,15 +155,21 @@
<dependency>
<groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-logging</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>jsr299-api</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jboss.webbeans</groupId>
- <artifactId>jsr299-api</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>webbeans-logging</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.webbeans.servlet</groupId>
+ <artifactId>webbeans-servlet</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
</dependencyManagement>
@@ -175,6 +187,11 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
</plugin>
@@ -199,6 +216,11 @@
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
+ <artifactId>jboss-maven-plugin</artifactId>
+ <version>1.3.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-1</version>
</plugin>
@@ -245,7 +267,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
- <version>2.1-alpha-1</version>
+ <version>2.1-beta-1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -278,6 +300,16 @@
<version>1.0-alpha-1</version>
</plugin>
<plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>tomcat-maven-plugin</artifactId>
+ <version>1.0-beta-1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.16</version>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.0-alpha-4</version>
16 years, 8 months
Seam SVN: r10621 - branches/community/Seam_2_1/src/main/org/jboss/seam/contexts.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-04-23 18:47:40 -0400 (Thu, 23 Apr 2009)
New Revision: 10621
Modified:
branches/community/Seam_2_1/src/main/org/jboss/seam/contexts/ServletLifecycle.java
Log:
reverted patch
Modified: branches/community/Seam_2_1/src/main/org/jboss/seam/contexts/ServletLifecycle.java
===================================================================
--- branches/community/Seam_2_1/src/main/org/jboss/seam/contexts/ServletLifecycle.java 2009-04-23 22:24:58 UTC (rev 10620)
+++ branches/community/Seam_2_1/src/main/org/jboss/seam/contexts/ServletLifecycle.java 2009-04-23 22:47:40 UTC (rev 10621)
@@ -144,7 +144,7 @@
public static void beginSession(HttpSession session)
{
- Lifecycle.beginSession( new ServletSessionMap(session), session.getServletContext() );
+ Lifecycle.beginSession( new ServletSessionMap(session) );
}
public static void endSession(HttpSession session)
16 years, 8 months
Seam SVN: r10620 - branches/community/Seam_2_1/src/main/org/jboss/seam/contexts.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-04-23 18:24:58 -0400 (Thu, 23 Apr 2009)
New Revision: 10620
Modified:
branches/community/Seam_2_1/src/main/org/jboss/seam/contexts/Lifecycle.java
Log:
reverted patch
Modified: branches/community/Seam_2_1/src/main/org/jboss/seam/contexts/Lifecycle.java
===================================================================
--- branches/community/Seam_2_1/src/main/org/jboss/seam/contexts/Lifecycle.java 2009-04-23 22:03:00 UTC (rev 10619)
+++ branches/community/Seam_2_1/src/main/org/jboss/seam/contexts/Lifecycle.java 2009-04-23 22:24:58 UTC (rev 10620)
@@ -8,14 +8,12 @@
import java.util.Map;
import java.util.Set;
-import javax.servlet.ServletContext;
import org.jboss.seam.ScopeType;
import org.jboss.seam.core.ConversationEntries;
import org.jboss.seam.core.Manager;
import org.jboss.seam.log.LogProvider;
import org.jboss.seam.log.Logging;
-import org.jboss.seam.servlet.ServletApplicationMap;
/**
* Methods for setup and teardown of Seam contexts.
@@ -177,7 +175,7 @@
Contexts.destroyConversationContext(session, conversationId);
}
- public static void beginSession(Map<String, Object> session, ServletContext appCtx)
+ public static void beginSession(Map<String, Object> session)
{
log.debug("Session started");
@@ -189,17 +187,8 @@
boolean conversationContextActive = Contexts.isConversationContextActive();
if ( !applicationContextActive )
- {
- Context tempApplicationContext = null;
- if(appCtx == null)
- {
- tempApplicationContext = new ApplicationContext( getApplication() );
- }
- else
- {
- tempApplicationContext = new ApplicationContext( new ServletApplicationMap(appCtx) );
- }
-
+ {
+ Context tempApplicationContext = new ApplicationContext( getApplication() );
Contexts.applicationContext.set(tempApplicationContext);
}
Context oldSessionContext = Contexts.sessionContext.get();
16 years, 8 months
Seam SVN: r10619 - examples/trunk/booking.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-04-23 18:03:00 -0400 (Thu, 23 Apr 2009)
New Revision: 10619
Modified:
examples/trunk/booking/readme.txt
Log:
document restart and undeploy profiles
Modified: examples/trunk/booking/readme.txt
===================================================================
--- examples/trunk/booking/readme.txt 2009-04-23 22:01:46 UTC (rev 10618)
+++ examples/trunk/booking/readme.txt 2009-04-23 22:03:00 UTC (rev 10619)
@@ -38,15 +38,19 @@
mvn -o -f seam-booking-ear/pom.xml jboss:harddeploy
But it's better to use the antrun plugin since it is smarter about what it
-copies, which is bound to the end of the package goal when the jboss-explode
-profile is active:
+copies, which is bound to the end of the package goal when the explode profile
+is active:
mvn -o package -Pexplode
-You can remove the archive by activating the jboss-unexplode profile:
+You can force a restart of the application by activating the restart profile:
- mvn -o validate -Punexplode
+ mvn -o validate -Prestart
+You can remove the archive by activating the undeploy profile:
+
+ mvn -o validate -Pundeploy
+
Note that the -o puts Maven in offline mode so that it doesn't perform time
consuming update checks.
16 years, 8 months
Seam SVN: r10618 - examples/trunk/booking/seam-booking-ear.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-04-23 18:01:46 -0400 (Thu, 23 Apr 2009)
New Revision: 10618
Modified:
examples/trunk/booking/seam-booking-ear/pom.xml
Log:
parameterize the JBoss AS domain
add a restart task
detect change in web.xml
Modified: examples/trunk/booking/seam-booking-ear/pom.xml
===================================================================
--- examples/trunk/booking/seam-booking-ear/pom.xml 2009-04-23 21:34:52 UTC (rev 10617)
+++ examples/trunk/booking/seam-booking-ear/pom.xml 2009-04-23 22:01:46 UTC (rev 10618)
@@ -56,7 +56,9 @@
</build>
<properties>
+ <!-- To override jboss.home, set the jboss.home property in an active profile in the Maven 2 settings.xml file -->
<jboss.home>${env.JBOSS_HOME}</jboss.home>
+ <jboss.domain>default</jboss.domain>
</properties>
<profiles>
@@ -77,7 +79,7 @@
<property name="ejb-jar.staging.dir" value="../${archive.name}-ejb/target/classes"/>
<property name="war.staging.dir" value="../${archive.name}-war/target/${archive.name}"/>
- <property name="ear.deploy.dir" value="${jboss.home}/server/default/deploy/${archive.name}.ear"/>
+ <property name="ear.deploy.dir" value="${jboss.home}/server/${jboss.domain}/deploy/${archive.name}.ear"/>
<property name="ejb-jar.deploy.dir" value="${ear.deploy.dir}/${archive.name}-ejb.jar"/>
<property name="war.deploy.dir" value="${ear.deploy.dir}/${archive.name}.war"/>
@@ -93,23 +95,31 @@
<fileset dir="${ejb-jar.staging.dir}"/>
</copy>
- <!-- This reads "if none of the files in EJB-JAR are newer than application.xml, set the property ejb-jar.unchanged" -->
+ <!-- Read as: if none of the files in EJB-JAR are newer than application.xml, set the property ejb-jar.unchanged -->
<uptodate property="ejb-jar.unchanged" targetfile="${ear.deploy.dir}/META-INF/application.xml">
<srcfiles dir="${ejb-jar.deploy.dir}" includes="**/*"/>
</uptodate>
- <!-- Only touch application.xml if the application is not yet deployed or a file in EJB-JAR has changed -->
+ <copy todir="${war.deploy.dir}" verbose="false" preservelastmodified="true" includeEmptyDirs="false">
+ <fileset dir="${war.staging.dir}"/>
+ </copy>
+
+ <!-- Read as: if none of the config files in WAR are newer than application.xml, set the property webapp-config.unchanged -->
+ <uptodate property="webapp-config.unchanged" targetfile="${ear.deploy.dir}/META-INF/application.xml">
+ <srcfiles dir="${war.deploy.dir}">
+ <include name="WEB-INF/web.xml"/>
+ </srcfiles>
+ </uptodate>
+
+ <!-- Only touch application.xml if the application is not deployed, a file in EJB-JAR has changed or a webapp config file has changed -->
<condition property="restart">
<or>
<not><isset property="deployed"/></not>
<not><isset property="ejb-jar.unchanged"/></not>
+ <not><isset property="webapp-config.unchanged"/></not>
</or>
</condition>
- <copy todir="${war.deploy.dir}" verbose="false" preservelastmodified="true" includeEmptyDirs="false">
- <fileset dir="${war.staging.dir}"/>
- </copy>
-
<!-- do a checksum to see if application.xml, jboss-app.xml, or -ds.xml need to be updated -->
<!-- this copy implicitly touches application.xml if the restart property is set since it is generated each time -->
<copy todir="${ear.deploy.dir}" verbose="false" preservelastmodified="true" includeEmptyDirs="false">
@@ -134,7 +144,7 @@
</profile>
<profile>
- <id>unexplode</id>
+ <id>restart</id>
<build>
<plugins>
<plugin>
@@ -144,8 +154,42 @@
<phase>validate</phase>
<configuration>
<tasks>
- <property name="ear.deploy.dir" value="${env.JBOSS_HOME}/server/default/deploy/${project.build.finalName}.ear"/>
+ <property name="deploy.dir" value="${jboss.home}/server/${jboss.domain}/deploy"/>
+ <property name="ear.archive.name" value="${project.build.finalName}.ear"/>
+ <property name="ear.deploy.dir" value="${deploy.dir}/${ear.archive.name}"/>
+ <available property="deployed" file="${ear.deploy.dir}/META-INF/application.xml" type="file"/>
+ <touch>
+ <fileset dir="${deploy.dir}">
+ <include name="${ear.archive.name}/META-INF/application.xml" if="deployed"/>
+ </fileset>
+ </touch>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>undeploy</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <configuration>
+ <tasks>
+ <property name="ear.deploy.dir" value="${jboss.home}/server/${jboss.domain}/deploy/${project.build.finalName}.ear"/>
<delete dir="${ear.deploy.dir}" quiet="true" failonerror="true"/>
+ <delete file="${ear.deploy.dir}" quiet="true" failonerror="true"/>
</tasks>
</configuration>
<goals>
16 years, 8 months
Seam SVN: r10617 - in examples/trunk: servlet-booking and 1 other directory.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-04-23 17:34:52 -0400 (Thu, 23 Apr 2009)
New Revision: 10617
Modified:
examples/trunk/booking/readme.txt
examples/trunk/servlet-booking/readme.txt
Log:
clarify unfinished instructions
Modified: examples/trunk/booking/readme.txt
===================================================================
--- examples/trunk/booking/readme.txt 2009-04-23 21:32:32 UTC (rev 10616)
+++ examples/trunk/booking/readme.txt 2009-04-23 21:34:52 UTC (rev 10617)
@@ -50,7 +50,9 @@
Note that the -o puts Maven in offline mode so that it doesn't perform time
consuming update checks.
----
+----------------------
+Unfinished intructions
+----------------------
When this profile is activated, the maven-antrun-plugin will copy the exploded
packages for the WAR, EJB-JAR, and EAR to the JBoss AS deploy directory. This
all happens in the maven package phase.
Modified: examples/trunk/servlet-booking/readme.txt
===================================================================
--- examples/trunk/servlet-booking/readme.txt 2009-04-23 21:32:32 UTC (rev 10616)
+++ examples/trunk/servlet-booking/readme.txt 2009-04-23 21:34:52 UTC (rev 10617)
@@ -61,7 +61,9 @@
files to be copied to your src/main/webapp directory. You may accidently check
them into the source repository or include them in the deployable archive.
----
+-----------------------
+Unfinished instructions
+-----------------------
Have to decide if you want war:inplace which mixes compiled files w/ source
files but gives you instant change or change the warSourceDirectory and require
war:exploded to be run to see changes take affect.
16 years, 8 months
Seam SVN: r10616 - in examples/trunk: booking/seam-booking-ear and 5 other directories.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-04-23 17:32:32 -0400 (Thu, 23 Apr 2009)
New Revision: 10616
Removed:
examples/trunk/servlet-booking/src/main/java/org/jboss/webbeans/
Modified:
examples/trunk/booking/pom.xml
examples/trunk/booking/readme.txt
examples/trunk/booking/seam-booking-ear/pom.xml
examples/trunk/servlet-booking/pom.xml
examples/trunk/servlet-booking/readme.txt
examples/trunk/servlet-booking/src/main/java/org/jboss/seam/examples/booking/BeanLookup.java
examples/trunk/servlet-booking/src/main/webapp/META-INF/context.xml
examples/trunk/servlet-booking/src/main/webapp/WEB-INF/faces-config.xml
examples/trunk/servlet-booking/src/main/webapp/WEB-INF/jetty-env.xml
examples/trunk/servlet-booking/src/main/webapp/WEB-INF/web.xml
Log:
add remaining tomcat and jetty support to servlet-booking
add exploded EAR deployment and undeployment to booking
clean up poms, move versions to version-matrix
upgrade servlet-booking to JSF 2
update instructions
Modified: examples/trunk/booking/pom.xml
===================================================================
--- examples/trunk/booking/pom.xml 2009-04-23 20:33:10 UTC (rev 10615)
+++ examples/trunk/booking/pom.xml 2009-04-23 21:32:32 UTC (rev 10616)
@@ -12,8 +12,8 @@
<artifactId>seam-booking</artifactId>
<packaging>pom</packaging>
- <name>Seam Booking Example</name>
- <description>Seam Booking Example</description>
+ <name>Seam Booking Example (Java EE 5)</name>
+ <description>The Seam booking example for deployment to a Java EE 5 application server</description>
<modules>
<module>${project.artifactId}-ejb</module>
@@ -27,7 +27,6 @@
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
@@ -36,7 +35,6 @@
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<configuration>
<ejbVersion>3.0</ejbVersion>
@@ -47,6 +45,17 @@
</pluginManagement>
</build>
+ <profiles>
+
+ <profile>
+ <id>explode</id>
+ <properties>
+ <maven.test.skip>true</maven.test.skip>
+ </properties>
+ </profile>
+
+ </profiles>
+
<dependencyManagement>
<dependencies>
Modified: examples/trunk/booking/readme.txt
===================================================================
--- examples/trunk/booking/readme.txt 2009-04-23 20:33:10 UTC (rev 10615)
+++ examples/trunk/booking/readme.txt 2009-04-23 21:32:32 UTC (rev 10616)
@@ -18,21 +18,39 @@
mvn
Then, set the JBOSS_HOME environment variable to the location of a JBoss AS 5
-installation. Once that's done, execute the following command to deploy the
-application to JBoss AS via JMX:
+installation and start the server. Maven will assume that JBoss AS is running
+on port 8080. Once that's done, you can deploy the application to JBoss AS via
+JMX by executing this command:
- mvn -f seam-booking-ear/pom.xml jboss:deploy
+ mvn -o -f seam-booking-ear/pom.xml jboss:deploy
You can undeploy the application via JMX using this command:
- mvn -f seam-booking-ear/pom.xml jboss:undeploy
+ mvn -o -f seam-booking-ear/pom.xml jboss:undeploy
-Here's the chained restart command:
+Here's the chained restart command via JMX:
- mvn -f seam-booking-ear/pom.xml jboss:undeploy && mvn package && mvn -f seam-booking-ear/pom.xml jboss:deploy
+ mvn -o -f seam-booking-ear/pom.xml jboss:undeploy && mvn -o package && mvn -o -f seam-booking-ear/pom.xml jboss:deploy
If you would rather deploy more traditional way by copying the archive directly
to the deploy directory of the JBoss AS domain, use this command instead:
- mvn -f seam-booking-ear/pom.xml jboss:harddeploy
+ mvn -o -f seam-booking-ear/pom.xml jboss:harddeploy
+But it's better to use the antrun plugin since it is smarter about what it
+copies, which is bound to the end of the package goal when the jboss-explode
+profile is active:
+
+ mvn -o package -Pexplode
+
+You can remove the archive by activating the jboss-unexplode profile:
+
+ mvn -o validate -Punexplode
+
+Note that the -o puts Maven in offline mode so that it doesn't perform time
+consuming update checks.
+
+---
+When this profile is activated, the maven-antrun-plugin will copy the exploded
+packages for the WAR, EJB-JAR, and EAR to the JBoss AS deploy directory. This
+all happens in the maven package phase.
Modified: examples/trunk/booking/seam-booking-ear/pom.xml
===================================================================
--- examples/trunk/booking/seam-booking-ear/pom.xml 2009-04-23 20:33:10 UTC (rev 10615)
+++ examples/trunk/booking/seam-booking-ear/pom.xml 2009-04-23 21:32:32 UTC (rev 10616)
@@ -19,8 +19,17 @@
<finalName>${project.parent.artifactId}</finalName>
<plugins>
+ <!--
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jboss-maven-plugin</artifactId>
+ <configuration>
+ <fileName>${project.build.directory}/${project.build.finalName}</fileName>
+ </configuration>
+ </plugin>
+ -->
+
+ <plugin>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<defaultJavaBundleDir>lib</defaultJavaBundleDir>
@@ -39,12 +48,119 @@
<contextRoot>/seam-booking</contextRoot>
</webModule>
</modules>
+ <version>5</version>
</configuration>
</plugin>
</plugins>
</build>
+ <properties>
+ <jboss.home>${env.JBOSS_HOME}</jboss.home>
+ </properties>
+
+ <profiles>
+
+ <profile>
+ <id>explode</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <configuration>
+ <tasks>
+ <property name="archive.name" value="${project.build.finalName}"/>
+ <property name="ear.staging.dir" value="${project.build.directory}/${archive.name}"/>
+ <property name="ejb-jar.staging.dir" value="../${archive.name}-ejb/target/classes"/>
+ <property name="war.staging.dir" value="../${archive.name}-war/target/${archive.name}"/>
+
+ <property name="ear.deploy.dir" value="${jboss.home}/server/default/deploy/${archive.name}.ear"/>
+ <property name="ejb-jar.deploy.dir" value="${ear.deploy.dir}/${archive.name}-ejb.jar"/>
+ <property name="war.deploy.dir" value="${ear.deploy.dir}/${archive.name}.war"/>
+
+ <condition property="deployed">
+ <available file="${ear.deploy.dir}"/>
+ </condition>
+
+ <mkdir dir="${ear.deploy.dir}"/>
+ <mkdir dir="${ejb-jar.deploy.dir}"/>
+ <mkdir dir="${war.deploy.dir}"/>
+
+ <copy todir="${ejb-jar.deploy.dir}" verbose="false" preservelastmodified="true" includeEmptyDirs="false">
+ <fileset dir="${ejb-jar.staging.dir}"/>
+ </copy>
+
+ <!-- This reads "if none of the files in EJB-JAR are newer than application.xml, set the property ejb-jar.unchanged" -->
+ <uptodate property="ejb-jar.unchanged" targetfile="${ear.deploy.dir}/META-INF/application.xml">
+ <srcfiles dir="${ejb-jar.deploy.dir}" includes="**/*"/>
+ </uptodate>
+
+ <!-- Only touch application.xml if the application is not yet deployed or a file in EJB-JAR has changed -->
+ <condition property="restart">
+ <or>
+ <not><isset property="deployed"/></not>
+ <not><isset property="ejb-jar.unchanged"/></not>
+ </or>
+ </condition>
+
+ <copy todir="${war.deploy.dir}" verbose="false" preservelastmodified="true" includeEmptyDirs="false">
+ <fileset dir="${war.staging.dir}"/>
+ </copy>
+
+ <!-- do a checksum to see if application.xml, jboss-app.xml, or -ds.xml need to be updated -->
+ <!-- this copy implicitly touches application.xml if the restart property is set since it is generated each time -->
+ <copy todir="${ear.deploy.dir}" verbose="false" preservelastmodified="true" includeEmptyDirs="false">
+ <fileset dir="${ear.staging.dir}">
+ <include name="**/*" if="restart"/>
+ <exclude name="**/*" unless="restart"/>
+ <exclude name="*.war"/>
+ <exclude name="*.jar"/>
+ </fileset>
+ </copy>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>unexplode</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <configuration>
+ <tasks>
+ <property name="ear.deploy.dir" value="${env.JBOSS_HOME}/server/default/deploy/${project.build.finalName}.ear"/>
+ <delete dir="${ear.deploy.dir}" quiet="true" failonerror="true"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+ </profile>
+
+ </profiles>
+
<dependencies>
<dependency>
Modified: examples/trunk/servlet-booking/pom.xml
===================================================================
--- examples/trunk/servlet-booking/pom.xml 2009-04-23 20:33:10 UTC (rev 10615)
+++ examples/trunk/servlet-booking/pom.xml 2009-04-23 21:32:32 UTC (rev 10616)
@@ -12,7 +12,8 @@
<artifactId>seam-servlet-booking</artifactId>
<packaging>war</packaging>
- <name>Seam Booking Example (Servlet Container)</name>
+ <name>Seam Booking Example (Servlet)</name>
+ <description>The Seam booking example for deployment to a servlet container</description>
<build>
<defaultGoal>package</defaultGoal>
@@ -22,14 +23,16 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
- <version>1.0-beta-1</version>
<configuration>
<path>/${project.build.finalName}</path>
<!-- expecting username to be "admin" and a blank password for manager app -->
<!-- configure a server in settings.xml containing <username> and <password> to override -->
<!--<server>tomcatserver</server>-->
- <url>http://localhost:${tomcat.run.port}/manager</url>
- <port>${embedded-tomcat.run.port}</port> <!-- port for embedded Tomcat only (I don't get how to isolate this config to run goal) -->
+ <url>http://localhost:${tomcat.http.port}/manager</url>
+ <port>${embedded-tomcat.http.port}</port> <!-- port for embedded Tomcat only (putting this configuration in the execution for the run goal doesn't work) -->
+ <!--
+ <warSourceDirectory>${project.build.directory}/${project.build.finalName}</warSourceDirectory>
+ -->
</configuration>
<dependencies>
</dependencies>
@@ -38,11 +41,10 @@
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.16</version>
<configuration>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
- <port>${jetty.run.port}</port>
+ <port>${jetty.http.port}</port>
<maxIdleTime>3600000</maxIdleTime>
</connector>
</connectors>
@@ -50,6 +52,9 @@
<webAppConfig>
<contextPath>/${project.build.finalName}</contextPath>
</webAppConfig>
+ <!--
+ <webAppSourceDirectory>${project.build.directory}/${project.build.finalName}</webAppSourceDirectory>
+ -->
</configuration>
<dependencies>
</dependencies>
@@ -59,11 +64,11 @@
</build>
<properties>
- <jetty.run.port>9090</jetty.run.port>
+ <jetty.http.port>9090</jetty.http.port>
<jetty.debug.port>9190</jetty.debug.port>
- <tomcat.run.port>8080</tomcat.run.port>
- <embedded-tomcat.run.port>${jetty.run.port}</embedded-tomcat.run.port>
- <embedded-tomcat.debug.port>${jetty.debug.port}</embedded-tomcat.debug.port>
+ <tomcat.http.port>8080</tomcat.http.port>
+ <embedded-tomcat.http.port>9090</embedded-tomcat.http.port>
+ <embedded-tomcat.debug.port>9190</embedded-tomcat.debug.port>
</properties>
<dependencies>
@@ -76,11 +81,13 @@
</dependency>
<!-- disable after upgrading to JSF 2 -->
+ <!--
<dependency>
<groupId>com.sun.facelets</groupId>
<artifactId>jsf-facelets</artifactId>
<scope>runtime</scope>
</dependency>
+ -->
<dependency>
<groupId>javax.annotation</groupId>
@@ -90,14 +97,20 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
+ <!--
<version>1.2_12</version>
+ -->
+ <version>2.0.0-PR2_1</version>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
<scope>runtime</scope>
+ <!--
<version>1.2_12</version>
+ -->
+ <version>2.0.0-PR2_1</version>
</dependency>
<dependency>
@@ -109,7 +122,7 @@
<dependency>
<groupId>org.jboss.webbeans.servlet</groupId>
<artifactId>webbeans-servlet</artifactId>
- <scope>compile</scope> <!-- change to runtime after removing ManagerReference -->
+ <scope>runtime</scope>
</dependency>
</dependencies>
Modified: examples/trunk/servlet-booking/readme.txt
===================================================================
--- examples/trunk/servlet-booking/readme.txt 2009-04-23 20:33:10 UTC (rev 10615)
+++ examples/trunk/servlet-booking/readme.txt 2009-04-23 21:32:32 UTC (rev 10616)
@@ -26,11 +26,16 @@
automatically redeploy. The redeploy behavior can be fined tuned in the plugin
configuration (at least for Jetty).
-If you want to run the application on a standalone Tomcat 6, first download,
-extract and start Tomcat 6. This build assumes that Tomcat is available at
-localhost on port 8080. You can deploy the packaged archive to Tomcat via HTTP
-PUT using this command:
+If you want to run the application on a standalone Tomcat 6, first download and
+extract Tomcat 6. This build assumes you will be running Tomcat in its default
+configuration, with a hostname of localhost and port 8080. Before starting
+Tomcat, add the following line to conf/tomcat-users.xml to allow the Maven
+Tomcat plugin to access the manager application, then start Tomcat:
+ <user username="admin" password="" roles="manager"/>
+
+You can deploy the packaged archive to Tomcat via HTTP PUT using this command:
+
mvn package tomcat:deploy
Then you use this command to undeploy the application:
@@ -55,3 +60,8 @@
Use of the war:inplace + tomcat:inplace goals are not recommended as it causes
files to be copied to your src/main/webapp directory. You may accidently check
them into the source repository or include them in the deployable archive.
+
+---
+Have to decide if you want war:inplace which mixes compiled files w/ source
+files but gives you instant change or change the warSourceDirectory and require
+war:exploded to be run to see changes take affect.
Modified: examples/trunk/servlet-booking/src/main/java/org/jboss/seam/examples/booking/BeanLookup.java
===================================================================
--- examples/trunk/servlet-booking/src/main/java/org/jboss/seam/examples/booking/BeanLookup.java 2009-04-23 20:33:10 UTC (rev 10615)
+++ examples/trunk/servlet-booking/src/main/java/org/jboss/seam/examples/booking/BeanLookup.java 2009-04-23 21:32:32 UTC (rev 10616)
@@ -2,14 +2,14 @@
import java.util.logging.Level;
import java.util.logging.Logger;
-//import javax.faces.ManagedBean;
-//import javax.faces.RequestScoped;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.RequestScoped;
import javax.inject.manager.Manager;
import javax.naming.InitialContext;
import javax.naming.NamingException;
-//@ManagedBean
-//@RequestScoped
+@ManagedBean(name = "beanLookup")
+@RequestScoped
public class BeanLookup {
public void lookupManager() {
try {
Modified: examples/trunk/servlet-booking/src/main/webapp/META-INF/context.xml
===================================================================
--- examples/trunk/servlet-booking/src/main/webapp/META-INF/context.xml 2009-04-23 20:33:10 UTC (rev 10615)
+++ examples/trunk/servlet-booking/src/main/webapp/META-INF/context.xml 2009-04-23 21:32:32 UTC (rev 10616)
@@ -4,5 +4,5 @@
<Resource name="jcdi/Manager"
auth="Container"
type="javax.inject.manager.Manager"
- factory="org.jboss.webbeans.resources.ManagerReferenceFactory"/>
+ factory="org.jboss.webbeans.resources.ManagerObjectFactory"/>
</Context>
Modified: examples/trunk/servlet-booking/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- examples/trunk/servlet-booking/src/main/webapp/WEB-INF/faces-config.xml 2009-04-23 20:33:10 UTC (rev 10615)
+++ examples/trunk/servlet-booking/src/main/webapp/WEB-INF/faces-config.xml 2009-04-23 21:32:32 UTC (rev 10616)
@@ -6,13 +6,17 @@
<application>
<!-- disable after upgrading to JSF 2 -->
+ <!--
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
+ -->
</application>
+ <!--
<managed-bean>
<managed-bean-name>beanLookup</managed-bean-name>
- <managed-bean-class>org.jboss.seam.examples.booking.BeanLookup</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
+ <managed-bean-class>org.jboss.seam.examples.booking.BeanLookup</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
</managed-bean>
+ -->
</faces-config>
Modified: examples/trunk/servlet-booking/src/main/webapp/WEB-INF/jetty-env.xml
===================================================================
--- examples/trunk/servlet-booking/src/main/webapp/WEB-INF/jetty-env.xml 2009-04-23 20:33:10 UTC (rev 10615)
+++ examples/trunk/servlet-booking/src/main/webapp/WEB-INF/jetty-env.xml 2009-04-23 21:32:32 UTC (rev 10616)
@@ -2,11 +2,24 @@
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
"http://jetty.mortbay.org/configure.dtd">
<Configure id="webAppCtx" class="org.mortbay.jetty.webapp.WebAppContext">
+ <!--
<New id="jdci" class="org.mortbay.jetty.plus.naming.Resource">
<Arg><Ref id="webAppCtx"/></Arg>
<Arg>jcdi/Manager</Arg>
<Arg>
- <New class="org.jboss.webbeans.resources.ManagerReferenceFactory"/>
+ <New class="org.jboss.webbeans.resources.ManagerObjectFactoryReference"/>
</Arg>
</New>
+ -->
+ <New id="jdciManager" class="org.mortbay.jetty.plus.naming.Resource">
+ <Arg><Ref id="webAppCtx"/></Arg>
+ <Arg>jcdi/Manager</Arg>
+ <Arg>
+ <New class="javax.naming.Reference">
+ <Arg>javax.inject.manager.Manager</Arg>
+ <Arg>org.jboss.webbeans.resources.ManagerObjectFactory</Arg>
+ <Arg/>
+ </New>
+ </Arg>
+ </New>
</Configure>
Modified: examples/trunk/servlet-booking/src/main/webapp/WEB-INF/web.xml
===================================================================
--- examples/trunk/servlet-booking/src/main/webapp/WEB-INF/web.xml 2009-04-23 20:33:10 UTC (rev 10615)
+++ examples/trunk/servlet-booking/src/main/webapp/WEB-INF/web.xml 2009-04-23 21:32:32 UTC (rev 10616)
@@ -7,10 +7,12 @@
<display-name>Seam Booking Example (Servlet Container)</display-name>
<!-- disable after upgrading to JSF 2 -->
+ <!--
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
+ -->
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
16 years, 8 months