Seam SVN: r9224 - in trunk/seam-gen: build-scripts and 7 other directories.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2008-10-08 04:16:29 -0400 (Wed, 08 Oct 2008)
New Revision: 9224
Added:
trunk/seam-gen/view/stylesheet/theme.xcss
Removed:
trunk/seam-gen/resources/org/
Modified:
trunk/seam-gen/build-scripts/build-war.xml
trunk/seam-gen/build-scripts/build.xml
trunk/seam-gen/build-scripts/deployed-jars-ear.list
trunk/seam-gen/build.xml
trunk/seam-gen/icefaces/build-scripts/build-war.xml
trunk/seam-gen/icefaces/build-scripts/build.xml
trunk/seam-gen/icefaces/build-scripts/deployed-jars-ear.list
trunk/seam-gen/icefaces/view/login.xhtml
trunk/seam-gen/icefaces/view/stylesheet/theme.css
trunk/seam-gen/resources/messages_de.properties
trunk/seam-gen/resources/messages_en.properties
trunk/seam-gen/resources/messages_fr.properties
trunk/seam-gen/resources/messages_tr.properties
trunk/seam-gen/view/layout/template.xhtml
trunk/seam-gen/view/login.xhtml
trunk/seam-gen/view/stylesheet/theme.css
Log:
JBSEAM-3513
JBSEAM-3529
JBSEAM-3530
Modified: trunk/seam-gen/build-scripts/build-war.xml
===================================================================
--- trunk/seam-gen/build-scripts/build-war.xml 2008-10-08 07:57:16 UTC (rev 9223)
+++ trunk/seam-gen/build-scripts/build-war.xml 2008-10-08 08:16:29 UTC (rev 9224)
@@ -1,5 +1,4 @@
<?xml version="1.0"?>
-
<project name="@projectName@" default="deploy" basedir=".">
<!-- Give user a chance to override without editing this file or typing -D -->
@@ -11,8 +10,8 @@
<!-- set global properties for this build -->
<property name="project.name" value="@projectName@"/>
<property name="dist.dir" value="dist" />
- <property name="src.model.dir" value="src/model" />
- <property name="src.action.dir" value="src/action" />
+ <property name="src.model.dir" value="src/main" />
+ <property name="src.action.dir" value="src/hot" />
<property name="src.test.dir" value="src/test" />
<property name="lib.dir" value="lib" />
<property name="war.dir" value="exploded-archives/${project.name}.war" />
@@ -125,19 +124,22 @@
if="eclipse.running">
<!-- TODO check how the groovy eclipse plugin works, does it compile? -->
<copy todir="${classes.model.dir}">
- <fileset dir="classes/model">
+ <fileset dir="classes/main">
<include name="**/*.class"/>
</fileset>
</copy>
<copy todir="${classes.action.dir}">
- <fileset dir="classes/action">
+ <fileset dir="classes/hot">
<include name="**/*.class"/>
</fileset>
</copy>
</target>
+
+ <target name="compile" depends="compilemodel,compileactions,copyclasses"
+ description="Compile the various source paths"/>
- <target name="war" depends="compilemodel,compileactions,copyclasses"
- description="Build the distribution .war file">
+ <target name="war" depends="compile"
+ description="Build the WAR structure in a staging directory">
<copy todir="${war.dir}/WEB-INF/classes">
<fileset dir="${basedir}/resources">
@@ -212,7 +214,7 @@
</target>
<target name="archive" depends="war"
- description="Package the archives">
+ description="Package the WAR archive">
<jar jarfile="${dist.dir}/${project.name}.war" basedir="${war.dir}"/>
</target>
@@ -248,16 +250,29 @@
<target name="reexplode" depends="unexplode,clean,explode"
description="Undeploy the exploded archive, clean, then deploy the exploded archive"/>
- <target name="restart" depends="explode" description="Restart the exploded archive">
+ <target name="check-deployed" description="Check to see if packaged archive is currently deployed">
+ <fail unless="jboss.home">jboss.home not set</fail>
+ <condition property="archive.deployed" value="true">
+ <available file="${war.deploy.dir}" type="file"/>
+ </condition>
+ </target>
+
+ <target name="restart-exploded" unless="archive.deployed" description="Deploy exploded archive if not deployed as packaged archive">
<touch file="${war.deploy.dir}/WEB-INF/web.xml"/>
</target>
+
+ <target name="restart-deployed" if="archive.deployed" description="Deploy packaged archive if deployed as packaged archive">
+ <antcall target="deploy"/>
+ </target>
- <target name="deploy" depends="archive,datasource" description="Deploy to JBoss AS">
+ <target name="restart" depends="check-deployed,restart-exploded,restart-deployed" description="Restart the exploded archive"/>
+
+ <target name="deploy" depends="archive,datasource" description="Deploy the packaged archive">
<fail unless="jboss.home">jboss.home not set</fail>
<copy todir="${deploy.dir}" file="${dist.dir}/${project.name}.war" />
</target>
- <target name="undeploy" description="Undeploy the example from JBoss">
+ <target name="undeploy" description="Undeploy the packaged archive">
<delete file="${deploy.dir}/${project.name}.war" />
<delete file="${deploy.dir}/${project.name}-dev-ds.xml" />
<delete file="${deploy.dir}/${project.name}-prod-ds.xml" />
@@ -266,7 +281,7 @@
<target name="redeploy" depends="undeploy,clean,deploy"
description="Undeploy the packaged archive, clean, then deploy the packaged archive"/>
- <target name="clean" description="Cleans up the build directory">
+ <target name="clean" description="Clean out the staging directory">
<delete dir="${dist.dir}"/>
<delete dir="${war.dir}"/>
<delete dir="${basedir}/test-report"/>
@@ -294,12 +309,12 @@
<target name="copytestclasses" if="eclipse.running" description="Copy classes compiled by eclipse to the test dir">
<mkdir dir="${test.dir}"/>
<copy todir="${test.dir}">
- <fileset dir="classes/model">
+ <fileset dir="classes/main">
<include name="**/*.class"/>
</fileset>
</copy>
<copy todir="${test.dir}">
- <fileset dir="classes/action">
+ <fileset dir="classes/hot">
<include name="**/*.class"/>
</fileset>
</copy>
@@ -346,13 +361,13 @@
<path path="${bootstrap.dir}" />
<path refid="build.classpath" />
</path>
- <testng outputdir="${basedir}/test-report">
+ <testng outputdir="${basedir}/test-report">
<classpath refid="test.path" />
<xmlfileset dir="${test.dir}" includes="*Test.xml" />
</testng>
</target>
- <target name="javadoc" depends="compilemodel,compileactions,copyclasses">
+ <target name="javadoc" depends="compile">
<mkdir dir="${dist.dir}/apidoc" />
<javadoc classpathref="build.classpath" destdir="${dist.dir}/apidoc" use="true" protected="true" version="true" windowtitle="${project.name} API Documentation" doctitle="${project.name} API Documentation" link="http://java.sun.com/j2se/5.0/docs/api">
Modified: trunk/seam-gen/build-scripts/build.xml
===================================================================
--- trunk/seam-gen/build-scripts/build.xml 2008-10-08 07:57:16 UTC (rev 9223)
+++ trunk/seam-gen/build-scripts/build.xml 2008-10-08 08:16:29 UTC (rev 9224)
@@ -1,5 +1,4 @@
<?xml version="1.0"?>
-
<project name="@projectName@" default="deploy" basedir=".">
<!-- Give user a chance to override without editing this file or typing -D -->
@@ -11,8 +10,8 @@
<!-- set global properties for this build -->
<property name="project.name" value="@projectName@"/>
<property name="dist.dir" value="dist" />
- <property name="src.model.dir" value="src/model" />
- <property name="src.action.dir" value="src/action" />
+ <property name="src.model.dir" value="src/main" />
+ <property name="src.action.dir" value="src/hot" />
<property name="src.test.dir" value="src/test" />
<property name="lib.dir" value="lib" />
<property name="ear.dir" value="exploded-archives/${project.name}.ear" />
@@ -44,13 +43,60 @@
</path>
<target name="init" description="Initialize the build">
+ <taskdef name ="groovyc"
+ classname ="org.codehaus.groovy.ant.Groovyc"
+ classpathref="build.classpath"/> <!-- really only the groovy jar is necessary -->
<mkdir dir="${jar.dir}" />
<mkdir dir="${ear.dir}" />
<mkdir dir="${war.dir}" />
<mkdir dir="${dist.dir}" />
+ <!-- if a .groovy file is in model or action, set groovy.present -->
+ <available property="groovy.present" value="true" file="" searchparents="true">
+ <filepath>
+ <fileset dir="${src.action.dir}">
+ <include name="**/*.groovy"/>
+ </fileset>
+ </filepath>
+ </available>
+ <!-- NOTE: Seam does not properly detect uncompiled groovy classes in an EAR -->
+ <condition property="groovy.dynamic" value="true">
+ <and>
+ <isset property="groovy.present"/>
+ <istrue value="${debug}"/>
+ </and>
+ </condition>
+ <condition property="groovy.static" value="true">
+ <and>
+ <isset property="groovy.present"/>
+ <isfalse value="${debug}"/>
+ </and>
+ </condition>
</target>
- <target name="compile" depends="init"
+ <target name="groovy.compile" if="groovy.static">
+ <groovyc classpathref="build.classpath"
+ destdir="${jar.dir}"
+ srcdir="${src.model.dir}" >
+ </groovyc>
+ <path id="groovy.action.classpath">
+ <path refid="build.classpath"/>
+ <dirset dir="${jar.dir}"/>
+ </path>
+ <groovyc classpathref="groovy.action.classpath"
+ destdir="${jar.dir}"
+ srcdir="${src.action.dir}" >
+ </groovyc>
+ </target>
+
+ <target name="groovy.copy" if="groovy.dynamic">
+ <copy todir="${jar.dir}">
+ <fileset dir="${src.action.dir}">
+ <include name="**/*.groovy"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="compile" depends="init,groovy.compile,groovy.copy"
description="Compile the Java source code"
unless="eclipse.running">
<javac classpathref="build.classpath"
@@ -67,17 +113,17 @@
description="Copy the classes that were compiled by eclipse"
if="eclipse.running">
<copy todir="${jar.dir}">
- <fileset dir="classes/model">
+ <fileset dir="classes/main">
<include name="**/*.class"/>
</fileset>
- <fileset dir="classes/action">
+ <fileset dir="classes/hot">
<include name="**/*.class"/>
</fileset>
</copy>
</target>
<target name="jar" depends="compile,copyclasses"
- description="Build the distribution .jar file">
+ description="Build the JAR structure in a staging directory">
<copy todir="${jar.dir}">
<fileset dir="${basedir}/resources">
<include name="seam.properties" />
@@ -99,7 +145,7 @@
</target>
<target name="war" depends="compile"
- description="Build the distribution .war file">
+ description="Build the WAR structure in a staging directory">
<copy todir="${war.dir}">
<fileset dir="${basedir}/view" />
</copy>
@@ -139,7 +185,7 @@
</copy>
</target>
- <target name="ear" description="Build the EAR">
+ <target name="ear" description="Build the EAR structure in a staging directory">
<copy todir="${ear.dir}">
<fileset dir="${basedir}/resources">
<include name="*jpdl.xml" />
@@ -215,17 +261,30 @@
<target name="reexplode" depends="unexplode,clean,explode"
description="Undeploy the exploded archive, clean, then deploy the exploded archive"/>
+
+ <target name="check-deployed" description="Check to see if packaged archive is currently deployed">
+ <fail unless="jboss.home">jboss.home not set</fail>
+ <condition property="archive.deployed" value="true">
+ <available file="${ear.deploy.dir}" type="file"/>
+ </condition>
+ </target>
- <target name="restart" depends="explode" description="Restart the exploded archive">
+ <target name="restart-exploded" unless="archive.deployed" description="Deploy exploded archive if not deployed as packaged archive">
<touch file="${ear.deploy.dir}/META-INF/application.xml"/>
</target>
- <target name="deploy" depends="archive,datasource" description="Deploy to JBoss AS">
+ <target name="restart-deployed" if="archive.deployed" description="Deploy packaged archive if deployed as packaged archive">
+ <antcall target="deploy"/>
+ </target>
+
+ <target name="restart" depends="check-deployed,restart-exploded,restart-deployed" description="Restart the exploded archive"/>
+
+ <target name="deploy" depends="archive,datasource" description="Deploy the packaged archive">
<fail unless="jboss.home">jboss.home not set</fail>
<copy todir="${deploy.dir}" file="${dist.dir}/${project.name}.ear" />
</target>
- <target name="undeploy" description="Undeploy the example from JBoss">
+ <target name="undeploy" description="Undeploy the packaged archive">
<delete file="${deploy.dir}/${project.name}.ear" />
<delete file="${deploy.dir}/${project.name}-dev-ds.xml" />
<delete file="${deploy.dir}/${project.name}-prod-ds.xml" />
@@ -234,7 +293,7 @@
<target name="redeploy" depends="undeploy,clean,deploy"
description="Undeploy the packaged archive, clean, then deploy the packaged archive"/>
- <target name="clean" description="Cleans up the build directory">
+ <target name="clean" description="Cleans up the staging directory">
<delete dir="${dist.dir}"/>
<delete dir="${ear.dir}"/>
<delete dir="${war.dir}"/>
@@ -265,12 +324,12 @@
<target name="copytestclasses" if="eclipse.running" description="Copy classes compiled by eclipse to the test dir">
<mkdir dir="${test.dir}"/>
<copy todir="${test.dir}">
- <fileset dir="classes/model">
+ <fileset dir="classes/main">
<include name="**/*.class"/>
</fileset>
</copy>
<copy todir="${test.dir}">
- <fileset dir="classes/action">
+ <fileset dir="classes/hot">
<include name="**/*.class"/>
</fileset>
</copy>
Modified: trunk/seam-gen/build-scripts/deployed-jars-ear.list
===================================================================
--- trunk/seam-gen/build-scripts/deployed-jars-ear.list 2008-10-08 07:57:16 UTC (rev 9223)
+++ trunk/seam-gen/build-scripts/deployed-jars-ear.list 2008-10-08 08:16:29 UTC (rev 9224)
@@ -2,6 +2,7 @@
core.jar
drools-compiler.jar
drools-core.jar
+groovy-all.jar
janino.jar
jboss-el.jar
jbpm-jpdl.jar
Modified: trunk/seam-gen/build.xml
===================================================================
--- trunk/seam-gen/build.xml 2008-10-08 07:57:16 UTC (rev 9223)
+++ trunk/seam-gen/build.xml 2008-10-08 08:16:29 UTC (rev 9224)
@@ -43,8 +43,8 @@
<target name="init-properties" depends="init">
- <packageDirectory property="action.dir" package="action/${action.package}"/>
- <packageDirectory property="model.dir" package="model/${model.package}"/>
+ <packageDirectory property="action.dir" package="hot/${action.package}"/>
+ <packageDirectory property="model.dir" package="main/${model.package}"/>
<packageDirectory property="test.dir" package="test/${test.package}"/>
<pathFilename property="driver.file" path="${driver.jar}"/>
@@ -633,13 +633,13 @@
<target name="copy-icefaces-maven" if="icefaces.property" unless="icefaces.lib.property">
<artifact:dependencies filesetId="icefaces.fileset" versionsId="icefaces.versions">
- <dependency groupId="org.icefaces" artifactId="icefaces" version="1.7.0">
+ <dependency groupId="org.icefaces" artifactId="icefaces" version="1.7.1">
<exclusion groupId="javax.el" artifactId="el-api" />
</dependency>
- <dependency groupId="org.icefaces" artifactId="icefaces-comps" version="1.7.0">
+ <dependency groupId="org.icefaces" artifactId="icefaces-comps" version="1.7.1">
<exclusion groupId="javax.el" artifactId="el-api" />
</dependency>
- <dependency groupId="org.icefaces" artifactId="icefaces-facelets" version="1.7.0">
+ <dependency groupId="org.icefaces" artifactId="icefaces-facelets" version="1.7.1">
<exclusion groupId="javax.el" artifactId="el-api" />
</dependency>
<remoteRepository refId="repository.jboss.org" />
@@ -683,8 +683,8 @@
<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"/>
+ <copy todir="${project.home}/src/hot" file="${base.dir}/resources/seam.properties"/>
+ <copy todir="${project.home}/src/main" file="${base.dir}/resources/seam.properties"/>
</target>
<target name="file-copy-ear" unless="project.war">
@@ -1118,14 +1118,14 @@
<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/main"/>
</hibernate>
<taskdef name="javaformatter"
classname="org.hibernate.tool.ant.JavaFormatterTask" classpathref="htools.classpath"/>
<javaformatter>
- <fileset dir="${project.home}/src/model">
+ <fileset dir="${project.home}/src/main">
<include name="**/*.java"/>
</fileset>
</javaformatter>
@@ -1200,7 +1200,7 @@
classname="org.hibernate.tool.ant.JavaFormatterTask" classpathref="htools.classpath"/>
<javaformatter>
- <fileset dir="${project.home}/src/action">
+ <fileset dir="${project.home}/src/hot">
<include name="**/*.java"/>
</fileset>
</javaformatter>
Modified: trunk/seam-gen/icefaces/build-scripts/build-war.xml
===================================================================
--- trunk/seam-gen/icefaces/build-scripts/build-war.xml 2008-10-08 07:57:16 UTC (rev 9223)
+++ trunk/seam-gen/icefaces/build-scripts/build-war.xml 2008-10-08 08:16:29 UTC (rev 9224)
@@ -1,5 +1,4 @@
<?xml version="1.0"?>
-
<project name="@projectName@" default="deploy" basedir=".">
<!-- Give user a chance to override without editing this file or typing -D -->
@@ -11,8 +10,8 @@
<!-- set global properties for this build -->
<property name="project.name" value="@projectName@"/>
<property name="dist.dir" value="dist" />
- <property name="src.model.dir" value="src/model" />
- <property name="src.action.dir" value="src/action" />
+ <property name="src.model.dir" value="src/main" />
+ <property name="src.action.dir" value="src/hot" />
<property name="src.test.dir" value="src/test" />
<property name="lib.dir" value="lib" />
<property name="war.dir" value="exploded-archives/${project.name}.war" />
@@ -135,9 +134,12 @@
</fileset>
</copy>
</target>
+
+ <target name="compile" depends="compilemodel,compileactions,copyclasses"
+ description="Compile the various source paths"/>
- <target name="war" depends="compilemodel,compileactions,copyclasses"
- description="Build the distribution .war file">
+ <target name="war" depends="compile"
+ description="Build the WAR structure in a staging directory">
<copy todir="${war.dir}/WEB-INF/classes">
<fileset dir="${basedir}/resources">
@@ -145,8 +147,8 @@
<include name="*.drl" />
</fileset>
</copy>
-
- <copy tofile="${war.dir}/components.properties"
+
+ <copy tofile="${war.dir}/WEB-INF/classes/components.properties"
file="${basedir}/resources/components-${profile}.properties"
overwrite="true"/>
@@ -178,10 +180,10 @@
</fileset>
</copy>
- <copy todir="${war.dir}/WEB-INF/lib">
- <fileset dir="${lib.dir}">
+ <copy todir="${war.dir}/WEB-INF/lib">
+ <fileset dir="${lib.dir}">
<includesfile name="deployed-jars.list"/>
- <exclude name="jboss-seam-gen.jar" />
+ <exclude name="jboss-seam-gen.jar"/>
<exclude name="icefaces-ahs.jar"/>
<include name="groovy-*.jar" if="groovy.present"/>
</fileset>
@@ -206,7 +208,7 @@
</target>
<target name="archive" depends="war"
- description="Package the archives">
+ description="Package the WAR archive">
<jar jarfile="${dist.dir}/${project.name}.war" basedir="${war.dir}"/>
</target>
@@ -242,16 +244,29 @@
<target name="reexplode" depends="unexplode,clean,explode"
description="Undeploy the exploded archive, clean, then deploy the exploded archive"/>
- <target name="restart" depends="explode" description="Restart the exploded archive">
+ <target name="check-deployed" description="Check to see if packaged archive is currently deployed">
+ <fail unless="jboss.home">jboss.home not set</fail>
+ <condition property="archive.deployed" value="true">
+ <available file="${war.deploy.dir}" type="file"/>
+ </condition>
+ </target>
+
+ <target name="restart-exploded" unless="archive.deployed" description="Deploy exploded archive if not deployed as packaged archive">
<touch file="${war.deploy.dir}/WEB-INF/web.xml"/>
</target>
+
+ <target name="restart-deployed" if="archive.deployed" description="Deploy packaged archive if deployed as packaged archive">
+ <antcall target="deploy"/>
+ </target>
- <target name="deploy" depends="archive,datasource" description="Deploy to JBoss AS">
+ <target name="restart" depends="check-deployed,restart-exploded,restart-deployed" description="Restart the exploded archive"/>
+
+ <target name="deploy" depends="archive,datasource" description="Deploy the packaged archive">
<fail unless="jboss.home">jboss.home not set</fail>
<copy todir="${deploy.dir}" file="${dist.dir}/${project.name}.war" />
</target>
- <target name="undeploy" description="Undeploy the example from JBoss">
+ <target name="undeploy" description="Undeploy the packaged archive">
<delete file="${deploy.dir}/${project.name}.war" />
<delete file="${deploy.dir}/${project.name}-dev-ds.xml" />
<delete file="${deploy.dir}/${project.name}-prod-ds.xml" />
@@ -260,7 +275,7 @@
<target name="redeploy" depends="undeploy,clean,deploy"
description="Undeploy the packaged archive, clean, then deploy the packaged archive"/>
- <target name="clean" description="Cleans up the build directory">
+ <target name="clean" description="Clean out the staging directory">
<delete dir="${dist.dir}"/>
<delete dir="${war.dir}"/>
<delete dir="${basedir}/test-report"/>
@@ -332,21 +347,21 @@
<target name="test" depends="buildtest" description="Run the tests">
<taskdef resource="testngtasks" classpath="${testng.jar}" />
- <path id="test.path">
- <path path="${test.dir}" />
- <fileset dir="${lib.dir}/test">
- <include name="*.jar" />
- </fileset>
- <path path="${bootstrap.dir}" />
- <path refid="build.classpath" />
- </path>
- <testng outputdir="${basedir}/test-report">
- <classpath refid="test.path" />
- <xmlfileset dir="${test.dir}" includes="*Test.xml" />
- </testng>
+ <path id="test.path">
+ <path path="${test.dir}" />
+ <fileset dir="${lib.dir}/test">
+ <include name="*.jar" />
+ </fileset>
+ <path path="${bootstrap.dir}" />
+ <path refid="build.classpath" />
+ </path>
+ <testng outputdir="${basedir}/test-report">
+ <classpath refid="test.path" />
+ <xmlfileset dir="${test.dir}" includes="*Test.xml" />
+ </testng>
</target>
- <target name="javadoc" depends="compilemodel,compileactions,copyclasses">
+ <target name="javadoc" depends="compile">
<mkdir dir="${dist.dir}/apidoc" />
<javadoc classpathref="build.classpath" destdir="${dist.dir}/apidoc" use="true" protected="true" version="true" windowtitle="${project.name} API Documentation" doctitle="${project.name} API Documentation" link="http://java.sun.com/j2se/5.0/docs/api">
@@ -361,24 +376,24 @@
</javadoc>
</target>
- <target name="freshen" description="grab fresh icefaces jars">
- <copy todir="${lib.dir}">
- <fileset dir="${icefaces.home}/lib">
- <include name="icefaces*.jar" />
- <include name="backport-util-concurrent.jar" />
- <include name="commons-fileupload.jar"/>
- <include name="commons-digester.jar"/>
- <exclude name="icefaces-ahs.jar"/>
- </fileset>
- </copy>
- </target>
+ <target name="freshen" description="grab fresh icefaces jars">
+ <copy todir="${lib.dir}">
+ <fileset dir="${icefaces.home}/lib">
+ <include name="icefaces*.jar" />
+ <include name="backport-util-concurrent.jar" />
+ <include name="commons-fileupload.jar"/>
+ <include name="commons-digester.jar"/>
+ <exclude name="icefaces-ahs.jar"/>
+ </fileset>
+ </copy>
+ </target>
- <target name="purge" depends="undeploy" description="clean out jboss deployments of crashing applications">
- <delete dir="${jboss.home}/server/default/tmp/deploy" />
- <mkdir dir="${jboss.home}/server/default/tmp/deploy/" />
- <delete dir="${jboss.home}/server/default/tmp/sessions" />
- <mkdir dir="${jboss.home}/server/default/tmp/sessions" />
- <delete dir="${jboss.home}/server/default/work/jboss.web/localhost/${project.name}" />
- </target>
-
+ <target name="purge" depends="undeploy" description="clean out jboss deployments of crashing applications">
+ <delete dir="${jboss.home}/server/default/tmp/deploy" />
+ <mkdir dir="${jboss.home}/server/default/tmp/deploy/" />
+ <delete dir="${jboss.home}/server/default/tmp/sessions" />
+ <mkdir dir="${jboss.home}/server/default/tmp/sessions" />
+ <delete dir="${jboss.home}/server/default/work/jboss.web/localhost/${project.name}" />
+ </target>
+
</project>
Modified: trunk/seam-gen/icefaces/build-scripts/build.xml
===================================================================
--- trunk/seam-gen/icefaces/build-scripts/build.xml 2008-10-08 07:57:16 UTC (rev 9223)
+++ trunk/seam-gen/icefaces/build-scripts/build.xml 2008-10-08 08:16:29 UTC (rev 9224)
@@ -1,5 +1,4 @@
<?xml version="1.0"?>
-
<project name="@projectName@" default="deploy" basedir=".">
<!-- Give user a chance to override without editing this file or typing -D -->
@@ -11,8 +10,8 @@
<!-- set global properties for this build -->
<property name="project.name" value="@projectName@"/>
<property name="dist.dir" value="dist" />
- <property name="src.model.dir" value="src/model" />
- <property name="src.action.dir" value="src/action" />
+ <property name="src.model.dir" value="src/main" />
+ <property name="src.action.dir" value="src/hot" />
<property name="src.test.dir" value="src/test" />
<property name="lib.dir" value="lib" />
<property name="ear.dir" value="exploded-archives/${project.name}.ear" />
@@ -44,13 +43,60 @@
</path>
<target name="init" description="Initialize the build">
+ <taskdef name ="groovyc"
+ classname ="org.codehaus.groovy.ant.Groovyc"
+ classpathref="build.classpath"/> <!-- really only the groovy jar is necessary -->
<mkdir dir="${jar.dir}" />
<mkdir dir="${ear.dir}" />
<mkdir dir="${war.dir}" />
<mkdir dir="${dist.dir}" />
+ <!-- if a .groovy file is in model or action, set groovy.present -->
+ <available property="groovy.present" value="true" file="" searchparents="true">
+ <filepath>
+ <fileset dir="${src.action.dir}">
+ <include name="**/*.groovy"/>
+ </fileset>
+ </filepath>
+ </available>
+ <!-- NOTE: Seam does not properly detect uncompiled groovy classes in an EAR -->
+ <condition property="groovy.dynamic" value="true">
+ <and>
+ <isset property="groovy.present"/>
+ <istrue value="${debug}"/>
+ </and>
+ </condition>
+ <condition property="groovy.static" value="true">
+ <and>
+ <isset property="groovy.present"/>
+ <isfalse value="${debug}"/>
+ </and>
+ </condition>
</target>
- <target name="compile" depends="init"
+ <target name="groovy.compile" if="groovy.static">
+ <groovyc classpathref="build.classpath"
+ destdir="${jar.dir}"
+ srcdir="${src.model.dir}" >
+ </groovyc>
+ <path id="groovy.action.classpath">
+ <path refid="build.classpath"/>
+ <dirset dir="${jar.dir}"/>
+ </path>
+ <groovyc classpathref="groovy.action.classpath"
+ destdir="${jar.dir}"
+ srcdir="${src.action.dir}" >
+ </groovyc>
+ </target>
+
+ <target name="groovy.copy" if="groovy.dynamic">
+ <copy todir="${jar.dir}">
+ <fileset dir="${src.action.dir}">
+ <include name="**/*.groovy"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="compile" depends="init,groovy.compile,groovy.copy"
description="Compile the Java source code"
unless="eclipse.running">
<javac classpathref="build.classpath"
@@ -77,7 +123,7 @@
</target>
<target name="jar" depends="compile,copyclasses"
- description="Build the distribution .jar file">
+ description="Build the JAR structure in a staging directory">
<copy todir="${jar.dir}">
<fileset dir="${basedir}/resources">
<include name="seam.properties" />
@@ -99,11 +145,11 @@
</target>
<target name="war" depends="compile"
- description="Build the distribution .war file">
+ description="Build the WAR structure in a staging directory">
<copy todir="${war.dir}">
<fileset dir="${basedir}/view" />
</copy>
- <copy tofile="${war.dir}/components.properties"
+ <copy tofile="${war.dir}/WEB-INF/classes/components.properties"
file="${basedir}/resources/components-${profile}.properties"
overwrite="true"/>
<copy todir="${war.dir}/WEB-INF">
@@ -133,7 +179,7 @@
</copy>
</target>
- <target name="ear" description="Build the EAR">
+ <target name="ear" description="Build the EAR structure in a staging directory">
<copy todir="${ear.dir}">
<fileset dir="${basedir}/resources">
<include name="*jpdl.xml" />
@@ -210,17 +256,30 @@
<target name="reexplode" depends="unexplode,clean,explode"
description="Undeploy the exploded archive, clean, then deploy the exploded archive"/>
+
+ <target name="check-deployed" description="Check to see if packaged archive is currently deployed">
+ <fail unless="jboss.home">jboss.home not set</fail>
+ <condition property="archive.deployed" value="true">
+ <available file="${ear.deploy.dir}" type="file"/>
+ </condition>
+ </target>
- <target name="restart" depends="explode" description="Restart the exploded archive">
- <touch file="${ear.deploy.dir}/META-INF/application.xml"/>
+ <target name="restart-exploded" unless="archive.deployed" description="Deploy exploded archive if not deployed as packaged archive">
+ <touch file="${ear.deploy.dir}/META-INF/application.xml"/>
</target>
- <target name="deploy" depends="archive,datasource" description="Deploy to JBoss AS">
+ <target name="restart-deployed" if="archive.deployed" description="Deploy packaged archive if deployed as packaged archive">
+ <antcall target="deploy"/>
+ </target>
+
+ <target name="restart" depends="check-deployed,restart-exploded,restart-deployed" description="Restart the exploded archive"/>
+
+ <target name="deploy" depends="archive,datasource" description="Deploy the packaged archive">
<fail unless="jboss.home">jboss.home not set</fail>
<copy todir="${deploy.dir}" file="${dist.dir}/${project.name}.ear" />
</target>
- <target name="undeploy" description="Undeploy the example from JBoss">
+ <target name="undeploy" description="Undeploy the packaged archive">
<delete file="${deploy.dir}/${project.name}.ear" />
<delete file="${deploy.dir}/${project.name}-dev-ds.xml" />
<delete file="${deploy.dir}/${project.name}-prod-ds.xml" />
@@ -229,7 +288,7 @@
<target name="redeploy" depends="undeploy,clean,deploy"
description="Undeploy the packaged archive, clean, then deploy the packaged archive"/>
- <target name="clean" description="Cleans up the build directory">
+ <target name="clean" description="Cleans up the staging directory">
<delete dir="${dist.dir}"/>
<delete dir="${ear.dir}"/>
<delete dir="${war.dir}"/>
Modified: trunk/seam-gen/icefaces/build-scripts/deployed-jars-ear.list
===================================================================
--- trunk/seam-gen/icefaces/build-scripts/deployed-jars-ear.list 2008-10-08 07:57:16 UTC (rev 9223)
+++ trunk/seam-gen/icefaces/build-scripts/deployed-jars-ear.list 2008-10-08 08:16:29 UTC (rev 9224)
@@ -5,6 +5,7 @@
core.jar
drools-compiler.jar
drools-core.jar
+groovy-all.jar
icefaces.jar
icefaces-comps.jar
icefaces-facelets.jar
Modified: trunk/seam-gen/icefaces/view/login.xhtml
===================================================================
--- trunk/seam-gen/icefaces/view/login.xhtml 2008-10-08 07:57:16 UTC (rev 9223)
+++ trunk/seam-gen/icefaces/view/login.xhtml 2008-10-08 08:16:29 UTC (rev 9224)
@@ -21,7 +21,7 @@
</table>
- <p>Please login with the username <em>admin</em> and a blank password.</p>
+ <p>Please login with the username 'admin' and a blank password.</p>
<div class="dialog">
<ice:panelGrid id="loginPanelGridId" columns="2" rowClasses="prop" columnClasses="name,value">
Modified: trunk/seam-gen/icefaces/view/stylesheet/theme.css
===================================================================
--- trunk/seam-gen/icefaces/view/stylesheet/theme.css 2008-10-08 07:57:16 UTC (rev 9223)
+++ trunk/seam-gen/icefaces/view/stylesheet/theme.css 2008-10-08 08:16:29 UTC (rev 9224)
@@ -1,5 +1,5 @@
a:active, a:link, a:visited {
- color: #0D5798;
+ color: #0D5798;
}
a:hover {
@@ -13,7 +13,7 @@
color: black;
}
-input[type='submit'], input[type='button'] {
+input[type=submit], input[type=button] {
/* background: #4477AA;
color: white;
margin: 5px;
@@ -21,76 +21,76 @@
}
.errorImg {
- vertical-align: middle;
- width: 16px;
- height: 16px;
+ vertical-align: middle;
+ width: 16px;
+ height: 16px;
}
.errorMsg {
- display: block;
- margin: 5px;
- padding: .1em;
+ display: block;
+ margin: 5px;
+ padding: .1em;
}
.error {
- padding: 5px;
+ padding: 5px;
}
.errors {
- color: red;
- vertical-align: middle;
+ color: red;
+ vertical-align: middle;
}
img.errors {
padding-right: 5px;
}
.formBorderHighlight{
- vertical-align: top; /*width: 100%;*/
- border: 1px solid #bed6f8;
- padding: 5px;
- margin-top: 2px; /* give some space between search panel and list */
+ vertical-align: top; /*width: 100%;*/
+ border: 1px solid #bed6f8;
+ padding: 5px;
+ margin-top: 2px; /* give some space between search panel and list */
}
.menuButtons {
- font-size: 12px;
- font-weight: bold;
- border-color: #bed6f8;
- /* background-color: #BED6F8; */
- background-position: top left;
-
+ font-size: 12px;
+ font-weight: bold;
+ border-color: #bed6f8;
+ /* background-color: #BED6F8; */
+ background-position: top left;
+
}
.menuButtons a {
- font-size: 11px;
- color: #000000;
- font-weight: bold;
- font-family: Arial, Verdana, sans-serif;
- text-decoration: none;
- padding-left: 15px;
- padding-right: 15px;
+ font-size: 11px;
+ color: #000000;
+ font-weight: bold;
+ font-family: Arial, Verdana, sans-serif;
+ text-decoration: none;
+ padding-left: 15px;
+ padding-right: 15px;
}
/*.searchResults {
- border-top: 1px solid #bed6f8;
- border-bottom:1px solid #bed6f8;
- border-left:1px solid #bed6f8;
- border-right:1px solid #bed6f8;
- padding: 5px;
+ border-top: 1px solid #bed6f8;
+ border-bottom:1px solid #bed6f8;
+ border-left:1px solid #bed6f8;
+ border-right:1px solid #bed6f8;
+ padding: 5px;
}*/ /* looks better without this border */
.leftMenu {
- padding: 5px;
- vertical-align: middle;
- text-align: left;
- background-color: transparent;
+ padding: 5px;
+ vertical-align: middle;
+ text-align: left;
+ background-color: transparent;
}
.rightMenu{
- padding: 5px;
- vertical-align: middle;
- text-align: right;
- background-color: transparent;
+ padding: 5px;
+ vertical-align: middle;
+ text-align: right;
+ background-color: transparent;
}
.menuButtons a:hover {
font-family: Arial,sans-serif;
- background-color: #bed6f8;
- color: #0066ff; /*#8CAFCD*/
+ background-color: #bed6f8;
+ color: #0066ff; /*#8CAFCD*/
}
.loginout {
@@ -117,7 +117,7 @@
.tableControl, .actionButtons {
width: 100%;
- font-size:11px;
+ font-size:11px;
}
.tableControl{
@@ -126,10 +126,10 @@
padding-top: 15px;
}
.iceDatTbl{
- margin:0px ;
+ margin:0px ;
}
.iceDataTblOutline {
- width: 98%;
+ width: 98%;
}
/* BEGIN: make the resizable handle prettier */
.iceDatTblResHdlr, .iceDatTblResBor, .iceDatTblBlkTd {
@@ -146,36 +146,36 @@
}
/* END */
.iceTblHeader {
- font-size:11px;
- color: #000000;
- padding-left: 5px;
- padding-right: 5px;
- padding-top: 3px;
- padding-bottom: 3px;
- border-right: 1px solid #CCCCCC;
- border-bottom: 1px solid #CCCCCC;
+ font-size:11px;
+ color: #000000;
+ padding-left: 5px;
+ padding-right: 5px;
+ padding-top: 3px;
+ padding-bottom: 3px;
+ border-right: 1px solid #CCCCCC;
+ border-bottom: 1px solid #CCCCCC;
}
/* data tables are rendered with alternating row colors */
.iceTblRow1 {
- background-color: #FFFFFF;
+ background-color: #FFFFFF;
}
.iceTblRow2 {
- background-color: #eeeeee;
+ background-color: #eeeeee;
}
.allcols, .column1, .column2, .column3, .column4, .column5, .column6, .column7, .column8, .column9, .column10{
- font-size:11px;
- color: #000000;
- padding-left: 5px;
- padding-right: 5px;
- padding-top: 3px;
- padding-bottom: 3px;
- border-right: 1px solid #CCCCCC;
- border-bottom: 1px solid #CCCCCC;
- }
+ font-size:11px;
+ color: #000000;
+ padding-left: 5px;
+ padding-right: 5px;
+ padding-top: 3px;
+ padding-bottom: 3px;
+ border-right: 1px solid #CCCCCC;
+ border-bottom: 1px solid #CCCCCC;
+ }
.dataScrollerTable {
-
+
}
h1 {
@@ -237,18 +237,18 @@
.columnHeader:link, .columnHeader:visited, .columnHeader:active
{
- font-size: 11px;
+ font-size: 11px;
color: #578BB8;
text-decoration: none;
}
.columnHeader:hover
{
- /*color: white;*/ /* breaks theme */
+ /*color: white;*/ /* breaks theme */
text-decoration: underline;
}
-.message {
+#messages {
padding: 5px;
list-style: none;
border: 0;
@@ -259,46 +259,46 @@
font-size: 12px;
}
-.message li {
+#messages li {
margin-left: 3px;
}
-.message li span {
+#messages li span {
background: no-repeat left center;
padding-top: 1px;
padding-left: 20px;
}
-.message li span.infomsg {
+#messages li span.infomsg {
background-image: url(../img/msginfo.png);
}
-.message li span.errormsg {
+#messages li span.errormsg {
background-image: url(../img/msgerror.png);
}
-.message li span.warnmsg {
+#messages li span.warnmsg {
background-image: url(../img/msgwarn.png);
}
.prop {
padding: 5px;
- display: block;
-
+ display: block;
+
}
.prop .name {
font-weight: bold;
text-align: left;
width: 155px;
- float: left;
+ float: left;
}
.prop .value {
- text-align: left;
+ text-align: left;
}
.prop .required{
- color: red;
- text-align: left;
+ color: red;
+ text-align: left;
}
/*.prop .errors {
color: red;
@@ -310,51 +310,50 @@
}
.contentLayoutGridStyleLogin {
- width: 280px; /* fixed height of content demos*/
+ width: 280px; /* fixed height of content demos*/
}
-
.icePageNorth {
- font-weight: bold;
- height: 20px;
- background-color: #cccccc;
- padding: 5px;
- text-align: center;
+ font-weight: bold;
+ height: 20px;
+ background-color: #cccccc;
+ padding: 5px;
+ text-align: center;
}
.calendarGridColumn {
- width: 50%;
- vertical-align: top;
- text-align: left;
+ width: 50%;
+ vertical-align: top;
+ text-align: left;
}
/*
- Calendar Styles
+ Calendar Styles
*/
.iceCalInput {
- width: 90px;
+ width: 90px;
}
.progressBarColumn {
- vertical-align: top;
- text-align: left;
+ vertical-align: top;
+ text-align: left;
}
.tabbedContainerHeaderControl {
- color: #ffffff;
- vertical-align: middle;
- font-weight: bold;
- font-family: tahoma, sans-serif;
- font-size: 14px;
- background: url( "../img/sidebox_bottom.gif" ) transparent repeat-x bottom left;
- height: 29px;
- white-space: nowrap;
- width: 25px;
- text-align: left;
+ color: #ffffff;
+ vertical-align: middle;
+ font-weight: bold;
+ font-family: tahoma, sans-serif;
+ font-size: 14px;
+ background: url( "../img/sidebox_bottom.gif" ) transparent repeat-x bottom left;
+ height: 29px;
+ white-space: nowrap;
+ width: 25px;
+ text-align: left;
}
.iceSelInpDate {
- width: 90px;
+ width: 90px;
}
.icePnlTlTip {
background:#EDDDDD none repeat scroll;
@@ -363,5 +362,5 @@
background:#CDBBBB url() repeat-x;
}
.iceCmdBtn{
- font-size: 16px;
+ font-size: 16px;
}
Modified: trunk/seam-gen/resources/messages_de.properties
===================================================================
--- trunk/seam-gen/resources/messages_de.properties 2008-10-08 07:57:16 UTC (rev 9223)
+++ trunk/seam-gen/resources/messages_de.properties 2008-10-08 08:16:29 UTC (rev 9224)
@@ -17,7 +17,7 @@
validator.email=muss einer wohlgeformten E-Mailadresse entsprechen
org.jboss.seam.loginFailed=Anmeldung fehlgeschlagen
-org.jboss.seam.loginSuccessful=Willkommen, #0
+org.jboss.seam.loginSuccessful=Willkommen, #0!
org.jboss.seam.TransactionFailed=Transaktion fehlgeschlagen
org.jboss.seam.NoConversation=Der Vorgang wurde bereits beendet, verarbeitet eine andere Abfrage oder ergab eine Zeit\u00FCberschreitung
Modified: trunk/seam-gen/resources/messages_en.properties
===================================================================
--- trunk/seam-gen/resources/messages_en.properties 2008-10-08 07:57:16 UTC (rev 9223)
+++ trunk/seam-gen/resources/messages_en.properties 2008-10-08 08:16:29 UTC (rev 9224)
@@ -17,7 +17,7 @@
validator.email=must be a well-formed email address
org.jboss.seam.loginFailed=Login failed
-org.jboss.seam.loginSuccessful=Welcome, #0
+org.jboss.seam.loginSuccessful=Welcome, #0!
org.jboss.seam.TransactionFailed=Transaction failed
org.jboss.seam.NoConversation=The conversation ended, timed out or was processing another request
Modified: trunk/seam-gen/resources/messages_fr.properties
===================================================================
--- trunk/seam-gen/resources/messages_fr.properties 2008-10-08 07:57:16 UTC (rev 9223)
+++ trunk/seam-gen/resources/messages_fr.properties 2008-10-08 08:16:29 UTC (rev 9224)
@@ -25,7 +25,7 @@
org.jboss.seam.unexpected.error = Erreur inattendue. Veuillez essayez de nouveau.
org.jboss.seam.loginFailed = La connexion a �chou�.
-org.jboss.seam.loginSuccessful = Bienvenue, {0}
+org.jboss.seam.loginSuccessful = Bienvenue, {0}!
org.jboss.seam.TransactionFailed = La transaction a �chou�.
org.jboss.seam.NoConversation = La conversation s'est interrompue, a d�pass� les d�lais ou traite une autre requ�te.
Modified: trunk/seam-gen/resources/messages_tr.properties
===================================================================
--- trunk/seam-gen/resources/messages_tr.properties 2008-10-08 07:57:16 UTC (rev 9223)
+++ trunk/seam-gen/resources/messages_tr.properties 2008-10-08 08:16:29 UTC (rev 9224)
@@ -17,7 +17,7 @@
validator.email=girilen de\u011fer e-posta adresi format\u0131na uygun olmal\u0131d\u0131r
org.jboss.seam.loginFailed=Oturum a\u00e7\u0131lamad\u0131
-org.jboss.seam.loginSuccessful=Ho\u015fgeldiniz, #0
+org.jboss.seam.loginSuccessful=Ho\u015fgeldiniz, #0!
org.jboss.seam.TransactionFailed=\u0130\u015flem tamamlanamad\u0131
org.jboss.seam.NoConversation=Konu\u015fma sonland\u0131, zaman a\u015f\u0131m\u0131na u\u011frad\u0131 ya da ba\u015fka bir talebi i\u015fliyordu
Modified: trunk/seam-gen/view/layout/template.xhtml
===================================================================
--- trunk/seam-gen/view/layout/template.xhtml 2008-10-08 07:57:16 UTC (rev 9223)
+++ trunk/seam-gen/view/layout/template.xhtml 2008-10-08 08:16:29 UTC (rev 9224)
@@ -12,11 +12,8 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>@projectName@</title>
<link rel="shortcut icon" href="favicon.ico"/>
- <a:loadStyle src="resource:///org/jboss/seam/ui/richfaces/styles.xcss"/>
- <a:loadStyle src="/stylesheet/theme.css"/>
- <ui:remove><!-- Disable the a:loadStyle tags and enable the link tag to use plain setup -->
- <link href="stylesheet/theme.css" rel="stylesheet" type="text/css" />
- </ui:remove>
+ <ui:remove><!-- Change the stylesheet path to /stylesheet/theme.css to preview in the Visual Editor --></ui:remove>
+ <a:loadStyle src="resource:///stylesheet/theme.xcss"/>
<ui:insert name="head"/>
</head>
Modified: trunk/seam-gen/view/login.xhtml
===================================================================
--- trunk/seam-gen/view/login.xhtml 2008-10-08 07:57:16 UTC (rev 9223)
+++ trunk/seam-gen/view/login.xhtml 2008-10-08 08:16:29 UTC (rev 9224)
@@ -32,7 +32,7 @@
</div>
<p>
- <i>Note - </i> You may login with the username <em>admin</em> and a blank password.
+ <i>Note - </i> You may login with the username 'admin' and a blank password.
</p>
</rich:panel>
Modified: trunk/seam-gen/view/stylesheet/theme.css
===================================================================
--- trunk/seam-gen/view/stylesheet/theme.css 2008-10-08 07:57:16 UTC (rev 9223)
+++ trunk/seam-gen/view/stylesheet/theme.css 2008-10-08 08:16:29 UTC (rev 9224)
@@ -16,13 +16,13 @@
margin-top: 0;
}
-input[type='submit'], input[type='button'] {
+input[type=submit], input[type=button] {
font-size: 10px;
margin: 5px 5px 5px 0;
cursor: pointer;
}
-input[type='text'], input[type='password'], textarea {
+input[type=text], input[type=password], textarea {
font-size: 11px;
padding-left: 1px;
}
@@ -140,12 +140,12 @@
font-size: 12px;
}
-.rich-panel input[type='submit'], .rich-panel input[type='button'],
-.rich-tabpanel input[type='submit'], .rich-tabpanel input[type='button'] {
+.rich-panel input[type=submit], .rich-panel input[type=button],
+.rich-tabpanel input[type=submit], .rich-tabpanel input[type=button] {
margin-bottom: 0;
}
-.tableControl input[type='submit'], .tableControl input[type='button'], .tableControl select {
+.tableControl input[type=submit], .tableControl input[type=button], .tableControl select {
margin: 5px 0 5px 5px;
}
Added: trunk/seam-gen/view/stylesheet/theme.xcss
===================================================================
--- trunk/seam-gen/view/stylesheet/theme.xcss (rev 0)
+++ trunk/seam-gen/view/stylesheet/theme.xcss 2008-10-08 08:16:29 UTC (rev 9224)
@@ -0,0 +1,262 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<f:template xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http:/jsf.exadel.com/template"
+ xmlns:u="http:/jsf.exadel.com/template/util">
+ <u:selector name="body">
+ <u:style name="font-family" skin="generalFamilyFont"/>
+ <u:style name="color" skin="generalTextColor"/>
+ </u:selector>
+ <u:selector name="h1">
+ <u:style name="font-family" skin="generalFamilyFont"/>
+ <u:style name="color" skin="tabDisabledTextColor"/>
+ </u:selector>
+ <u:selector name="a:active, a:link, a:visited">
+ <u:style name="color" skin="generalLinkColor"/>
+ </u:selector>
+ <u:selector name="a:hover">
+ <u:style name="color" skin="hoverLinkColor"/>
+ </u:selector>
+ <u:selector name="input[type=text], input[type=password], textarea, select">
+ <u:style name="background-color" skin="controlBackgroundColor"/>
+ <u:style name="color" skin="controlTextColor"/>
+ <u:style name="background-position" value="left top"/>
+ <u:style name="background-repeat" value="repeat-x"/>
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.html.images.SliderFieldGradient"/>
+ </u:style>
+ <u:style name="border" value="1px solid"/>
+ <u:style name="border-color" skin="tableBorderColor" />
+ </u:selector>
+ <u:selector name="select">
+ <u:style name="background-color" value="transparent"/>
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.html.images.SliderFieldGradient"/>
+ </u:style>
+ </u:selector>
+ <u:selector name="option">
+ <u:style name="background-color" skin="generalBackgroundColor"/>
+ </u:selector>
+ <u:selector name="select[multiple]">
+ <u:style name="background-color" skin="controlBackgroundColor"/>
+ </u:selector>
+ <u:selector name="select[multiple] option">
+ <u:style name="background-color" value="transparent"/>
+ </u:selector>
+ <u:selector name="input[type=submit], input[type=button]">
+ <u:style name="padding" value="1px 4px"/>
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.html.GradientA"/>
+ </u:style>
+ <u:style name="border" value="1px solid"/>
+ <u:style name="border-color" skin="headerBackgroundColor"/>
+ <u:style name="color" skin="headerTextColor"/>
+ <u:style name="font-weight" value="bold"/>
+ </u:selector>
+ <u:selector name="input[type=submit][disabled], input[type=button][disabled]">
+ <u:style name="opacity" value="0.33"/>
+ </u:selector>
+ <!-- hack for IE to just get rid of border since it doubles the border if you use one -->
+ <u:selector name="* html input[type=submit], * html input[type=button], *+html input[type=submit], *+html input[type=button]">
+ <u:style name="border" value="0"/>
+ <u:style name="font-size" value="11px"/>
+ </u:selector>
+ <u:selector name=".rich-table-subheadercell">
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.images.TabGradientB"/>
+ </u:style>
+ </u:selector>
+ <u:selector name=".rich-toolbar a:link, .rich-toolbar a:visited, .rich-toolbar a:active, .rich-toolbar a:hover">
+ <u:style name="color" skin="headerTextColor"/>
+ </u:selector>
+ <u:selector name=".rich-toolbar a:hover">
+ <u:style name="color" skin="generalTextColor"/>
+ </u:selector>
+ <!--
+ <u:selector name=".rich-table-subheadercell a:link, .rich-table-subheadercell a:visited, .rich-table-subheadercell a:active">
+ <u:style name="color" skin="generalTextColor"/>
+ </u:selector>
+ -->
+ <u:selector name=".rich-table-subheadercell a:hover">
+ <u:style name="color" skin="calendarHolidaysTextColor"/>
+ </u:selector>
+
+ <f:verbatim><![CDATA[
+html {
+ overflow-y: scroll;
+}
+
+body {
+ font-size: 12px;
+ margin: 0px;
+}
+
+a img {
+ border: none;
+}
+
+h1 {
+ font-size: 1.6em;
+ margin-top: 0;
+}
+
+input[type=submit], input[type=button] {
+ font-size: 10px;
+ margin: 5px 5px 5px 0;
+ cursor: pointer;
+}
+
+input[type=text], input[type=password], textarea {
+ font-size: 11px;
+ padding-left: 1px;
+}
+
+.tableControl, .actionButtons {
+ width: 100%;
+}
+
+.tableControl a {
+ padding-left: 10px;
+}
+
+.tableControl {
+ text-align: right;
+}
+
+.footer {
+ text-align: center;
+ font-size: 11px;
+ margin-bottom: 10px;
+}
+
+.rich-table {
+ width: 100%;
+}
+
+.body {
+ padding: 30px;
+}
+
+.columnHeader:hover {
+ color: #FF6600;
+}
+
+.message {
+ padding: 5px;
+ list-style: none;
+ border: 0;
+ background: none;
+ padding: 0;
+ color: #000000;
+ margin: 5px 0 8px 0;
+ font-size: 12px;
+}
+
+.message li {
+ background: no-repeat left center;
+ padding-top: 1px;
+ padding-left: 20px;
+ margin-left: 3px;
+}
+
+.message li.infomsg {
+ background-image: url(../img/msginfo.png);
+}
+
+.message li.errormsg {
+ background-image: url(../img/msgerror.png);
+}
+
+.message li.warnmsg {
+ background-image: url(../img/msgwarn.png);
+}
+
+.name {
+ vertical-align: top;
+ font-weight: bold;
+ width: 115px;
+ float: left;
+ padding: 5px;
+ margin-top: 3px;
+ clear: left;
+}
+
+.value {
+ float: left;
+ padding: 5px;
+}
+
+.error {
+ float: left;
+ padding: 5px;
+}
+
+.errors {
+ color: red;
+ vertical-align: middle;
+}
+
+img.errors {
+ padding-right: 5px;
+}
+
+.errors input, .errors textarea {
+ border: 1px solid red !important;
+}
+
+.required {
+ color: red;
+ padding-left: 2px;
+}
+
+.rich-stglpanel-body {
+ overflow: auto;
+}
+
+/* the specificity here is necessary to override the defaults */
+.rich-panel .rich-panel-header,
+.rich-stglpanel .rich-stglpanel-header {
+ padding: 2px 3px;
+}
+
+
+select {
+ font-size: 12px;
+}
+
+.rich-panel input[type=submit], .rich-panel input[type=button],
+.rich-tabpanel input[type=submit], .rich-tabpanel input[type=button] {
+ margin-bottom: 0;
+}
+
+.tableControl input[type=submit], .tableControl input[type=button], .tableControl select {
+ margin: 5px 0 5px 5px;
+}
+
+/* I don't know why this is necessary, but the select is off by a pixel on the top and is padding too much on the left */
+.tableControl select {
+ margin-left: 2px;
+ position: relative;
+ top: 1px;
+}
+
+.actionButtons {
+ padding-left: 1px;
+}
+
+.actionButtons select {
+ margin: 5px 5px 5px 0;
+ vertical-align: bottom;
+}
+
+.rich-datalist {
+ list-style: square;
+ margin: 6px 0 1px 0;
+ padding-left: 18px;
+}
+
+.rich-list-item {
+ padding-bottom: 4px;
+}
+]]></f:verbatim>
+
+</f:template>
16 years, 1 month
Seam SVN: r9223 - in trunk/seam-gen: icefaces/build-scripts and 1 other directory.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2008-10-08 03:57:16 -0400 (Wed, 08 Oct 2008)
New Revision: 9223
Modified:
trunk/seam-gen/build-scripts/.classpath
trunk/seam-gen/icefaces/build-scripts/.classpath
Log:
add jboss-seam-ui and sources to buildpath so you can debug the UI components
Modified: trunk/seam-gen/build-scripts/.classpath
===================================================================
--- trunk/seam-gen/build-scripts/.classpath 2008-10-08 07:43:31 UTC (rev 9222)
+++ trunk/seam-gen/build-scripts/.classpath 2008-10-08 07:57:16 UTC (rev 9223)
@@ -11,6 +11,7 @@
<classpathentry kind="lib" path="lib/hibernate-commons-annotations.jar"/>
<classpathentry kind="lib" path="lib/hibernate-entitymanager.jar"/>
<classpathentry kind="lib" path="lib/jboss-seam.jar" sourcepath="lib/src/jboss-seam-sources.jar"/>
+ <classpathentry kind="lib" path="lib/jboss-seam-ui.jar" sourcepath="lib/src/jboss-seam-ui-sources.jar"/>
<classpathentry kind="lib" path="lib/jboss-seam-debug.jar"/>
<classpathentry kind="lib" path="lib/jboss-cache.jar"/>
<classpathentry kind="lib" path="lib/jbpm-jpdl.jar"/>
Modified: trunk/seam-gen/icefaces/build-scripts/.classpath
===================================================================
--- trunk/seam-gen/icefaces/build-scripts/.classpath 2008-10-08 07:43:31 UTC (rev 9222)
+++ trunk/seam-gen/icefaces/build-scripts/.classpath 2008-10-08 07:57:16 UTC (rev 9223)
@@ -11,6 +11,7 @@
<classpathentry kind="lib" path="lib/hibernate-commons-annotations.jar"/>
<classpathentry kind="lib" path="lib/hibernate-entitymanager.jar"/>
<classpathentry kind="lib" path="lib/jboss-seam.jar" sourcepath="lib/src/jboss-seam-sources.jar"/>
+ <classpathentry kind="lib" path="lib/jboss-seam-ui.jar" sourcepath="lib/src/jboss-seam-ui-sources.jar"/>
<classpathentry kind="lib" path="lib/jboss-seam-debug.jar"/>
<classpathentry kind="lib" path="lib/jboss-cache.jar"/>
<classpathentry kind="lib" path="lib/jbpm-jpdl.jar"/>
16 years, 1 month
Seam SVN: r9222 - trunk/src/main/org/jboss/seam/security/management.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-10-08 03:43:31 -0400 (Wed, 08 Oct 2008)
New Revision: 9222
Modified:
trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java
Log:
JBSEAM-3466
Modified: trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java 2008-10-08 04:23:23 UTC (rev 9221)
+++ trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java 2008-10-08 07:43:31 UTC (rev 9222)
@@ -141,16 +141,16 @@
}
if (roleClass != null)
- {
+ {
+ roleNameProperty = new AnnotatedBeanProperty(roleClass, RoleName.class);
+ roleGroupsProperty = new AnnotatedBeanProperty(roleClass, RoleGroups.class);
+ roleConditionalProperty = new AnnotatedBeanProperty(roleClass, RoleConditional.class);
+
if (!roleNameProperty.isSet())
{
throw new IdentityManagementException("Invalid roleClass " + roleClass.getName() +
" - required annotation @RoleName not found on any Field or Method.");
- }
-
- roleNameProperty = new AnnotatedBeanProperty(roleClass, RoleName.class);
- roleGroupsProperty = new AnnotatedBeanProperty(roleClass, RoleGroups.class);
- roleConditionalProperty = new AnnotatedBeanProperty(roleClass, RoleConditional.class);
+ }
Type type = userRolesProperty.getPropertyType();
if (type instanceof ParameterizedType &&
@@ -300,12 +300,29 @@
Collection userRoles = (Collection) userRolesProperty.getValue(user);
if (userRoles == null)
{
+ Type propType = userRolesProperty.getPropertyType();
+ Class collectionType;
+
+ if (propType instanceof Class && Collection.class.isAssignableFrom((Class) propType))
+ {
+ collectionType = (Class) propType;
+ }
+ else if (propType instanceof ParameterizedType &&
+ Collection.class.isAssignableFrom((Class) ((ParameterizedType) propType).getRawType()))
+ {
+ collectionType = (Class) ((ParameterizedType) propType).getRawType();
+ }
+ else
+ {
+ throw new IllegalStateException("Could not determine collection type for user roles.");
+ }
+
// This should either be a Set, or a List...
- if (Set.class.isAssignableFrom((Class) userRolesProperty.getPropertyType()))
+ if (Set.class.isAssignableFrom(collectionType))
{
userRoles = new HashSet();
}
- else if (List.class.isAssignableFrom((Class) userRolesProperty.getPropertyType()))
+ else if (List.class.isAssignableFrom(collectionType))
{
userRoles = new ArrayList();
}
@@ -583,12 +600,22 @@
}
List<String> roles = new ArrayList<String>();
+
Collection userRoles = (Collection) userRolesProperty.getValue(user);
if (userRoles != null)
{
for (Object role : userRoles)
{
- roles.add((String) roleNameProperty.getValue(role));
+ if (xrefClass == null)
+ {
+ roles.add((String) roleNameProperty.getValue(role));
+ }
+ else
+ {
+ Object xref = roleNameProperty.getValue(role);
+ Object userRole = xrefRoleProperty.getValue(xref);
+ roles.add((String) roleNameProperty.getValue(userRole));
+ }
}
}
16 years, 1 month
Seam SVN: r9221 - in trunk/src/main/org/jboss/seam: util and 1 other directory.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-10-08 00:23:23 -0400 (Wed, 08 Oct 2008)
New Revision: 9221
Modified:
trunk/src/main/org/jboss/seam/security/permission/JpaPermissionStore.java
trunk/src/main/org/jboss/seam/util/Work.java
Log:
oops, broke the build
Modified: trunk/src/main/org/jboss/seam/security/permission/JpaPermissionStore.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/permission/JpaPermissionStore.java 2008-10-08 03:50:08 UTC (rev 9220)
+++ trunk/src/main/org/jboss/seam/security/permission/JpaPermissionStore.java 2008-10-08 04:23:23 UTC (rev 9221)
@@ -529,11 +529,11 @@
if (identityStore != null)
{
- if (recipientIsRole && roleProperty.isSet() && roleProperty.getPropertyClass().equals(identityStore.getRoleClass()))
+ if (recipientIsRole && roleProperty.isSet() && roleProperty.getPropertyType().equals(identityStore.getRoleClass()))
{
return identityStore.lookupRole(recipient.getName());
}
- else if (userProperty.getPropertyClass().equals(identityStore.getUserClass()))
+ else if (userProperty.getPropertyType().equals(identityStore.getUserClass()))
{
return identityStore.lookupUser(recipient.getName());
}
Modified: trunk/src/main/org/jboss/seam/util/Work.java
===================================================================
--- trunk/src/main/org/jboss/seam/util/Work.java 2008-10-08 03:50:08 UTC (rev 9220)
+++ trunk/src/main/org/jboss/seam/util/Work.java 2008-10-08 04:23:23 UTC (rev 9221)
@@ -30,7 +30,7 @@
}
public final T workInTransaction() throws Exception
- {
+ {
boolean transactionActive = Transaction.instance().isActiveOrMarkedRollback()
|| Transaction.instance().isRolledBack(); //TODO: temp workaround, what should we really do in this case??
boolean newTransactionRequired = isNewTransactionRequired(transactionActive);
16 years, 1 month
Seam SVN: r9220 - in trunk/src/main/org/jboss/seam: util and 1 other directory.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-10-07 23:50:08 -0400 (Tue, 07 Oct 2008)
New Revision: 9220
Added:
trunk/src/main/org/jboss/seam/util/TypedBeanProperty.java
Modified:
trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java
trunk/src/main/org/jboss/seam/util/AnnotatedBeanProperty.java
Log:
JBSEAM-3466
Modified: trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java 2008-10-07 21:08:44 UTC (rev 9219)
+++ trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java 2008-10-08 03:50:08 UTC (rev 9220)
@@ -4,6 +4,8 @@
import static org.jboss.seam.annotations.Install.BUILT_IN;
import java.io.Serializable;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
@@ -36,6 +38,7 @@
import org.jboss.seam.log.Logging;
import org.jboss.seam.security.Identity;
import org.jboss.seam.util.AnnotatedBeanProperty;
+import org.jboss.seam.util.TypedBeanProperty;
/**
* The default identity store implementation, uses JPA as its persistence mechanism.
@@ -54,6 +57,8 @@
public static final String EVENT_PRE_PERSIST_USER = "org.jboss.seam.security.management.prePersistUser";
public static final String EVENT_USER_AUTHENTICATED = "org.jboss.seam.security.management.userAuthenticated";
+ public static final String EVENT_PRE_PERSIST_USER_ROLE = "org.jboss.seam.security.management.prePersistUserRole";
+
private static final LogProvider log = Logging.getLogProvider(JpaIdentityStore.class);
protected FeatureSet featureSet;
@@ -62,6 +67,9 @@
private Class userClass;
private Class roleClass;
+ private Class xrefClass;
+ private TypedBeanProperty xrefUserProperty;
+ private TypedBeanProperty xrefRoleProperty;
private AnnotatedBeanProperty<UserPrincipal> userPrincipalProperty;
private AnnotatedBeanProperty<UserPassword> userPasswordProperty;
@@ -119,14 +127,7 @@
userEnabledProperty = new AnnotatedBeanProperty(userClass, UserEnabled.class);
userFirstNameProperty = new AnnotatedBeanProperty(userClass, UserFirstName.class);
userLastNameProperty = new AnnotatedBeanProperty(userClass, UserLastName.class);
-
- if (roleClass != null)
- {
- roleNameProperty = new AnnotatedBeanProperty(roleClass, RoleName.class);
- roleGroupsProperty = new AnnotatedBeanProperty(roleClass, RoleGroups.class);
- roleConditionalProperty = new AnnotatedBeanProperty(roleClass, RoleConditional.class);
- }
-
+
if (!userPrincipalProperty.isSet())
{
throw new IdentityManagementException("Invalid userClass " + userClass.getName() +
@@ -137,12 +138,53 @@
{
throw new IdentityManagementException("Invalid userClass " + userClass.getName() +
" - required annotation @UserRoles not found on any Field or Method.");
- }
+ }
- if (roleClass != null && !roleNameProperty.isSet())
+ if (roleClass != null)
{
- throw new IdentityManagementException("Invalid roleClass " + roleClass.getName() +
- " - required annotation @RoleName not found on any Field or Method.");
+ if (!roleNameProperty.isSet())
+ {
+ throw new IdentityManagementException("Invalid roleClass " + roleClass.getName() +
+ " - required annotation @RoleName not found on any Field or Method.");
+ }
+
+ roleNameProperty = new AnnotatedBeanProperty(roleClass, RoleName.class);
+ roleGroupsProperty = new AnnotatedBeanProperty(roleClass, RoleGroups.class);
+ roleConditionalProperty = new AnnotatedBeanProperty(roleClass, RoleConditional.class);
+
+ Type type = userRolesProperty.getPropertyType();
+ if (type instanceof ParameterizedType &&
+ Collection.class.isAssignableFrom((Class) ((ParameterizedType) type).getRawType()))
+ {
+ Type genType = Object.class;
+
+ for (Type t : ((ParameterizedType) type).getActualTypeArguments())
+ {
+ genType = t;
+ break;
+ }
+
+ // If the @UserRoles property isn't a collection of <roleClass>, then assume the relationship
+ // is going through a cross-reference table
+ if (!genType.equals(roleClass))
+ {
+ xrefClass = (Class) genType;
+ xrefUserProperty = new TypedBeanProperty(xrefClass, userClass);
+ xrefRoleProperty = new TypedBeanProperty(xrefClass, roleClass);
+
+ if (!xrefUserProperty.isSet())
+ {
+ throw new IdentityManagementException("Error configuring JpaIdentityStore - it looks like " +
+ "you're using a cross-reference table, however the user property cannot be determined.");
+ }
+
+ if (!xrefRoleProperty.isSet())
+ {
+ throw new IdentityManagementException("Error configuring JpaIdentityStore - it looks like " +
+ "you're using a cross-reference table, however the role property cannot be determined.");
+ }
+ }
+ }
}
}
@@ -259,11 +301,11 @@
if (userRoles == null)
{
// This should either be a Set, or a List...
- if (Set.class.isAssignableFrom(userRolesProperty.getPropertyClass()))
+ if (Set.class.isAssignableFrom((Class) userRolesProperty.getPropertyType()))
{
userRoles = new HashSet();
}
- else if (List.class.isAssignableFrom(userRolesProperty.getPropertyClass()))
+ else if (List.class.isAssignableFrom((Class) userRolesProperty.getPropertyType()))
{
userRoles = new ArrayList();
}
@@ -275,7 +317,30 @@
return false;
}
- ((Collection) userRolesProperty.getValue(user)).add(roleToGrant);
+ if (xrefClass == null)
+ {
+ // If this is a Many-To-Many relationship, simply add the role
+ ((Collection) userRolesProperty.getValue(user)).add(roleToGrant);
+ }
+ else
+ {
+ // Otherwise we need to insert a cross-reference entity instance
+ try
+ {
+ Object xref = xrefClass.newInstance();
+ xrefUserProperty.setValue(xref, user);
+ xrefRoleProperty.setValue(xref, roleToGrant);
+
+ Events.instance().raiseEvent(EVENT_PRE_PERSIST_USER_ROLE, xref);
+
+ ((Collection) userRolesProperty.getValue(user)).add(mergeEntity(xref));
+ }
+ catch (Exception ex)
+ {
+ throw new IdentityManagementException("Error creating cross-reference role record.", ex);
+ }
+ }
+
mergeEntity(user);
return true;
@@ -294,9 +359,27 @@
{
throw new NoSuchRoleException("Could not revoke role, role '" + role + "' does not exist");
}
-
- boolean success = ((Collection) userRolesProperty.getValue(user)).remove(roleToRevoke);
+
+ boolean success = false;
+ if (xrefClass == null)
+ {
+ success = ((Collection) userRolesProperty.getValue(user)).remove(roleToRevoke);
+ }
+ else
+ {
+ Collection roles = ((Collection) userRolesProperty.getValue(user));
+
+ for (Object xref : roles)
+ {
+ if (xrefRoleProperty.getValue(xref).equals(roleToRevoke))
+ {
+ success = roles.remove(xref);
+ break;
+ }
+ }
+ }
+
if (success) mergeEntity(user);
return success;
}
@@ -322,11 +405,11 @@
if (roleGroups == null)
{
// This should either be a Set, or a List...
- if (Set.class.isAssignableFrom(roleGroupsProperty.getPropertyClass()))
+ if (Set.class.isAssignableFrom((Class) roleGroupsProperty.getPropertyType()))
{
roleGroups = new HashSet();
}
- else if (List.class.isAssignableFrom(roleGroupsProperty.getPropertyClass()))
+ else if (List.class.isAssignableFrom((Class) roleGroupsProperty.getPropertyType()))
{
roleGroups = new ArrayList();
}
Modified: trunk/src/main/org/jboss/seam/util/AnnotatedBeanProperty.java
===================================================================
--- trunk/src/main/org/jboss/seam/util/AnnotatedBeanProperty.java 2008-10-07 21:08:44 UTC (rev 9219)
+++ trunk/src/main/org/jboss/seam/util/AnnotatedBeanProperty.java 2008-10-08 03:50:08 UTC (rev 9220)
@@ -4,6 +4,7 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
+import java.lang.reflect.Type;
/**
* A convenience class for working with an annotated property (either a field or method) of
@@ -17,7 +18,7 @@
private Method propertyGetter;
private Method propertySetter;
private String name;
- private Class propertyClass;
+ private Type propertyType;
private T annotation;
private boolean isFieldProperty;
@@ -70,7 +71,7 @@
{
this.propertyGetter = Reflections.getGetterMethod(cls, this.name);
this.propertySetter = Reflections.getSetterMethod(cls, this.name);
- this.propertyClass = this.propertyGetter.getReturnType();
+ this.propertyType = this.propertyGetter.getGenericReturnType();
isFieldProperty = false;
set = true;
}
@@ -88,7 +89,7 @@
this.propertyField = propertyField;
isFieldProperty = true;
this.name = propertyField.getName();
- this.propertyClass = propertyField.getDeclaringClass();
+ this.propertyType = propertyField.getGenericType();
}
public void setValue(Object bean, Object value)
@@ -125,9 +126,9 @@
return annotation;
}
- public Class getPropertyClass()
+ public Type getPropertyType()
{
- return propertyClass;
+ return propertyType;
}
public boolean isSet()
Added: trunk/src/main/org/jboss/seam/util/TypedBeanProperty.java
===================================================================
--- trunk/src/main/org/jboss/seam/util/TypedBeanProperty.java (rev 0)
+++ trunk/src/main/org/jboss/seam/util/TypedBeanProperty.java 2008-10-08 03:50:08 UTC (rev 9220)
@@ -0,0 +1,109 @@
+package org.jboss.seam.util;
+
+import java.beans.Introspector;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+public class TypedBeanProperty
+{
+ private Field propertyField;
+ private Method propertyGetter;
+ private Method propertySetter;
+
+ private String name;
+
+ private boolean isFieldProperty;
+ private boolean set = false;
+
+ public TypedBeanProperty(Class<?> cls, Class type)
+ {
+ // First check declared fields
+ for (Field f : cls.getDeclaredFields())
+ {
+ if (f.getGenericType().equals(type))
+ {
+ setupFieldProperty(f);
+ set = true;
+ return;
+ }
+ }
+
+ // Then check public fields, in case it's inherited
+ for (Field f : cls.getFields())
+ {
+ if (f.getGenericType().equals(type))
+ {
+ setupFieldProperty(f);
+ set = true;
+ return;
+ }
+ }
+
+ // Then check public methods (we ignore private methods)
+ for (Method m : cls.getMethods())
+ {
+ if (m.getGenericReturnType().equals(type))
+ {
+ String methodName = m.getName();
+
+ if ( m.getName().startsWith("get") )
+ {
+ this.name = Introspector.decapitalize( m.getName().substring(3) );
+ }
+ else if ( methodName.startsWith("is") )
+ {
+ this.name = Introspector.decapitalize( m.getName().substring(2) );
+ }
+
+ if (this.name != null)
+ {
+ this.propertyGetter = Reflections.getGetterMethod(cls, this.name);
+ this.propertySetter = Reflections.getSetterMethod(cls, this.name);
+ isFieldProperty = false;
+ set = true;
+ }
+ else
+ {
+ throw new IllegalStateException("Invalid accessor method, must start with 'get' or 'is'. " +
+ "Method: " + m + " in class: " + cls);
+ }
+ }
+ }
+ }
+
+ private void setupFieldProperty(Field propertyField)
+ {
+ this.propertyField = propertyField;
+ isFieldProperty = true;
+ this.name = propertyField.getName();
+ }
+
+ public void setValue(Object bean, Object value)
+ {
+ if (isFieldProperty)
+ {
+ Reflections.setAndWrap(propertyField, bean, value);
+ }
+ else
+ {
+ Reflections.invokeAndWrap(propertySetter, bean, value);
+ }
+ }
+
+ public Object getValue(Object bean)
+ {
+ if (isFieldProperty)
+ {
+ return Reflections.getAndWrap(propertyField, bean);
+ }
+ else
+ {
+ return Reflections.invokeAndWrap(propertyGetter, bean);
+ }
+ }
+
+ public boolean isSet()
+ {
+ return set;
+ }
+}
16 years, 1 month
Seam SVN: r9219 - trunk/src/main/org/jboss/seam/security.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-10-07 17:08:44 -0400 (Tue, 07 Oct 2008)
New Revision: 9219
Modified:
trunk/src/main/org/jboss/seam/security/SecurityInterceptor.java
Log:
JBSEAM-3526
Modified: trunk/src/main/org/jboss/seam/security/SecurityInterceptor.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/SecurityInterceptor.java 2008-10-07 15:11:44 UTC (rev 9218)
+++ trunk/src/main/org/jboss/seam/security/SecurityInterceptor.java 2008-10-07 21:08:44 UTC (rev 9219)
@@ -1,5 +1,6 @@
package org.jboss.seam.security;
+import java.io.Serializable;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.HashMap;
@@ -25,11 +26,11 @@
*/
@Interceptor(type=InterceptorType.CLIENT,
around=AsynchronousInterceptor.class)
-public class SecurityInterceptor extends AbstractInterceptor
+public class SecurityInterceptor extends AbstractInterceptor implements Serializable
{
private static final long serialVersionUID = -6567750187000766925L;
- private Map<Method,Restriction> restrictions = new HashMap<Method,Restriction>();
+ private transient Map<Method,Restriction> restrictions = new HashMap<Method,Restriction>();
private class Restriction
{
16 years, 1 month
Seam SVN: r9218 - trunk/src/main/org/jboss/seam/async.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-07 11:11:44 -0400 (Tue, 07 Oct 2008)
New Revision: 9218
Modified:
trunk/src/main/org/jboss/seam/async/Asynchronous.java
Log:
JBSEAM-3522
Modified: trunk/src/main/org/jboss/seam/async/Asynchronous.java
===================================================================
--- trunk/src/main/org/jboss/seam/async/Asynchronous.java 2008-10-07 14:00:17 UTC (rev 9217)
+++ trunk/src/main/org/jboss/seam/async/Asynchronous.java 2008-10-07 15:11:44 UTC (rev 9218)
@@ -22,7 +22,7 @@
static final long serialVersionUID = -551286304424595765L;
- private static final LogProvider log = Logging.getLogProvider(Asynchronous.class);
+ private static transient final LogProvider log = Logging.getLogProvider(Asynchronous.class);
private Long processId;
private Long taskId;
16 years, 1 month
Seam SVN: r9217 - in trunk: examples/wicket/src/web/org/jboss/seam/example/wicket and 2 other directories.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-07 10:00:17 -0400 (Tue, 07 Oct 2008)
New Revision: 9217
Added:
trunk/src/wicket/org/jboss/seam/wicket/SeamComponentInstantiationListener.java
trunk/src/wicket/org/jboss/seam/wicket/annotations/
trunk/src/wicket/org/jboss/seam/wicket/annotations/NoConversationPage.java
Modified:
trunk/doc/Seam_Reference_Guide/en-US/Wicket.xml
trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Book.java
trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Confirm.java
trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Hotel.java
trunk/src/wicket/org/jboss/seam/wicket/SeamWebApplication.java
trunk/src/wicket/org/jboss/seam/wicket/WicketComponent.java
Log:
JBSEAM-3516
Modified: trunk/doc/Seam_Reference_Guide/en-US/Wicket.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Wicket.xml 2008-10-07 12:11:07 UTC (rev 9216)
+++ trunk/doc/Seam_Reference_Guide/en-US/Wicket.xml 2008-10-07 14:00:17 UTC (rev 9217)
@@ -122,9 +122,6 @@
Seam will automatically apply the restriction to any nested
classes.
</para>
- <para>
- TODO - Implement this (See JBSEAM-3192)
- </para>
</tip>
<para>
@@ -156,6 +153,16 @@
};]]></programlisting>
<para>
+ You may have pages in your application which can only be accessed
+ when the user has a long-running conversation active. To enforce
+ this you can use the <code>@NoConversationPage</code> annotation:
+ </para>
+
+ <programlisting><![CDATA[@Restrict
+(a)NoConversationPage(Main.class)
+public class Hotel extends WebPage {]]></programlisting>
+
+ <para>
If you want to further decouple your application classes, you can
use Seam events. Of course, you can raise an event using
<code>Events.instance().raiseEvent("foo")</code>. Alternatively, you
Modified: trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Book.java
===================================================================
--- trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Book.java 2008-10-07 12:11:07 UTC (rev 9216)
+++ trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Book.java 2008-10-07 14:00:17 UTC (rev 9217)
@@ -19,8 +19,10 @@
import org.jboss.seam.annotations.security.Restrict;
import org.jboss.seam.example.wicket.action.Booking;
import org.jboss.seam.example.wicket.action.HotelBooking;
+import org.jboss.seam.wicket.annotations.NoConversationPage;
@Restrict
+(a)NoConversationPage(Main.class)
public class Book extends WebPage
{
@@ -42,7 +44,6 @@
add(body);
body.add(new HotelViewPanel("hotelView", booking.getHotel()));
body.add(new HotelBookingForm("booking"));
-
}
public class HotelBookingForm extends Form
Modified: trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Confirm.java
===================================================================
--- trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Confirm.java 2008-10-07 12:11:07 UTC (rev 9216)
+++ trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Confirm.java 2008-10-07 14:00:17 UTC (rev 9217)
@@ -15,8 +15,10 @@
import org.jboss.seam.core.Conversation;
import org.jboss.seam.example.wicket.action.Booking;
import org.jboss.seam.example.wicket.action.HotelBooking;
+import org.jboss.seam.wicket.annotations.NoConversationPage;
@Restrict
+(a)NoConversationPage(Main.class)
public class Confirm extends WebPage
{
@@ -67,11 +69,4 @@
add(body);
}
- @Override
- protected void onBeforeRender()
- {
- super.onBeforeRender();
- System.out.println("cid " + Conversation.instance().getId());
- }
-
}
Modified: trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Hotel.java
===================================================================
--- trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Hotel.java 2008-10-07 12:11:07 UTC (rev 9216)
+++ trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Hotel.java 2008-10-07 14:00:17 UTC (rev 9217)
@@ -8,8 +8,10 @@
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.security.Restrict;
import org.jboss.seam.example.wicket.action.HotelBooking;
+import org.jboss.seam.wicket.annotations.NoConversationPage;
@Restrict
+(a)NoConversationPage(Main.class)
public class Hotel extends WebPage
{
Added: trunk/src/wicket/org/jboss/seam/wicket/SeamComponentInstantiationListener.java
===================================================================
--- trunk/src/wicket/org/jboss/seam/wicket/SeamComponentInstantiationListener.java (rev 0)
+++ trunk/src/wicket/org/jboss/seam/wicket/SeamComponentInstantiationListener.java 2008-10-07 14:00:17 UTC (rev 9217)
@@ -0,0 +1,38 @@
+package org.jboss.seam.wicket;
+
+import org.apache.wicket.AbortException;
+import org.apache.wicket.Component;
+import org.apache.wicket.Page;
+import org.apache.wicket.RequestCycle;
+import org.apache.wicket.application.IComponentInstantiationListener;
+import org.jboss.seam.core.Manager;
+import org.jboss.seam.international.StatusMessage;
+import org.jboss.seam.international.StatusMessages;
+
+public class SeamComponentInstantiationListener implements IComponentInstantiationListener
+{
+
+ public void onInstantiation(Component component)
+ {
+ if (!Manager.instance().isLongRunningConversation())
+ {
+ WicketComponent<?> wicketComponent = WicketComponent.getInstance(component.getClass());
+ if (wicketComponent != null)
+ {
+ Class<? extends Page> noConversationPage = wicketComponent.getNoConversationPage();
+ if (noConversationPage != null)
+ {
+ final RequestCycle cycle = RequestCycle.get();
+ StatusMessages.instance().addFromResourceBundleOrDefault(
+ StatusMessage.Severity.WARN,
+ "org.jboss.seam.NoConversation",
+ "The conversation ended or timed"
+ );
+ cycle.redirectTo(component.getPageFactory().newPage(noConversationPage));
+ throw new AbortException();
+ }
+ }
+ }
+ }
+
+}
Property changes on: trunk/src/wicket/org/jboss/seam/wicket/SeamComponentInstantiationListener.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/wicket/org/jboss/seam/wicket/SeamWebApplication.java
===================================================================
--- trunk/src/wicket/org/jboss/seam/wicket/SeamWebApplication.java 2008-10-07 12:11:07 UTC (rev 9216)
+++ trunk/src/wicket/org/jboss/seam/wicket/SeamWebApplication.java 2008-10-07 14:00:17 UTC (rev 9217)
@@ -111,6 +111,7 @@
super.init();
inititializeSeamSecurity();
initializeSeamStatusMessages();
+ addComponentInstantiationListener(new SeamComponentInstantiationListener());
}
/**
Modified: trunk/src/wicket/org/jboss/seam/wicket/WicketComponent.java
===================================================================
--- trunk/src/wicket/org/jboss/seam/wicket/WicketComponent.java 2008-10-07 12:11:07 UTC (rev 9216)
+++ trunk/src/wicket/org/jboss/seam/wicket/WicketComponent.java 2008-10-07 14:00:17 UTC (rev 9217)
@@ -14,6 +14,7 @@
import java.util.List;
import java.util.Set;
+import org.apache.wicket.Page;
import org.apache.wicket.util.string.Strings;
import org.jboss.seam.Component;
import org.jboss.seam.Namespace;
@@ -37,6 +38,7 @@
import org.jboss.seam.log.LogProvider;
import org.jboss.seam.log.Logging;
import org.jboss.seam.security.Identity;
+import org.jboss.seam.wicket.annotations.NoConversationPage;
import org.jboss.seam.wicket.ioc.BijectedAttribute;
import org.jboss.seam.wicket.ioc.BijectedField;
import org.jboss.seam.wicket.ioc.BijectedMethod;
@@ -98,6 +100,8 @@
boolean anyMethodHasRaiseEvent = false;
+ private Class<? extends Page> noConversationPage;
+
public Class<?> getType()
{
return type;
@@ -150,18 +154,9 @@
{
this.type = type;
this.enclosingType = type.getEnclosingClass();
- if (enclosingType != null)
+ if (this.enclosingType != null)
{
- Class<?> c = enclosingType.getEnclosingClass();
- int i = 0;
- while (c != null)
- {
- c = c.getEnclosingClass();
- i++;
- }
- this.enclosingInstanceVariableName = "this$" + i;
log.info("Class: " + type + ", enclosed by " + enclosingType);
- log.trace("[" + type + "] enclosing instance variable: " + enclosingInstanceVariableName);
}
else
{
@@ -170,8 +165,6 @@
scan();
- scanRestrictions();
-
initInterceptors();
Contexts.getApplicationContext().set(getName(), this);
@@ -180,6 +173,7 @@
private void scan()
{
Class clazz = type;
+ scanClassEnclosureHierachy();
for (Method method : clazz.getDeclaredMethods())
{
add(method);
@@ -194,10 +188,10 @@
}
}
- private void scanRestrictions()
+ private void scanClassEnclosureHierachy()
{
Class cls = type;
-
+ int i = 0;
while (cls != null)
{
for (Annotation annotation : cls.getAnnotations())
@@ -214,11 +208,23 @@
if (restrictions == null) restrictions = new HashSet<String>();
restrictions.add("#{identity.hasRole('" +
annotation.annotationType().getSimpleName().toLowerCase() + "')}");
- }
+ }
+
+ if (annotation instanceof NoConversationPage)
+ {
+ NoConversationPage noConversationPage = (NoConversationPage) annotation;
+ this.noConversationPage = noConversationPage.value();
+ }
}
cls = cls.getEnclosingClass();
+ i++;
}
+
+ if (i > 1)
+ {
+ this.enclosingInstanceVariableName = "this$" + (i - 2);
+ }
}
public void checkRestrictions()
@@ -504,4 +510,9 @@
conversationManagementMembers.contains(member);
}
+ public Class<? extends Page> getNoConversationPage()
+ {
+ return noConversationPage;
+ }
+
}
Added: trunk/src/wicket/org/jboss/seam/wicket/annotations/NoConversationPage.java
===================================================================
--- trunk/src/wicket/org/jboss/seam/wicket/annotations/NoConversationPage.java (rev 0)
+++ trunk/src/wicket/org/jboss/seam/wicket/annotations/NoConversationPage.java 2008-10-07 14:00:17 UTC (rev 9217)
@@ -0,0 +1,20 @@
+package org.jboss.seam.wicket.annotations;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import org.apache.wicket.Page;
+
+@Target(TYPE)
+@Retention(RUNTIME)
+@Documented
+public @interface NoConversationPage
+{
+
+ Class<? extends Page> value();
+
+}
Property changes on: trunk/src/wicket/org/jboss/seam/wicket/annotations/NoConversationPage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 1 month
Seam SVN: r9216 - trunk/src/main/org/jboss/seam/contexts.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-10-07 08:11:07 -0400 (Tue, 07 Oct 2008)
New Revision: 9216
Modified:
trunk/src/main/org/jboss/seam/contexts/ServerConversationContext.java
Log:
replaced recursive processing for additions with a temporary hack to fix failing tests
Modified: trunk/src/main/org/jboss/seam/contexts/ServerConversationContext.java
===================================================================
--- trunk/src/main/org/jboss/seam/contexts/ServerConversationContext.java 2008-10-07 11:00:01 UTC (rev 9215)
+++ trunk/src/main/org/jboss/seam/contexts/ServerConversationContext.java 2008-10-07 12:11:07 UTC (rev 9216)
@@ -18,6 +18,7 @@
import org.jboss.seam.Seam;
import org.jboss.seam.core.Events;
import org.jboss.seam.core.Manager;
+import org.jboss.seam.persistence.PersistenceContexts;
/**
* A conversation context is a logical context that lasts longer than
@@ -25,7 +26,6 @@
* may be passivated or replicated.
*
* @author Gavin King
- * @author Shane Bryzak
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
*/
public class ServerConversationContext implements Context
@@ -291,25 +291,18 @@
}
removals.clear();
+ // TODO this is a hack! We should find a more elegant way of handling
+ // new objects being added to additions during the following for-loop
+ PersistenceContexts.instance();
+
//add new objects
- while (!additions.isEmpty())
- {
- // Copy the additions entries to a temporary variable, then
- // clear additions - during passivation, further attributes may
- // be set in the conversation context so we need to re-iterate
- // through this process until all additions are passivated
- Set<Map.Entry<String,Object>> entries = new HashSet<Map.Entry<String,Object>>(additions.entrySet());
- additions.clear();
-
- for (Map.Entry<String, Object> entry: entries)
- {
- Object attribute = entry.getValue();
-
- passivate(attribute);
- session.put(getKey(entry.getKey()), attribute);
- }
+ for (Map.Entry<String, Object> entry: additions.entrySet()) {
+ Object attribute = entry.getValue();
+
+ passivate(attribute);
+ session.put(getKey(entry.getKey()), attribute);
}
-
+ additions.clear();
}
else
{
16 years, 1 month
Seam SVN: r9215 - trunk/src/main/org/jboss/seam/persistence.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-07 07:00:01 -0400 (Tue, 07 Oct 2008)
New Revision: 9215
Modified:
trunk/src/main/org/jboss/seam/persistence/ManagedPersistenceContext.java
Log:
minor
Modified: trunk/src/main/org/jboss/seam/persistence/ManagedPersistenceContext.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/ManagedPersistenceContext.java 2008-10-07 09:29:21 UTC (rev 9214)
+++ trunk/src/main/org/jboss/seam/persistence/ManagedPersistenceContext.java 2008-10-07 11:00:01 UTC (rev 9215)
@@ -22,7 +22,6 @@
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.Unwrap;
import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.contexts.Lifecycle;
import org.jboss.seam.core.Mutable;
import org.jboss.seam.core.Expressions.ValueExpression;
16 years, 1 month