Seam SVN: r8058 - trunk/examples/spring.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-04-28 13:16:56 -0400 (Mon, 28 Apr 2008)
New Revision: 8058
Modified:
trunk/examples/spring/
Log:
ignores
Property changes on: trunk/examples/spring
___________________________________________________________________
Name: svn:ignore
+ dist-jbosswar
exploded-archives-jbosswar
16 years, 7 months
Seam SVN: r8057 - trunk/build.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-04-28 13:16:35 -0400 (Mon, 28 Apr 2008)
New Revision: 8057
Modified:
trunk/build/utilities.build.xml
Log:
oops
Modified: trunk/build/utilities.build.xml
===================================================================
--- trunk/build/utilities.build.xml 2008-04-28 17:10:37 UTC (rev 8056)
+++ trunk/build/utilities.build.xml 2008-04-28 17:16:35 UTC (rev 8057)
@@ -200,7 +200,6 @@
<arg line="-Dseam.version=${complete.version}" />
<arg line="--settings ${maven.settings.xml}" />
<!--<arg line="-q" />-->
- <arg line="-X" />
<args />
<arg line="@{target}" />
</java>
16 years, 7 months
Seam SVN: r8056 - in trunk/build: maven and 1 other directory.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-04-28 13:10:37 -0400 (Mon, 28 Apr 2008)
New Revision: 8056
Added:
trunk/build/ci.settings.xml
trunk/build/settings.xml
Removed:
trunk/build/maven/conf/
trunk/build/settings.xml
Modified:
trunk/build/ci.build.xml
trunk/build/common.build.xml
trunk/build/utilities.build.xml
Log:
Add support for specifying different settings.xml for maven
Modified: trunk/build/ci.build.xml
===================================================================
--- trunk/build/ci.build.xml 2008-04-28 16:48:42 UTC (rev 8055)
+++ trunk/build/ci.build.xml 2008-04-28 17:10:37 UTC (rev 8056)
@@ -10,6 +10,8 @@
<property name="seam.dir" value="${basedir}/../" />
<property name="dist.location" value="${seam.dir}/dist" />
<property name="dist.ref.dir" value="${dist.location}/ref" />
+
+ <property name="maven.settings.xml" location="ci.settings.xml" />
<import file="common.build.xml" />
Added: trunk/build/ci.settings.xml
===================================================================
--- trunk/build/ci.settings.xml (rev 0)
+++ trunk/build/ci.settings.xml 2008-04-28 17:10:37 UTC (rev 8056)
@@ -0,0 +1,249 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<!--
+ | This is the configuration file for Maven. It can be specified at two levels:
+ |
+ | 1. User Level. This settings.xml file provides configuration for a single user,
+ | and is normally provided in $HOME/.m2/settings.xml.
+ |
+ | NOTE: This location can be overridden with the system property:
+ |
+ | -Dorg.apache.maven.user-settings=/path/to/user/settings.xml
+ |
+ | 2. Global Level. This settings.xml file provides configuration for all maven
+ | users on a machine (assuming they're all using the same maven
+ | installation). It's normally provided in
+ | ${maven.home}/conf/settings.xml.
+ |
+ | NOTE: This location can be overridden with the system property:
+ |
+ | -Dorg.apache.maven.global-settings=/path/to/global/settings.xml
+ |
+ | The sections in this sample file are intended to give you a running start at
+ | getting the most out of your Maven installation. Where appropriate, the default
+ | values (values used when the setting is not specified) are provided.
+ |
+ |-->
+<settings>
+ <!-- localRepository
+ | The path to the local repository maven will use to store artifacts.
+ |
+ | Default: ~/.m2/repository
+ <localRepository>/path/to/local/repo</localRepository>
+ -->
+
+ <localRepository>${env.REPOSITORY}/.m2/repository</localRepository>
+
+ <!-- interactiveMode
+ | This will determine whether maven prompts you when it needs input. If set to false,
+ | maven will use a sensible default value, perhaps based on some other setting, for
+ | the parameter in question.
+ |
+ | Default: true
+ <interactiveMode>true</interactiveMode>
+ -->
+
+ <!-- offline
+ | Determines whether maven should attempt to connect to the network when executing a build.
+ | This will have an effect on artifact downloads, artifact deployment, and others.
+ |
+ | Default: false
+ <offline>false</offline>
+ -->
+
+ <!-- proxies
+ | This is a list of proxies which can be used on this machine to connect to the network.
+ | Unless otherwise specified (by system property or command-line switch), the first proxy
+ | specification in this list marked as active will be used.
+ |-->
+ <proxies>
+ <!-- proxy
+ | Specification for one proxy, to be used in connecting to the network.
+ |
+ <proxy>
+ <id>optional</id>
+ <active>true</active>
+ <protocol>http</protocol>
+ <username>proxyuser</username>
+ <password>proxypass</password>
+ <host>proxy.host.net</host>
+ <port>80</port>
+ <nonProxyHosts>local.net,some.host.com</nonProxyHosts>
+ </proxy>
+ -->
+ </proxies>
+
+ <!-- servers
+ | This is a list of authentication profiles, keyed by the server-id used within the system.
+ | Authentication profiles can be used whenever maven must make a connection to a remote server.
+ |-->
+ <servers>
+ <!-- server
+ | Specifies the authentication information to use when connecting to a particular server, identified by
+ | a unique name within the system (referred to by the 'id' attribute below).
+ |
+ | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
+ | used together.
+ |
+ <server>
+ <id>deploymentRepo</id>
+ <username>repouser</username>
+ <password>repopwd</password>
+ </server>
+ -->
+
+ <!-- Another sample, using keys to authenticate.
+ <server>
+ <id>siteServer</id>
+ <privateKey>/path/to/private/key</privateKey>
+ <passphrase>optional; leave empty if not used.</passphrase>
+ </server>
+ -->
+ </servers>
+
+ <!-- mirrors
+ | This is a list of mirrors to be used in downloading artifacts from remote repositories.
+ |
+ | It works like this: a POM may declare a repository to use in resolving certain artifacts.
+ | However, this repository may have problems with heavy traffic at times, so people have mirrored
+ | it to several places.
+ |
+ | That repository definition will have a unique id, so we can create a mirror reference for that
+ | repository, to be used as an alternate download site. The mirror site will be the preferred
+ | server for that repository.
+ |-->
+ <mirrors>
+ <!-- mirror
+ | Specifies a repository mirror site to use instead of a given repository. The repository that
+ | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
+ | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
+ |
+ <mirror>
+ <id>mirrorId</id>
+ <mirrorOf>repositoryId</mirrorOf>
+ <name>Human Readable Name for this Mirror.</name>
+ <url>http://my.repository.com/repo/path</url>
+ </mirror>
+ -->
+ <mirror>
+ <id>fake.mirror.of.central</id>
+ <mirrorOf>central</mirrorOf>
+ <name>Fake mirror of central - reroutes central to repository.jboss.org</name>
+ <url>http://repository.jboss.org/maven2</url>
+ </mirror>
+ </mirrors>
+
+ <!-- profiles
+ | This is a list of profiles which can be activated in a variety of ways, and which can modify
+ | the build process. Profiles provided in the settings.xml are intended to provide local machine-
+ | specific paths and repository locations which allow the build to work in the local environment.
+ |
+ | For example, if you have an integration testing plugin - like cactus - that needs to know where
+ | your Tomcat instance is installed, you can provide a variable here such that the variable is
+ | dereferenced during the build process to configure the cactus plugin.
+ |
+ | As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
+ | section of this document (settings.xml) - will be discussed later. Another way essentially
+ | relies on the detection of a system property, either matching a particular value for the property,
+ | or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
+ | value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
+ | Finally, the list of active profiles can be specified directly from the command line.
+ |
+ | NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
+ | repositories, plugin repositories, and free-form properties to be used as configuration
+ | variables for plugins in the POM.
+ |
+ |-->
+ <profiles>
+ <!-- profile
+ | Specifies a set of introductions to the build process, to be activated using one or more of the
+ | mechanisms described above. For inheritance purposes, and to activate profiles via <activatedProfiles/>
+ | or the command line, profiles have to have an ID that is unique.
+ |
+ | An encouraged best practice for profile identification is to use a consistent naming convention
+ | for profiles, such as 'env-dev', 'env-test', 'env-production', 'user-jdcasey', 'user-brett', etc.
+ | This will make it more intuitive to understand what the set of introduced profiles is attempting
+ | to accomplish, particularly when you only have a list of profile id's for debug.
+ |
+ | This profile example uses the JDK version to trigger activation, and provides a JDK-specific repo.
+ <profile>
+ <id>jdk-1.4</id>
+
+ <activation>
+ <jdk>1.4</jdk>
+ </activation>
+
+ <repositories>
+ <repository>
+ <id>jdk14</id>
+ <name>Repository for JDK 1.4 builds</name>
+ <url>http://www.myhost.com/maven/jdk14</url>
+ <layout>default</layout>
+ <snapshotPolicy>always</snapshotPolicy>
+ </repository>
+ </repositories>
+ </profile>
+ -->
+
+ <!--
+ | Here is another profile, activated by the system property 'target-env' with a value of 'dev',
+ | which provides a specific path to the Tomcat instance. To use this, your plugin configuration
+ | might hypothetically look like:
+ |
+ | ...
+ | <plugin>
+ | <groupId>org.myco.myplugins</groupId>
+ | <artifactId>myplugin</artifactId>
+ |
+ | <configuration>
+ | <tomcatLocation>${tomcatPath}</tomcatLocation>
+ | </configuration>
+ | </plugin>
+ | ...
+ |
+ | NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to
+ | anything, you could just leave off the <value/> inside the activation-property.
+ |
+ <profile>
+ <id>env-dev</id>
+
+ <activation>
+ <property>
+ <name>target-env</name>
+ <value>dev</value>
+ </property>
+ </activation>
+
+ <properties>
+ <tomcatPath>/path/to/tomcat/instance</tomcatPath>
+ </properties>
+ </profile>
+ -->
+ </profiles>
+
+ <!-- activeProfiles
+ | List of profiles that are active for all builds.
+ |
+ <activeProfiles>
+ <activeProfile>alwaysActiveProfile</activeProfile>
+ <activeProfile>anotherAlwaysActiveProfile</activeProfile>
+ </activeProfiles>
+ -->
+</settings>
Property changes on: trunk/build/ci.settings.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/build/common.build.xml
===================================================================
--- trunk/build/common.build.xml 2008-04-28 16:48:42 UTC (rev 8055)
+++ trunk/build/common.build.xml 2008-04-28 17:10:37 UTC (rev 8056)
@@ -18,6 +18,10 @@
<property name="tmp.dir" value="${seam.dir}/classes" />
<property name="lib.dir" value="${seam.dir}/lib" />
<property name="endorsed.dir" value="${tmp.dir}/endorsed" />
+
+ <!-- Set the location of the maven settings.xml file -->
+
+ <property name="maven.settings.xml" location="${build.dir}/settings.xml" />
<property name="embedded.version" value="beta3" />
Deleted: trunk/build/settings.xml
===================================================================
--- trunk/build/settings.xml 2008-04-28 16:48:42 UTC (rev 8055)
+++ trunk/build/settings.xml 2008-04-28 17:10:37 UTC (rev 8056)
@@ -1,24 +0,0 @@
-<settings xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
- http://maven.apache.org/xsd/settings-1.0.0.xsd">
- <profiles>
- <profile>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <repositories>
- <repository>
- <id>temporary</id>
- <name>Temporary Local Repository</name>
- <url>file://@tmp.dir@/tmp-repository</url>
- </repository>
- <repository>
- <id>development</id>
- <name>Development Repository</name>
- <url>file://@build.dir@/repository</url>
- </repository>
- </repositories>
- </profile>
- </profiles>
-</settings>
\ No newline at end of file
Copied: trunk/build/settings.xml (from rev 8052, trunk/build/maven/conf/settings.xml)
===================================================================
--- trunk/build/settings.xml (rev 0)
+++ trunk/build/settings.xml 2008-04-28 17:10:37 UTC (rev 8056)
@@ -0,0 +1,247 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<!--
+ | This is the configuration file for Maven. It can be specified at two levels:
+ |
+ | 1. User Level. This settings.xml file provides configuration for a single user,
+ | and is normally provided in $HOME/.m2/settings.xml.
+ |
+ | NOTE: This location can be overridden with the system property:
+ |
+ | -Dorg.apache.maven.user-settings=/path/to/user/settings.xml
+ |
+ | 2. Global Level. This settings.xml file provides configuration for all maven
+ | users on a machine (assuming they're all using the same maven
+ | installation). It's normally provided in
+ | ${maven.home}/conf/settings.xml.
+ |
+ | NOTE: This location can be overridden with the system property:
+ |
+ | -Dorg.apache.maven.global-settings=/path/to/global/settings.xml
+ |
+ | The sections in this sample file are intended to give you a running start at
+ | getting the most out of your Maven installation. Where appropriate, the default
+ | values (values used when the setting is not specified) are provided.
+ |
+ |-->
+<settings>
+ <!-- localRepository
+ | The path to the local repository maven will use to store artifacts.
+ |
+ | Default: ~/.m2/repository
+ <localRepository>/path/to/local/repo</localRepository>
+ -->
+
+ <!-- interactiveMode
+ | This will determine whether maven prompts you when it needs input. If set to false,
+ | maven will use a sensible default value, perhaps based on some other setting, for
+ | the parameter in question.
+ |
+ | Default: true
+ <interactiveMode>true</interactiveMode>
+ -->
+
+ <!-- offline
+ | Determines whether maven should attempt to connect to the network when executing a build.
+ | This will have an effect on artifact downloads, artifact deployment, and others.
+ |
+ | Default: false
+ <offline>false</offline>
+ -->
+
+ <!-- proxies
+ | This is a list of proxies which can be used on this machine to connect to the network.
+ | Unless otherwise specified (by system property or command-line switch), the first proxy
+ | specification in this list marked as active will be used.
+ |-->
+ <proxies>
+ <!-- proxy
+ | Specification for one proxy, to be used in connecting to the network.
+ |
+ <proxy>
+ <id>optional</id>
+ <active>true</active>
+ <protocol>http</protocol>
+ <username>proxyuser</username>
+ <password>proxypass</password>
+ <host>proxy.host.net</host>
+ <port>80</port>
+ <nonProxyHosts>local.net,some.host.com</nonProxyHosts>
+ </proxy>
+ -->
+ </proxies>
+
+ <!-- servers
+ | This is a list of authentication profiles, keyed by the server-id used within the system.
+ | Authentication profiles can be used whenever maven must make a connection to a remote server.
+ |-->
+ <servers>
+ <!-- server
+ | Specifies the authentication information to use when connecting to a particular server, identified by
+ | a unique name within the system (referred to by the 'id' attribute below).
+ |
+ | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
+ | used together.
+ |
+ <server>
+ <id>deploymentRepo</id>
+ <username>repouser</username>
+ <password>repopwd</password>
+ </server>
+ -->
+
+ <!-- Another sample, using keys to authenticate.
+ <server>
+ <id>siteServer</id>
+ <privateKey>/path/to/private/key</privateKey>
+ <passphrase>optional; leave empty if not used.</passphrase>
+ </server>
+ -->
+ </servers>
+
+ <!-- mirrors
+ | This is a list of mirrors to be used in downloading artifacts from remote repositories.
+ |
+ | It works like this: a POM may declare a repository to use in resolving certain artifacts.
+ | However, this repository may have problems with heavy traffic at times, so people have mirrored
+ | it to several places.
+ |
+ | That repository definition will have a unique id, so we can create a mirror reference for that
+ | repository, to be used as an alternate download site. The mirror site will be the preferred
+ | server for that repository.
+ |-->
+ <mirrors>
+ <!-- mirror
+ | Specifies a repository mirror site to use instead of a given repository. The repository that
+ | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
+ | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
+ |
+ <mirror>
+ <id>mirrorId</id>
+ <mirrorOf>repositoryId</mirrorOf>
+ <name>Human Readable Name for this Mirror.</name>
+ <url>http://my.repository.com/repo/path</url>
+ </mirror>
+ -->
+ <mirror>
+ <id>fake.mirror.of.central</id>
+ <mirrorOf>central</mirrorOf>
+ <name>Fake mirror of central - reroutes central to repository.jboss.org</name>
+ <url>http://repository.jboss.org/maven2</url>
+ </mirror>
+ </mirrors>
+
+ <!-- profiles
+ | This is a list of profiles which can be activated in a variety of ways, and which can modify
+ | the build process. Profiles provided in the settings.xml are intended to provide local machine-
+ | specific paths and repository locations which allow the build to work in the local environment.
+ |
+ | For example, if you have an integration testing plugin - like cactus - that needs to know where
+ | your Tomcat instance is installed, you can provide a variable here such that the variable is
+ | dereferenced during the build process to configure the cactus plugin.
+ |
+ | As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
+ | section of this document (settings.xml) - will be discussed later. Another way essentially
+ | relies on the detection of a system property, either matching a particular value for the property,
+ | or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
+ | value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
+ | Finally, the list of active profiles can be specified directly from the command line.
+ |
+ | NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
+ | repositories, plugin repositories, and free-form properties to be used as configuration
+ | variables for plugins in the POM.
+ |
+ |-->
+ <profiles>
+ <!-- profile
+ | Specifies a set of introductions to the build process, to be activated using one or more of the
+ | mechanisms described above. For inheritance purposes, and to activate profiles via <activatedProfiles/>
+ | or the command line, profiles have to have an ID that is unique.
+ |
+ | An encouraged best practice for profile identification is to use a consistent naming convention
+ | for profiles, such as 'env-dev', 'env-test', 'env-production', 'user-jdcasey', 'user-brett', etc.
+ | This will make it more intuitive to understand what the set of introduced profiles is attempting
+ | to accomplish, particularly when you only have a list of profile id's for debug.
+ |
+ | This profile example uses the JDK version to trigger activation, and provides a JDK-specific repo.
+ <profile>
+ <id>jdk-1.4</id>
+
+ <activation>
+ <jdk>1.4</jdk>
+ </activation>
+
+ <repositories>
+ <repository>
+ <id>jdk14</id>
+ <name>Repository for JDK 1.4 builds</name>
+ <url>http://www.myhost.com/maven/jdk14</url>
+ <layout>default</layout>
+ <snapshotPolicy>always</snapshotPolicy>
+ </repository>
+ </repositories>
+ </profile>
+ -->
+
+ <!--
+ | Here is another profile, activated by the system property 'target-env' with a value of 'dev',
+ | which provides a specific path to the Tomcat instance. To use this, your plugin configuration
+ | might hypothetically look like:
+ |
+ | ...
+ | <plugin>
+ | <groupId>org.myco.myplugins</groupId>
+ | <artifactId>myplugin</artifactId>
+ |
+ | <configuration>
+ | <tomcatLocation>${tomcatPath}</tomcatLocation>
+ | </configuration>
+ | </plugin>
+ | ...
+ |
+ | NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to
+ | anything, you could just leave off the <value/> inside the activation-property.
+ |
+ <profile>
+ <id>env-dev</id>
+
+ <activation>
+ <property>
+ <name>target-env</name>
+ <value>dev</value>
+ </property>
+ </activation>
+
+ <properties>
+ <tomcatPath>/path/to/tomcat/instance</tomcatPath>
+ </properties>
+ </profile>
+ -->
+ </profiles>
+
+ <!-- activeProfiles
+ | List of profiles that are active for all builds.
+ |
+ <activeProfiles>
+ <activeProfile>alwaysActiveProfile</activeProfile>
+ <activeProfile>anotherAlwaysActiveProfile</activeProfile>
+ </activeProfiles>
+ -->
+</settings>
Modified: trunk/build/utilities.build.xml
===================================================================
--- trunk/build/utilities.build.xml 2008-04-28 16:48:42 UTC (rev 8055)
+++ trunk/build/utilities.build.xml 2008-04-28 17:10:37 UTC (rev 8056)
@@ -31,7 +31,7 @@
<attribute name="scope" />
<attribute name="pom" />
<sequential>
- <artifact:dependencies pathId="@{scope}.(a){id}.path" filesetId="@{scope}.(a){id}.fileset" versionsId="@{scope}.(a){id}.versions" useScope="@{scope}" settingsFile="${maven.dir}/conf/settings.xml">
+ <artifact:dependencies pathId="@{scope}.(a){id}.path" filesetId="@{scope}.(a){id}.fileset" versionsId="@{scope}.(a){id}.versions" useScope="@{scope}" settingsFile="${maven.settings.xml}">
<pom file="@{pom}" />
</artifact:dependencies>
</sequential>
@@ -42,7 +42,7 @@
<attribute name="scope" />
<element name="inline" implicit="true"/>
<sequential>
- <artifact:dependencies pathId="@{scope}.(a){id}.path" filesetId="@{scope}.(a){id}.fileset" versionsId="@{scope}.(a){id}.versions" useScope="@{scope}" settingsFile="${maven.dir}/conf/settings.xml">
+ <artifact:dependencies pathId="@{scope}.(a){id}.path" filesetId="@{scope}.(a){id}.fileset" versionsId="@{scope}.(a){id}.versions" useScope="@{scope}" settingsFile="${maven.settings.xml}">
<inline />
</artifact:dependencies>
</sequential>
@@ -53,7 +53,7 @@
<attribute name="scope" />
<attribute name="pom" />
<sequential>
- <artifact:dependencies pathId="@{scope}.(a){id}.path" filesetId="@{scope}.(a){id}.fileset" versionsId="@{scope}.(a){id}.versions" useScope="@{scope}" sourcesFilesetId="@{scope}.(a){id}.source.fileset" settingsFile="${maven.dir}/conf/settings.xml">
+ <artifact:dependencies pathId="@{scope}.(a){id}.path" filesetId="@{scope}.(a){id}.fileset" versionsId="@{scope}.(a){id}.versions" useScope="@{scope}" sourcesFilesetId="@{scope}.(a){id}.source.fileset" settingsFile="${maven.settings.xml}">
<pom file="@{pom}" />
</artifact:dependencies>
</sequential>
@@ -198,7 +198,9 @@
<sysproperty key="classworlds.conf" value="${maven.dir}/bin/m2.conf" />
<sysproperty key="maven.home" value="${maven.dir}" />
<arg line="-Dseam.version=${complete.version}" />
+ <arg line="--settings ${maven.settings.xml}" />
<!--<arg line="-q" />-->
+ <arg line="-X" />
<args />
<arg line="@{target}" />
</java>
16 years, 7 months
Seam SVN: r8055 - trunk/src/pdf/org/jboss/seam/pdf.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-04-28 12:48:42 -0400 (Mon, 28 Apr 2008)
New Revision: 8055
Modified:
trunk/src/pdf/org/jboss/seam/pdf/ITextUtils.java
Log:
JBSEAM-1165
Modified: trunk/src/pdf/org/jboss/seam/pdf/ITextUtils.java
===================================================================
--- trunk/src/pdf/org/jboss/seam/pdf/ITextUtils.java 2008-04-28 16:46:45 UTC (rev 8054)
+++ trunk/src/pdf/org/jboss/seam/pdf/ITextUtils.java 2008-04-28 16:48:42 UTC (rev 8055)
@@ -9,25 +9,25 @@
import com.lowagie.text.Rectangle;
public class ITextUtils {
- static Map<String,Color> colorMap = new HashMap<String,Color>();
-
- static {
- colorMap.put("white", Color.white);
- colorMap.put("gray", Color.gray);
- colorMap.put("lightgray", Color.lightGray);
- colorMap.put("darkgray", Color.darkGray);
- colorMap.put("black", Color.black);
- colorMap.put("red", Color.red);
- colorMap.put("pink", Color.pink);
- colorMap.put("yellow", Color.yellow);
- colorMap.put("green", Color.green);
- colorMap.put("magenta", Color.magenta);
- colorMap.put("cyan", Color.cyan);
- colorMap.put("blue", Color.blue);
- colorMap.put("orange", Color.orange);
- }
+ static Map<String,Color> colorMap = new HashMap<String,Color>();
-
+ static {
+ colorMap.put("white", Color.white);
+ colorMap.put("gray", Color.gray);
+ colorMap.put("lightgray", Color.lightGray);
+ colorMap.put("darkgray", Color.darkGray);
+ colorMap.put("black", Color.black);
+ colorMap.put("red", Color.red);
+ colorMap.put("pink", Color.pink);
+ colorMap.put("yellow", Color.yellow);
+ colorMap.put("green", Color.green);
+ colorMap.put("magenta", Color.magenta);
+ colorMap.put("cyan", Color.cyan);
+ colorMap.put("blue", Color.blue);
+ colorMap.put("orange", Color.orange);
+ }
+
+
/**
* not all itext objects accept a string value as input,
* so we'll copy that logic here.
@@ -35,12 +35,12 @@
public static int alignmentValue(String alignment) {
return ElementTags.alignmentValue(alignment);
}
-
+
public static Rectangle pageSizeValue(String name) {
return PageSize.getRectangle(name);
}
-
-
+
+
/**
* return a color value from a string specification.
*/
@@ -48,32 +48,68 @@
if (colorName == null) {
return null;
}
+
+ colorName = colorName.trim().toLowerCase();
+
+ Color color = colorMap.get(colorName);
+
+ if (color == null && colorName.startsWith("rgb")) {
+ color = rgbStringToColor(colorName);
+ }
+ if (color == null) {
+ color = Color.decode(colorName);
+ }
+
+ return color;
+ }
+
+ /*
+ * Returns color of the form rgb(r,g,b) or rgb(r,g,b,a)
+ * r,g,b,a values can be 0-255 or float values with a '%' sign
+ */
+ public static Color rgbStringToColor(String rgbString) {
+ String rgb[] = rgbString.split(",");
- Color color = colorMap.get(colorName.toLowerCase());
- if (color == null) {
- color = Color.decode(colorName);
- }
- return color;
+ if (rgb.length == 3) {
+ return new Color(parseSingleChanel(rgb[0]),
+ parseSingleChanel(rgb[1]),
+ parseSingleChanel(rgb[2]));
+ } else if (rgb.length == 4) {
+ return new Color(parseSingleChanel(rgb[0]),
+ parseSingleChanel(rgb[1]),
+ parseSingleChanel(rgb[2]),
+ parseSingleChanel(rgb[3]));
+ }
+
+ throw new RuntimeException("invalid rgb color specification: " + rgbString);
}
+ private static int parseSingleChanel(String chanel) {
+ if (chanel.contains("%")) {
+ float percent = Float.parseFloat(chanel.replaceAll("[^0-9\\.]",""));
+ return (int)(255 * (percent / 100));
+ }
+ return Integer.parseInt(chanel.replaceAll("[^0-9]", ""));
+ }
+
public static float[] stringToFloatArray(String text) {
- String[] parts = text.split("\\s");
- float[] values = new float[parts.length];
- for (int i=0;i<parts.length;i++) {
- values[i] = Float.valueOf(parts[i]);
- }
-
- return values;
+ String[] parts = text.split("\\s");
+ float[] values = new float[parts.length];
+ for (int i=0;i<parts.length;i++) {
+ values[i] = Float.valueOf(parts[i]);
+ }
+
+ return values;
}
-
-
+
+
public static int[] stringToIntArray(String text) {
String[] parts = text.split("\\s");
int[] values = new int[parts.length];
for (int i=0;i<parts.length;i++) {
- values[i] = Integer.valueOf(parts[i]);
+ values[i] = Integer.valueOf(parts[i]);
}
-
+
return values;
}
}
16 years, 7 months
Seam SVN: r8054 - in trunk/examples/seamdiscs: resources/WEB-INF and 1 other directory.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-04-28 12:46:45 -0400 (Mon, 28 Apr 2008)
New Revision: 8054
Removed:
trunk/examples/seamdiscs/resources/WEB-INF/lib/
Modified:
trunk/examples/seamdiscs/build.xml
Log:
Remove a4j-trinidad.jar on Alex's advice
Modified: trunk/examples/seamdiscs/build.xml
===================================================================
--- trunk/examples/seamdiscs/build.xml 2008-04-28 16:45:49 UTC (rev 8053)
+++ trunk/examples/seamdiscs/build.xml 2008-04-28 16:46:45 UTC (rev 8054)
@@ -14,13 +14,7 @@
<property name="trinidad.lib" value="yes"/>
<import file="../build.xml"/>
-
- <property name="example.tmp.lib.dir" value="${basedir}/lib" />
- <fileset id="war.extras" dir="${resources.dir}">
- <include name="WEB-INF/lib/*.jar"/>
- </fileset>
-
<patternset id="test.resources.files">
<exclude name="import.sql" />
</patternset>
16 years, 7 months
Seam SVN: r8053 - trunk/doc/reference/en/modules.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-04-28 12:45:49 -0400 (Mon, 28 Apr 2008)
New Revision: 8053
Modified:
trunk/doc/reference/en/modules/controls.xml
Log:
Document entity converter changes
Modified: trunk/doc/reference/en/modules/controls.xml
===================================================================
--- trunk/doc/reference/en/modules/controls.xml 2008-04-28 16:00:54 UTC (rev 8052)
+++ trunk/doc/reference/en/modules/controls.xml 2008-04-28 16:45:49 UTC (rev 8053)
@@ -242,15 +242,15 @@
<entry valign="top">
<para><emphasis>Description</emphasis></para>
<para>
- Assigns an entity converter to the current component. This is primarily
+ Assigns an entity converter to the current component. This is
useful for radio button and dropdown controls.
</para>
<para>
- The converter works with any managed entity which has an <literal>@Id</literal> annotation -
- either simple or composite. The converter should be able to find the items declared in the
- JSF controls (the currently selected, and the items available for selection), otherwise
- you will receive a validation error.
+ The converter works with any managed entity - either simple or
+ composite. The converter should be able to find the items
+ declared in the JSF controls on form submission, otherwise you
+ will receive a validation error.
</para>
<para><emphasis>Attributes</emphasis></para>
@@ -262,47 +262,66 @@
<para><emphasis>Configuration</emphasis></para>
<para>
- You must use <emphasis>Seam managed transactions</emphasis> (see <xref linkend="persistence.seam-managed-transactions" />) with <literal><s:convertEntity /></literal>.
+ You must use <emphasis>Seam managed transactions</emphasis>
+ (see <xref linkend="persistence.seam-managed-transactions" />)
+ with <literal><s:convertEntity /></literal>.
</para>
<para>
- If your <emphasis>Managed Persistence Context</emphasis> isn't called
- <literal>entityManager</literal>, then you need to set it in components.xml:
+ If your <emphasis>Managed Persistence Context</emphasis> isn't
+ called <literal>entityManager</literal>, then you need to set it
+ in components.xml:
</para>
- <programlisting><![CDATA[<component name="org.jboss.seam.ui.EntityConverter">
- <property name="entityManager">#{em}</property>
-</component>]]></programlisting>
+ <programlisting><![CDATA[<components xmlns="http://jboss.com/products/seam/components"
+ xmlns:ui="http://jboss.com/products/seam/ui">
+
+ <ui:entity-loader entity-manager="#{em}" />]]></programlisting>
<para>
If you are using a <emphasis>Managed Hibernate Session</emphasis>
then you need to set it in components.xml:
</para>
- <programlisting><![CDATA[<component name="org.jboss.seam.ui.EntityConverter">
- <property name="session">#{hibernateSession}</property>
-</component>]]></programlisting>
+ <programlisting><![CDATA[<components xmlns="http://jboss.com/products/seam/components"
+ xmlns:ui="http://jboss.com/products/seam/ui">
+
+ <ui:hibernate-entity-loader />]]></programlisting>
+
+ <para>
+ If your <emphasis>Managed Hibernate Session</emphasis> isn't
+ called <literal>session</literal>, then you need to set it
+ in components.xml:
+ </para>
+
+ <programlisting><![CDATA[<components xmlns="http://jboss.com/products/seam/components"
+ xmlns:ui="http://jboss.com/products/seam/ui">
+
+ <ui:hibernate-entity-loader session="#{hibernateSession}" />]]></programlisting>
<para>
If you want to use more than one entity manager with the entity
converter, you can create a copy of the entity converter for each
- entity manager in components.xml:
+ entity manager in <literal>components.xml</literal> - note how
+ the entity converter delegates to the entity loader to perform
+ persistence operations:
</para>
- <programlisting><![CDATA[<component name="myEntityConverter" class="org.jboss.seam.ui.converter.EntityConverter">
- <property name="entityManager">#{em}</property>
-</component>]]></programlisting>
+ <programlisting><![CDATA[<components xmlns="http://jboss.com/products/seam/components"
+ xmlns:ui="http://jboss.com/products/seam/ui">
+
+ <ui:entity-converter name="standardEntityConverter" entity-loader="#{standardEntityLoader}" />
+
+ <ui:entity-loader name="standardEntityLoader" entity-manager="#{standardEntityManager}" />
+
+ <ui:entity-converter name="restrictedEntityConverter" entity-loader="#{restrictedEntityLoader}" />
+
+ <ui:entity-loader name="restrictedEntityLoader" entity-manager="#{restrictedEntityManager}" />]]></programlisting>
<programlisting><![CDATA[<h:selectOneMenu value="#{person.continent}">
<s:selectItems value="#{continents.resultList}" var="continent"
label="#{continent.name}" />
- <f:converter converterId="myEntityConverter" />
+ <f:converter converterId="standardEntityConverter" />
</h:selectOneMenu>]]></programlisting>
- <para>
- If a page uses more than one entity manager for rendering, the
- above standard reference to the converter is obligatory. Otherwise
- the converter's entity loader might show unexpected behavior.
- </para>
-
<para><emphasis>Usage</emphasis></para>
<programlisting><![CDATA[<h:selectOneMenu value="#{person.continent}" required="true">
<s:selectItems value="#{continents.resultList}" var="continent"
16 years, 7 months
Seam SVN: r8052 - branches/Seam_1_2_1_AP/seam-gen/resources/META-INF.
by seam-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2008-04-28 12:00:54 -0400 (Mon, 28 Apr 2008)
New Revision: 8052
Modified:
branches/Seam_1_2_1_AP/seam-gen/resources/META-INF/persistence-dev-war.xml
Log:
JBIDE-1544
Modified: branches/Seam_1_2_1_AP/seam-gen/resources/META-INF/persistence-dev-war.xml
===================================================================
--- branches/Seam_1_2_1_AP/seam-gen/resources/META-INF/persistence-dev-war.xml 2008-04-28 15:58:12 UTC (rev 8051)
+++ branches/Seam_1_2_1_AP/seam-gen/resources/META-INF/persistence-dev-war.xml 2008-04-28 16:00:54 UTC (rev 8052)
@@ -12,7 +12,7 @@
<property name="hibernate.hbm2ddl.auto" value="@hbm2ddl@"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.cache.use_second_level_cache" value="false"/>
- <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
+ <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>@catalogProperty@@schemaProperty@
</properties>
</persistence-unit>
16 years, 7 months
Seam SVN: r8051 - trunk/src/pdf/org/jboss/seam/pdf/ui.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-04-28 11:58:12 -0400 (Mon, 28 Apr 2008)
New Revision: 8051
Modified:
trunk/src/pdf/org/jboss/seam/pdf/ui/UICell.java
Log:
JBSEAM-2914
Modified: trunk/src/pdf/org/jboss/seam/pdf/ui/UICell.java
===================================================================
--- trunk/src/pdf/org/jboss/seam/pdf/ui/UICell.java 2008-04-28 15:05:38 UTC (rev 8050)
+++ trunk/src/pdf/org/jboss/seam/pdf/ui/UICell.java 2008-04-28 15:58:12 UTC (rev 8051)
@@ -281,6 +281,8 @@
public void handleAdd(Object o) {
if (o instanceof Phrase) {
cell.setPhrase((Phrase) o);
+ } else if (o instanceof Image) {
+ cell.setImage((Image) o);
} else if (o instanceof Element) {
// calling addElement negates setPhrase, etc...
cell.addElement((Element) o);
16 years, 7 months
Seam SVN: r8050 - in trunk: doc/reference/en/modules and 2 other directories.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-04-28 11:05:38 -0400 (Mon, 28 Apr 2008)
New Revision: 8050
Added:
trunk/extras/mail-ra.rar
Removed:
trunk/mail/
Modified:
trunk/doc/reference/en/modules/mail.xml
trunk/examples/build.xml
Log:
Move meldware to maven managed
Modified: trunk/doc/reference/en/modules/mail.xml
===================================================================
--- trunk/doc/reference/en/modules/mail.xml 2008-04-28 15:04:14 UTC (rev 8049)
+++ trunk/doc/reference/en/modules/mail.xml 2008-04-28 15:05:38 UTC (rev 8050)
@@ -328,7 +328,7 @@
<literal>mail-ra.rar</literal> — but the version distributed with
JBoss AS has a number of limitations (and isn't bundled in some versions)
therefore we recommend using the <literal>mail-ra.rar</literal>
- distributed with Seam is recommended (it's in the <literal>mail</literal>
+ distributed with Seam is recommended (it's in the <literal>extras</literal>
directory in the Seam bundle). <literal>mail-ra.rar</literal> should
be placed in <literal>$JBOSS_HOME/server/default/deploy</literal>; if the
version of JBoss AS you use already has this file, replace it.
Modified: trunk/examples/build.xml
===================================================================
--- trunk/examples/build.xml 2008-04-28 15:04:14 UTC (rev 8049)
+++ trunk/examples/build.xml 2008-04-28 15:05:38 UTC (rev 8050)
@@ -37,7 +37,7 @@
<!-- Library directories -->
<property name="lib.dir" value="${seam.dir}/lib" />
<property name="mail.dir" value="${seam.dir}/mail" />
- <property name="meldware.dir" value="${mail.dir}/buni-meldware" />
+ <property name="meldware.dir" value="${lib.dir}/meldware.deployable" />
<!-- Target directories -->
<property name="dist.dir" value="dist" />
@@ -676,7 +676,12 @@
</target>
<!-- Deploy meldware to JBoss AS -->
- <target name="meldware">
+ <target name="meldware" if="deploy.meldware.mail">
+ <copyInlineDependencies id="jbosscommoncore" scope="runtime" todir="${meldware.dir}">
+ <dependency groupId="org.buni.meldware" artifactId="mail" type="ear" version="1.0M8" />
+ <dependency groupId="org.buni.meldware" artifactId="meldware" type="store" version="1.0M8" />
+ <dependency groupId="org.buni.meldware" artifactId="meldwarebase" type="sar" version="1.0M8" />
+ </copyInlineDependencies>
<copy todir="${deploy.dir}">
<fileset dir="${meldware.dir}">
<patternset refid="meldware.files" />
Copied: trunk/extras/mail-ra.rar (from rev 8032, trunk/mail/mail-ra.rar)
===================================================================
(Binary files differ)
Property changes on: trunk/extras/mail-ra.rar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 7 months
Seam SVN: r8049 - in trunk: src/main/org/jboss/seam and 3 other directories.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-04-28 11:04:14 -0400 (Mon, 28 Apr 2008)
New Revision: 8049
Added:
trunk/src/main/org/jboss/seam/ui-2.1.xsd
trunk/ui/src/main/java/org/jboss/seam/ui/AbstractEntityLoader.java
trunk/ui/src/main/java/org/jboss/seam/ui/EntityConverter.java
trunk/ui/src/main/java/org/jboss/seam/ui/EntityIdentifierStore.java
trunk/ui/src/main/java/org/jboss/seam/ui/HibernateEntityLoader.java
trunk/ui/src/main/java/org/jboss/seam/ui/JpaEntityLoader.java
trunk/ui/src/main/java/org/jboss/seam/ui/package-info.java
Removed:
trunk/ui/src/main/java/org/jboss/seam/ui/converter/EntityConverter.java
trunk/ui/src/main/java/org/jboss/seam/ui/converter/entityConverter/
Modified:
trunk/seam21migration.txt
trunk/ui/src/main/config/component/convertEntity.xml
Log:
Move entityConverter entity manager specification around and add an xsd
Modified: trunk/seam21migration.txt
===================================================================
--- trunk/seam21migration.txt 2008-04-28 15:01:17 UTC (rev 8048)
+++ trunk/seam21migration.txt 2008-04-28 15:04:14 UTC (rev 8049)
@@ -20,4 +20,11 @@
------------------
The caught exception is now available in EL as #{org.jboss.seam.caughtException}
-rather than #{org.jboss.seam.exception}
\ No newline at end of file
+rather than #{org.jboss.seam.exception}
+
+
+EntityConverter configuration
+-----------------------------
+
+If you need to configure which entity manager to use, this is now done on the
+entity-loader component. See the documentation for details.
\ No newline at end of file
Added: trunk/src/main/org/jboss/seam/ui-2.1.xsd
===================================================================
--- trunk/src/main/org/jboss/seam/ui-2.1.xsd (rev 0)
+++ trunk/src/main/org/jboss/seam/ui-2.1.xsd 2008-04-28 15:04:14 UTC (rev 8049)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
+ targetNamespace="http://jboss.com/products/seam/ui"
+ xmlns:ui="http://jboss.com/products/seam/ui"
+ xmlns:components="http://jboss.com/products/seam/components" attributeFormDefault="unqualified">
+ <xs:import namespace="http://jboss.com/products/seam/components" schemaLocation="components-2.1.xsd"/>
+
+ <xs:element name="entity-loader">
+ <xs:complexType>
+ <xs:attributeGroup ref="components:attlist.component" />
+ <xs:attribute name="entity-manager" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="hibernate-entity-loader">
+ <xs:complexType>
+ <xs:attributeGroup ref="components:attlist.component" />
+ <xs:attribute name="session" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="entity-converter">
+ <xs:complexType>
+ <xs:attributeGroup ref="components:attlist.component" />
+ <xs:attribute name="entity-loader" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+
+</xs:schema>
Property changes on: trunk/src/main/org/jboss/seam/ui-2.1.xsd
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/ui/src/main/config/component/convertEntity.xml
===================================================================
--- trunk/ui/src/main/config/component/convertEntity.xml 2008-04-28 15:01:17 UTC (rev 8048)
+++ trunk/ui/src/main/config/component/convertEntity.xml 2008-04-28 15:04:14 UTC (rev 8049)
@@ -4,7 +4,7 @@
<converter generate="false" >
<id>org.jboss.seam.ui.EntityConverter</id>
<family>org.jboss.seam.ui.EntityConverter</family>
- <classname>org.jboss.seam.ui.converter.EntityConverter</classname>
+ <classname>org.jboss.seam.ui.EntityConverter</classname>
<description>
<![CDATA[Convert an entity.]]>
</description>
Copied: trunk/ui/src/main/java/org/jboss/seam/ui/AbstractEntityLoader.java (from rev 7958, trunk/ui/src/main/java/org/jboss/seam/ui/converter/entityConverter/AbstractEntityLoader.java)
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/AbstractEntityLoader.java (rev 0)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/AbstractEntityLoader.java 2008-04-28 15:04:14 UTC (rev 8049)
@@ -0,0 +1,58 @@
+package org.jboss.seam.ui;
+
+import static org.jboss.seam.ScopeType.STATELESS;
+
+import org.jboss.seam.Component;
+import org.jboss.seam.annotations.Transactional;
+import org.jboss.seam.framework.Identifier;
+import org.jboss.seam.framework.PersistenceController;
+
+/**
+ * Helper class to load entities for the entity converter
+ * @author Pete Muir
+ *
+ */
+
+public abstract class AbstractEntityLoader<T> extends PersistenceController<T>
+{
+
+ /**
+ * Load and return the entity stored
+ * @param key
+ * @return The entity or null if no entity is available at that key
+ */
+ @Transactional
+ public Object get(String key)
+ {
+ Identifier identifier = EntityIdentifierStore.instance().get(key);
+ if (identifier != null)
+ {
+ return identifier.find(getPersistenceContext());
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ /**
+ * Store an entity id/clazz
+ * @param entity The entity to store
+ * @return The key under which the clazz/id are stored
+ */
+ @Transactional
+ public String put(Object entity)
+ {
+ return EntityIdentifierStore.instance().put(createIdentifier(entity), entity);
+ }
+
+ protected abstract Identifier createIdentifier(Object entity);
+
+ public abstract void validate();
+
+ public static AbstractEntityLoader instance()
+ {
+ return (AbstractEntityLoader) Component.getInstance("org.jboss.seam.ui.entityLoader", STATELESS);
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/ui/src/main/java/org/jboss/seam/ui/AbstractEntityLoader.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/ui/src/main/java/org/jboss/seam/ui/EntityConverter.java (from rev 7958, trunk/ui/src/main/java/org/jboss/seam/ui/converter/EntityConverter.java)
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/EntityConverter.java (rev 0)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/EntityConverter.java 2008-04-28 15:04:14 UTC (rev 8049)
@@ -0,0 +1,83 @@
+package org.jboss.seam.ui;
+
+import static org.jboss.seam.ScopeType.CONVERSATION;
+import static org.jboss.seam.annotations.Install.BUILT_IN;
+
+import java.io.Serializable;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.ConverterException;
+
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Install;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.Transactional;
+import org.jboss.seam.annotations.intercept.BypassInterceptors;
+import org.jboss.seam.annotations.faces.Converter;
+
+/**
+ * Allows conversion of an entity to/from a key which can be written to a page.
+ *
+ * Support is provided for JPA (by default) and Hibernate (with the session
+ * specified in components.xml)
+ */
+@Name("org.jboss.seam.ui.EntityConverter")
+@Scope(CONVERSATION)
+@Install(precedence = BUILT_IN)
+@Converter
+@BypassInterceptors
+public class EntityConverter implements
+ javax.faces.convert.Converter, Serializable
+{
+
+ private AbstractEntityLoader entityLoader;
+
+ public AbstractEntityLoader getEntityLoader()
+ {
+ return entityLoader;
+ }
+
+ public void setEntityLoader(AbstractEntityLoader entityLoader)
+ {
+ this.entityLoader = entityLoader;
+ }
+
+ @Create
+ public void create()
+ {
+ if (entityLoader == null)
+ {
+ entityLoader = AbstractEntityLoader.instance();
+ }
+ entityLoader.validate();
+ }
+
+ @SuppressWarnings("unchecked")
+ @Transactional
+ public String getAsString(FacesContext facesContext, UIComponent cmp, Object value) throws ConverterException
+ {
+ if (value == null)
+ {
+ return null;
+ }
+ if (value instanceof String)
+ {
+ return (String) value;
+ }
+ return entityLoader.put(value);
+ }
+
+
+ @Transactional
+ public Object getAsObject(FacesContext facesContext, UIComponent cmp, String value) throws ConverterException
+ {
+ if (value == null)
+ {
+ return null;
+ }
+ return entityLoader.get(value);
+ }
+
+}
Property changes on: trunk/ui/src/main/java/org/jboss/seam/ui/EntityConverter.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/ui/src/main/java/org/jboss/seam/ui/EntityIdentifierStore.java (from rev 7958, trunk/ui/src/main/java/org/jboss/seam/ui/converter/entityConverter/EntityIdentifierStore.java)
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/EntityIdentifierStore.java (rev 0)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/EntityIdentifierStore.java 2008-04-28 15:04:14 UTC (rev 8049)
@@ -0,0 +1,72 @@
+package org.jboss.seam.ui;
+
+import static org.jboss.seam.ScopeType.PAGE;
+import static org.jboss.seam.annotations.Install.BUILT_IN;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.seam.Component;
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Install;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.core.AbstractMutable;
+import org.jboss.seam.framework.Identifier;
+
+/**
+ * Page scoped store for entity identifiers used by the EntityConverter.
+ *
+ * By default a list is used and the key returned is the list index. The key
+ * used can be customised by overriding this component and implementing the
+ * get and put methods
+ *
+ * @author Pete Muir
+ *
+ */
+@Name("org.jboss.seam.ui.entityIdentifierStore")
+@Install(precedence=BUILT_IN)
+@Scope(PAGE)
+public class EntityIdentifierStore extends AbstractMutable
+{
+
+ private List<Identifier> store;
+
+ @Create
+ public void create()
+ {
+ store = new ArrayList<Identifier>();
+ }
+
+ public Identifier get(String key)
+ {
+ try
+ {
+ return store.get(new Integer(key));
+ }
+ catch (IndexOutOfBoundsException e)
+ {
+ return null;
+ }
+ }
+
+ public String put(Identifier identifier, Object entity)
+ {
+ if (!store.contains(identifier))
+ {
+ store.add(identifier);
+ setDirty();
+ }
+ return ((Integer) store.indexOf(identifier)).toString();
+ }
+
+ public static EntityIdentifierStore instance()
+ {
+ if (!Contexts.isPageContextActive())
+ {
+ throw new IllegalArgumentException("Page scope not active");
+ }
+ return (EntityIdentifierStore) Component.getInstance(EntityIdentifierStore.class, PAGE);
+ }
+}
Property changes on: trunk/ui/src/main/java/org/jboss/seam/ui/EntityIdentifierStore.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/ui/src/main/java/org/jboss/seam/ui/HibernateEntityLoader.java (from rev 7958, trunk/ui/src/main/java/org/jboss/seam/ui/converter/entityConverter/HibernateEntityLoader.java)
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/HibernateEntityLoader.java (rev 0)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/HibernateEntityLoader.java 2008-04-28 15:04:14 UTC (rev 8049)
@@ -0,0 +1,57 @@
+package org.jboss.seam.ui;
+
+import static org.jboss.seam.ScopeType.STATELESS;
+import static org.jboss.seam.annotations.Install.FRAMEWORK;
+
+import org.hibernate.Session;
+import org.jboss.seam.annotations.Install;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.framework.HibernateEntityIdentifier;
+import org.jboss.seam.framework.Identifier;
+
+/**
+ * Stores entity identifiers under a key, which can be used on a page
+ *
+ * @author Pete Muir
+ */
+
+@Name("org.jboss.seam.ui.entityLoader")
+@Install(precedence=FRAMEWORK, classDependencies="org.hibernate.Session", value=false)
+@Scope(STATELESS)
+public class HibernateEntityLoader extends AbstractEntityLoader<Session>
+{
+
+ @Override
+ protected Identifier createIdentifier(Object entity)
+ {
+ return new HibernateEntityIdentifier(entity, getPersistenceContext());
+ }
+
+ @Override
+ protected String getPersistenceContextName()
+ {
+ return "session";
+ }
+
+ @Override
+ public void validate()
+ {
+ if (getPersistenceContext() == null)
+ {
+ throw new IllegalStateException("Unable to access a Seam Managed Hibernate Session. You must either have a Seam Managed Hibernate Session called session or configure one in components.xml");
+ }
+
+ }
+
+ public Session getSession()
+ {
+ return getPersistenceContext();
+ }
+
+ public void setSession(Session session)
+ {
+ setPersistenceContext(session);
+ }
+
+}
Property changes on: trunk/ui/src/main/java/org/jboss/seam/ui/HibernateEntityLoader.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/ui/src/main/java/org/jboss/seam/ui/JpaEntityLoader.java (from rev 7958, trunk/ui/src/main/java/org/jboss/seam/ui/converter/entityConverter/EntityLoader.java)
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/JpaEntityLoader.java (rev 0)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/JpaEntityLoader.java 2008-04-28 15:04:14 UTC (rev 8049)
@@ -0,0 +1,58 @@
+package org.jboss.seam.ui;
+
+import static org.jboss.seam.ScopeType.STATELESS;
+import static org.jboss.seam.annotations.Install.BUILT_IN;
+
+import javax.persistence.EntityManager;
+
+import org.jboss.seam.annotations.Install;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.framework.EntityIdentifier;
+import org.jboss.seam.framework.Identifier;
+
+/**
+ * Stores entity identifiers under a key, which can be used on a page
+ *
+ * @author Pete Muir
+ */
+
+@Name("org.jboss.seam.ui.entityLoader")
+@Install(precedence=BUILT_IN, value=true, classDependencies="javax.persistence.EntityManager")
+@Scope(STATELESS)
+public class JpaEntityLoader extends AbstractEntityLoader<EntityManager>
+{
+
+ @Override
+ protected Identifier createIdentifier(Object entity)
+ {
+ return new EntityIdentifier(entity, getPersistenceContext());
+ }
+
+ @Override
+ protected String getPersistenceContextName()
+ {
+ return "entityManager";
+ }
+
+ @Override
+ public void validate()
+ {
+ if (getPersistenceContext() == null)
+ {
+ throw new IllegalStateException("Unable to access a persistence context. You must either have a SMPC called entityManager or configure one in components.xml");
+ }
+
+ }
+
+ public EntityManager getEntityManager()
+ {
+ return getPersistenceContext();
+ }
+
+ public void setEntityManager(EntityManager entityManager)
+ {
+ setPersistenceContext(entityManager);
+ }
+
+}
Property changes on: trunk/ui/src/main/java/org/jboss/seam/ui/JpaEntityLoader.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Deleted: trunk/ui/src/main/java/org/jboss/seam/ui/converter/EntityConverter.java
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/converter/EntityConverter.java 2008-04-28 15:01:17 UTC (rev 8048)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/converter/EntityConverter.java 2008-04-28 15:04:14 UTC (rev 8049)
@@ -1,125 +0,0 @@
-package org.jboss.seam.ui.converter;
-
-import static org.jboss.seam.ScopeType.CONVERSATION;
-import static org.jboss.seam.annotations.Install.BUILT_IN;
-
-import java.io.Serializable;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.ConverterException;
-
-import org.jboss.seam.annotations.Create;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.Transactional;
-import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.annotations.faces.Converter;
-import org.jboss.seam.core.Expressions.ValueExpression;
-import org.jboss.seam.ui.converter.entityConverter.EntityLoader;
-import org.jboss.seam.ui.converter.entityConverter.HibernateEntityLoader;
-import org.jboss.seam.ui.converter.entityConverter.AbstractEntityLoader;
-
-/**
- * Allows conversion of an entity to/from a key which can be written to a page.
- *
- * Support is provided for JPA (by default) and Hibernate (with the session
- * specified in components.xml)
- */
-@Name("org.jboss.seam.ui.EntityConverter")
-@Scope(CONVERSATION)
-@Install(precedence = BUILT_IN)
-@Converter
-@BypassInterceptors
-public class EntityConverter implements
- javax.faces.convert.Converter, Serializable
-{
-
- private ValueExpression entityManager;
- private ValueExpression session;
- private AbstractEntityLoader store;
-
- @Create
- public void create()
- {
- if (getEntityManager() == null && getSession() != null)
- {
- store = HibernateEntityLoader.instance();
- }
- else
- {
- store = EntityLoader.instance();
- }
- }
-
- private void init()
- {
- if (getPersistenceContext() != null)
- {
- store.setPersistenceContext(getPersistenceContext().getValue());
- }
- store.validate();
- }
-
- @SuppressWarnings("unchecked")
- @Transactional
- public String getAsString(FacesContext facesContext, UIComponent cmp, Object value) throws ConverterException
- {
- init();
- if (value == null)
- {
- return null;
- }
- if (value instanceof String)
- {
- return (String) value;
- }
- return store.put(value);
- }
-
-
- @Transactional
- public Object getAsObject(FacesContext facesContext, UIComponent cmp, String value) throws ConverterException
- {
- init();
- if (value == null)
- {
- return null;
- }
- return store.get(value);
- }
-
- public ValueExpression getEntityManager()
- {
- return entityManager;
- }
-
- public void setEntityManager(ValueExpression entityManager)
- {
- this.entityManager = entityManager;
- }
-
- public ValueExpression getSession()
- {
- return session;
- }
-
- public void setSession(ValueExpression session)
- {
- this.session = session;
- }
-
- private ValueExpression getPersistenceContext()
- {
- if (getEntityManager() != null)
- {
- return getEntityManager();
- }
- else
- {
- return getSession();
- }
- }
-
-}
\ No newline at end of file
Added: trunk/ui/src/main/java/org/jboss/seam/ui/package-info.java
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/package-info.java (rev 0)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/package-info.java 2008-04-28 15:04:14 UTC (rev 8049)
@@ -0,0 +1,10 @@
+/**
+ * Seam UI
+ *
+ */
+@Namespace(value="http://jboss.com/products/seam/ui", prefix="org.jboss.seam.ui")
+@AutoCreate
+package org.jboss.seam.ui;
+
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Namespace;
Property changes on: trunk/ui/src/main/java/org/jboss/seam/ui/package-info.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 7 months