Seam SVN: r13842 - in modules/xml/trunk/impl/src: main/java/org/jboss/seam/xml/parser/namespace and 2 other directories.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-10-13 07:03:17 -0400 (Wed, 13 Oct 2010)
New Revision: 13842
Added:
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/util/PropertyUtils.java
Modified:
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/parser/namespace/PackageNamespaceElementResolver.java
modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/fieldset/FieldValueBean.java
modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/fieldset/SetFieldValueBeanTest.java
Log:
more work and tests for property accessibility
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java 2010-10-13 10:43:35 UTC (rev 13841)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java 2010-10-13 11:03:17 UTC (rev 13842)
@@ -38,6 +38,7 @@
import org.jboss.seam.xml.core.BeanResultType;
import org.jboss.seam.xml.core.VirtualProducerField;
import org.jboss.seam.xml.fieldset.FieldValueObject;
+import org.jboss.seam.xml.util.PropertyUtils;
import org.jboss.seam.xml.util.TypeOccuranceInformation;
import org.jboss.seam.xml.util.XmlConfigurationException;
import org.jboss.weld.extensions.literal.InjectLiteral;
@@ -81,6 +82,7 @@
Property<Object> property = query.getFirstResult();
if (property != null)
{
+ PropertyUtils.setAccessible(property);
values.add(new PropertyXmlItem(this, property, e.getValue(), null, document, lineno));
}
else
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/parser/namespace/PackageNamespaceElementResolver.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/parser/namespace/PackageNamespaceElementResolver.java 2010-10-13 10:43:35 UTC (rev 13841)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/parser/namespace/PackageNamespaceElementResolver.java 2010-10-13 11:03:17 UTC (rev 13842)
@@ -21,9 +21,6 @@
*/
package org.jboss.seam.xml.parser.namespace;
-import java.lang.reflect.Field;
-import java.lang.reflect.Member;
-import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@@ -37,6 +34,7 @@
import org.jboss.seam.xml.model.XmlItem;
import org.jboss.seam.xml.model.XmlItemType;
import org.jboss.seam.xml.parser.SaxNode;
+import org.jboss.seam.xml.util.PropertyUtils;
import org.jboss.seam.xml.util.TypeOccuranceInformation;
import org.jboss.seam.xml.util.XmlConfigurationException;
import org.jboss.weld.extensions.properties.Property;
@@ -141,18 +139,7 @@
else if (property != null)
{
// ensure the property is accessible
- Member member = property.getMember();
- if (member instanceof Field)
- {
- Field field = (Field) member;
- field.setAccessible(true);
- }
- else if (member instanceof Method)
- {
- Method method = (Method) member;
- method.setAccessible(true);
- }
-
+ PropertyUtils.setAccessible(property);
return new PropertyXmlItem(parent, property, innerText, null, document, lineno);
}
return null;
Added: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/util/PropertyUtils.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/util/PropertyUtils.java (rev 0)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/util/PropertyUtils.java 2010-10-13 11:03:17 UTC (rev 13842)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.xml.util;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Member;
+import java.lang.reflect.Method;
+
+import org.jboss.weld.extensions.properties.Property;
+
+public class PropertyUtils
+{
+ private PropertyUtils()
+ {
+
+ }
+
+ public static <V> void setAccessible(Property<V> property)
+ {
+ Member member = property.getMember();
+ if (member instanceof Field)
+ {
+ Field field = (Field) member;
+ field.setAccessible(true);
+ }
+ else if (member instanceof Method)
+ {
+ Method method = (Method) member;
+ method.setAccessible(true);
+ }
+ }
+
+}
Modified: modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/fieldset/FieldValueBean.java
===================================================================
--- modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/fieldset/FieldValueBean.java 2010-10-13 10:43:35 UTC (rev 13841)
+++ modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/fieldset/FieldValueBean.java 2010-10-13 11:03:17 UTC (rev 13842)
@@ -45,8 +45,13 @@
public double dvalue = 1;
- public BigDecimal bigDecimalValue;
+ private BigDecimal bigDecimalValue;
+ public BigDecimal readBigDecimalValue()
+ {
+ return bigDecimalValue;
+ }
+
public short svalue;
public long lvalue;
Modified: modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/fieldset/SetFieldValueBeanTest.java
===================================================================
--- modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/fieldset/SetFieldValueBeanTest.java 2010-10-13 10:43:35 UTC (rev 13841)
+++ modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/fieldset/SetFieldValueBeanTest.java 2010-10-13 11:03:17 UTC (rev 13842)
@@ -44,7 +44,7 @@
public void simpleFieldSetterTest()
{
FieldValueBean x = getReference(FieldValueBean.class);
- Assert.assertTrue(x.bigDecimalValue.compareTo(BigDecimal.TEN) == 0);
+ Assert.assertTrue(x.readBigDecimalValue().compareTo(BigDecimal.TEN) == 0);
Assert.assertTrue(x.bvalue == true);
Assert.assertTrue(x.dvalue == 0);
Assert.assertTrue(x.enumValue == QualifierEnum.A);
@@ -63,7 +63,7 @@
FieldValueBean x = getReference(FieldValueBean.class, new AnnotationLiteral<FieldsetQualifier>()
{
});
- Assert.assertTrue(x.bigDecimalValue.compareTo(BigDecimal.TEN) == 0);
+ Assert.assertTrue(x.readBigDecimalValue().compareTo(BigDecimal.TEN) == 0);
Assert.assertTrue(x.bvalue == true);
Assert.assertTrue(x.dvalue == 0);
Assert.assertTrue(x.enumValue == QualifierEnum.A);
14 years, 2 months
Seam SVN: r13841 - modules/xml/trunk/docs/src/main/docbook/en-US.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-10-13 06:43:35 -0400 (Wed, 13 Oct 2010)
New Revision: 13841
Modified:
modules/xml/trunk/docs/src/main/docbook/en-US/xml-introduction.xml
Log:
format introduction
Modified: modules/xml/trunk/docs/src/main/docbook/en-US/xml-introduction.xml
===================================================================
--- modules/xml/trunk/docs/src/main/docbook/en-US/xml-introduction.xml 2010-10-13 10:39:47 UTC (rev 13840)
+++ modules/xml/trunk/docs/src/main/docbook/en-US/xml-introduction.xml 2010-10-13 10:43:35 UTC (rev 13841)
@@ -2,85 +2,102 @@
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<chapter id="introduction">
- <title>Seam XML Introduction</title>
-
- <para>Seam provides a method for configuring JSR-299 beans using XML. Using XML it is possible to add new beans, override existing beans, and add
- extra configuration to existing beans. The default is to add a new bean.
+ <title>Seam XML Introduction</title>
+
+ <para>
+ Seam provides a method for configuring JSR-299 beans using XML. Using XML
+ it is possible to add new beans, override existing beans, and add
+ extra configuration to existing beans. The default is to add a new
+ bean.
</para>
-
- <section>
- <title>Getting Started</title>
- <para>No special configuration is required, all that is required is to include the jar file and the weld extensions jar in your deployment. </para>
- <para>The first thing we need is some xml files, by default these are discovered from the classpath in the following locations:</para>
- <itemizedlist>
- <listitem><literal>/META-INF/beans.xml</literal></listitem>
- <listitem><literal>/WEB-INF/classes/seam-beans.xml</literal></listitem>
- <listitem><literal>/META-INF/seam-beans.xml</literal></listitem>
- <listitem><literal>/seam-beans.xml</literal></listitem>
- </itemizedlist>
- <warning>
- <para>It is currently not possible to load beans.xml from WEB-INF. This will be addressed before the final release of seam-xml.</para>
- </warning>
- <para>The <literal>beans.xml</literal> file is the preferred way of configuring beans via XML, however it may be possible that some JSR-299 implementations will not allow this,
- so <literal>seam-beans.xml</literal> is provided as an alternative. </para>
-
- <para>Let's start with a simple example. Say we have the following class that represents a report:</para>
- <programlisting role="JAVA"><![CDATA[
-public class Report
-{
+ <section>
+ <title>Getting Started</title>
+ <para>No special configuration is required, all that is required
+ is to include the jar file and the weld extensions jar in your
+ deployment. </para>
+ <para>The first thing we need is some xml files, by default these
+ are discovered from the classpath in the following locations:</para>
+ <itemizedlist>
+ <listitem>
+ <literal>/META-INF/beans.xml</literal>
+ </listitem>
+ <listitem>
+ <literal>/WEB-INF/beans.xml</literal>
+ </listitem>
+ <listitem>
+ <literal>/WEB-INF/seam-beans.xml</literal>
+ </listitem>
+ <listitem>
+ <literal>/META-INF/seam-beans.xml</literal>
+ </listitem>
+ </itemizedlist>
+
+ <para>
+ The <literal>beans.xml</literal> file is the preferred way of
+ configuring beans via XML, however it may be possible that
+ some JSR-299 implementations will not allow this, so
+ <literal>seam-beans.xml</literal> is provided as an alternative.
+ </para>
+
+ <para>
+ Let's start with a simple example. Say we have the following
+ class that represents a report:
+ </para>
+ <programlisting role="JAVA"><![CDATA[class Report {
String filename;
@Inject
Datasource datasource;
//getters and setters
-}
-]]></programlisting>
- <para>And the following support classes:</para>
- <programlisting role="JAVA">
- <![CDATA[
-public interface Datasource
-{
+}]]></programlisting>
+
+ <para>
+ And the following support classes:
+ </para>
+ <programlisting role="JAVA">
+ <![CDATA[interface Datasource {
public Data getData();
}
@SalesQualifier
-public class SalesDatasource implements Datasource
-{
+class SalesDatasource implements Datasource {
public Data getData()
{
//return sales data
}
}
-public class BillingDatasource implements Datasource
-{
+class BillingDatasource implements Datasource {
public Data getData()
{
//return billing data
}
-}
+}]]></programlisting>
-]]>
- </programlisting>
-
- <para>Our <literal>Report</literal> bean is fairly simple. It has a filename that tells the report engine where to load the report definition from, and a datasource that provides the data used to
- fill the report. We are going to configure up multiple <literal>Report</literal> beans via xml.</para>
- <programlistingco>
- <areaspec>
- <area id="namepsace-declaration-seam" coords="6"/>
- <area id="namepsace-declaration-reports" coords="7"/>
- <area id="resport-dec" coords="9"/>
- <area id="specializes" coords="10"/>
- <area id="filename" coords="11"/>
- <area id="datasource-qualifier" coords="13"/>
- <area id="filename-short" coords="17"/>
- <area id="replaces" coords="18"/>
- <area id="inject" coords="20"/>
- <area id="datasource-type" coords="21"/>
- </areaspec>
- <programlisting role="XML">
+ <para>
+ Our <code>Report</code> bean is fairly simple. It has a
+ filename that tells the report engine where to load the
+ report definition from, and a datasource that provides
+ the data used to fill the report. We are going to
+ configure up multiple <literal>Report</literal>
+ beans via xml.
+ </para>
+ <programlistingco>
+ <areaspec>
+ <area id="namepsace-declaration-seam" coords="6" />
+ <area id="namepsace-declaration-reports" coords="7" />
+ <area id="resport-dec" coords="9" />
+ <area id="specializes" coords="10" />
+ <area id="filename" coords="11" />
+ <area id="datasource-qualifier" coords="13" />
+ <area id="filename-short" coords="17" />
+ <area id="replaces" coords="18" />
+ <area id="inject" coords="20" />
+ <area id="datasource-type" coords="21" />
+ </areaspec>
+ <programlisting role="XML">
<![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee"
@@ -105,54 +122,106 @@
</r:Report>
</beans>
]]>
- </programlisting>
- <calloutlist>
- <callout arearefs="namepsace-declaration-seam">
- <para>The namespace <literal>urn:java:ee</literal> is seam-xml's root namespace. This is where the builtin tags and CDI annotations live.</para>
- </callout>
- <callout arearefs="namepsace-declaration-reports">
- <para>The namespace <literal>urn:java:org.example.reports</literal> corresponds to the package <literal>org.example.reports</literal>, where our reporting classes live.</para>
- </callout>
- <callout arearefs="resport-dec">
- <para>The <literal><Report></literal> declaration configures an instance of our <literal>Report</literal> class as a bean.</para>
- </callout>
- <callout arearefs="specializes">
- <para>Beans installed using <literal><s:specializes></literal> read annotations from the existing class, and merge them with the annotations defined via xml.
- In addition if a bean is installed with <literal><s:specializes></literal> it prevents the original class being installed as a bean.</para>
- </callout>
- <callout arearefs="filename">
- <para>The <literal><r:filename></literal> element sets the initial value of the filename field.</para>
- </callout>
- <callout arearefs="datasource-qualifier">
- <para>The <literal><r:SalesQualifier></literal> element applies the <literal>@SalesQualifier</literal> to the <literal>datasource</literal> field.
- As the field already has an <literal>@Inject</literal> on the class definition this will cause the <literal>SalesDatasource</literal>
- bean to be injected.</para>
- </callout>
- <callout arearefs="filename-short">
- <para>This is the shorthand syntax for setting a field value.</para>
- </callout>
- <callout arearefs="replaces">
- <para>Beans installed using <literal><s:replaces></literal> do not read annotations from the existing class. In addition if a bean is installed with
- <literal><s:replaces></literal> it prevents the original class being installed as a bean.</para>
- </callout>
- <callout arearefs="inject">
- <para>The <literal><s:Inject></literal> element is needed this bean was installed with <literal><s:replaces></literal>, so annotations are not read
- from the class definition.</para>
- </callout>
- <callout arearefs="datasource-type">
- <para>The <literal><s:Eact></literal> annotation restricts the type of bean that is availible for injection without using qualifiers. In this case
- <literal>BillingDatasource</literal> will be injected. This is provided as part of weld-extensions.</para>
- </callout>
-
- </calloutlist>
- </programlistingco>
-
- </section>
- <section>
- <title>The Princess Rescue Example</title>
-
- </section>
-<!--
+ </programlisting>
+ <calloutlist>
+
+ <callout arearefs="namepsace-declaration-seam">
+ <para>
+ The namespace <literal>urn:java:ee</literal>
+ is seam-xml's root namespace. This is where the
+ builtin tags and CDI annotations live.
+ </para>
+ </callout>
+
+ <callout arearefs="namepsace-declaration-reports">
+ <para>
+ The namespace <literal>urn:java:org.example.reports</literal>
+ corresponds to the package <literal>org.example.reports</literal>,
+ where our reporting classes live. Multiple java packages can be aggregated
+ into a single namespace declaration by selerating the package names
+ with colons, e.g.
+ <literal>urn:java:org.example.reports:org.example.model</literal>
+ </para>
+ </callout>
+
+ <callout arearefs="resport-dec">
+ <para>
+ The <literal><Report></literal> declaration configures an
+ instance of our <literal>Report</literal> class as a bean.
+ </para>
+ </callout>
+
+ <callout arearefs="specializes">
+ <para>
+ Beans installed using <literal><s:specializes></literal>
+ read annotations from the existing class, and merge them with
+ the annotations defined via xml. In addition if a bean is
+ installed with <literal><s:specializes></literal>
+ it prevents the original class being installed as a bean.
+ </para>
+ </callout>
+
+ <callout arearefs="filename">
+ <para>
+ The <literal><r:filename></literal> element sets the
+ initial value of the filename field.
+ </para>
+ </callout>
+
+ <callout arearefs="datasource-qualifier">
+ <para>
+ The <literal><r:SalesQualifier></literal> element applies
+ the <literal>@SalesQualifier</literal> to the
+ <literal>datasource</literal> field. As the field already has an
+ <literal>@Inject</literal> on the class definition this will cause
+ the <literal>SalesDatasource</literal> bean to be injected.
+ </para>
+ </callout>
+
+ <callout arearefs="filename-short">
+ <para>
+ This is the shorthand syntax for setting a field
+ value.
+ </para>
+ </callout>
+
+ <callout arearefs="replaces">
+ <para>
+ Beans installed using <literal><s:replaces></literal>
+ do not read annotations from the existing class. In addition if
+ a bean is installed with <literal><s:replaces></literal>
+ it prevents the original class being installed as a bean.
+ </para>
+ </callout>
+
+ <callout arearefs="inject">
+ <para>
+ The <literal><s:Inject></literal> element is needed this
+ bean was installed with <literal><s:replaces></literal>,
+ so annotations are not read from the class definition.
+ </para>
+ </callout>
+
+ <callout arearefs="datasource-type">
+ <para>
+ The <literal><s:Exact></literal> annotation restricts the
+ type of bean that is availible for injection without using
+ qualifiers. In this case <literal>BillingDatasource</literal>
+ will be injected. This is provided as part of weld-extensions.
+ </para>
+ </callout>
+
+ </calloutlist>
+ </programlistingco>
+
+ </section>
+ <section>
+ <title>The Princess Rescue Example</title>
+ <para>
+ TODO
+ </para>
+ </section>
+ <!--
vim:et:ts=3:sw=3:tw=120
--->
+-->
</chapter>
14 years, 2 months
Seam SVN: r13840 - in modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml: parser/namespace and 1 other directory.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-10-13 06:39:47 -0400 (Wed, 13 Oct 2010)
New Revision: 13840
Modified:
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/parser/namespace/PackageNamespaceElementResolver.java
Log:
ensure fields are accessible when setting field values
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java 2010-10-13 10:22:34 UTC (rev 13839)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java 2010-10-13 10:39:47 UTC (rev 13840)
@@ -226,6 +226,7 @@
throw new XmlConfigurationException("A virtual producer field may not containe <override> or <extend> tags", getDocument(), getLineno());
}
Field member = org.jboss.seam.xml.util.Reflections.getField(VirtualProducerField.class, "field");
+ member.setAccessible(true);
ClassXmlItem vclass = new ClassXmlItem(null, VirtualProducerField.class, Collections.<String, String> emptyMap(), document, lineno);
PropertyXmlItem field = new PropertyXmlItem(vclass, Properties.createProperty(member), null, getJavaClass(), document, lineno);
vclass.addChild(field);
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/parser/namespace/PackageNamespaceElementResolver.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/parser/namespace/PackageNamespaceElementResolver.java 2010-10-13 10:22:34 UTC (rev 13839)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/parser/namespace/PackageNamespaceElementResolver.java 2010-10-13 10:39:47 UTC (rev 13840)
@@ -21,6 +21,9 @@
*/
package org.jboss.seam.xml.parser.namespace;
+import java.lang.reflect.Field;
+import java.lang.reflect.Member;
+import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@@ -137,6 +140,19 @@
}
else if (property != null)
{
+ // ensure the property is accessible
+ Member member = property.getMember();
+ if (member instanceof Field)
+ {
+ Field field = (Field) member;
+ field.setAccessible(true);
+ }
+ else if (member instanceof Method)
+ {
+ Method method = (Method) member;
+ method.setAccessible(true);
+ }
+
return new PropertyXmlItem(parent, property, innerText, null, document, lineno);
}
return null;
14 years, 2 months
Seam SVN: r13839 - in modules/persistence/trunk: api and 1 other directories.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-10-13 06:22:34 -0400 (Wed, 13 Oct 2010)
New Revision: 13839
Modified:
modules/persistence/trunk/api/pom.xml
modules/persistence/trunk/impl/pom.xml
modules/persistence/trunk/pom.xml
Log:
clean up poms
Modified: modules/persistence/trunk/api/pom.xml
===================================================================
--- modules/persistence/trunk/api/pom.xml 2010-10-13 10:22:06 UTC (rev 13838)
+++ modules/persistence/trunk/api/pom.xml 2010-10-13 10:22:34 UTC (rev 13839)
@@ -20,21 +20,24 @@
<dependencies>
<dependency>
- <groupId>javax.enterprise</groupId>
- <artifactId>cdi-api</artifactId>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
</dependency>
+
<dependency>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
- <scope>provided</scope>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ <scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.jboss.spec</groupId>
- <artifactId>jboss-javaee-6.0</artifactId>
- <type>pom</type>
- <scope>provided</scope>
- </dependency>
- <dependency>
+
+ <dependency>
+ <groupId>org.jboss.spec</groupId>
+ <artifactId>jboss-javaee-6.0</artifactId>
+ <type>pom</type>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<optional>true</optional>
Modified: modules/persistence/trunk/impl/pom.xml
===================================================================
--- modules/persistence/trunk/impl/pom.xml 2010-10-13 10:22:06 UTC (rev 13838)
+++ modules/persistence/trunk/impl/pom.xml 2010-10-13 10:22:34 UTC (rev 13839)
@@ -107,7 +107,6 @@
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-extensions</artifactId>
- <version>1.0.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
Modified: modules/persistence/trunk/pom.xml
===================================================================
--- modules/persistence/trunk/pom.xml 2010-10-13 10:22:06 UTC (rev 13838)
+++ modules/persistence/trunk/pom.xml 2010-10-13 10:22:34 UTC (rev 13839)
@@ -48,6 +48,7 @@
<weld.version>1.1.0.Beta1</weld.version>
<hsqldb.version>1.8.0.10</hsqldb.version>
<openjpa.version>2.0.0</openjpa.version>
+ <seam.xml.version>3.0.0-SNAPSHOT</seam.xml.version>
</properties>
<dependencyManagement>
@@ -92,7 +93,7 @@
<dependency>
<groupId>org.jboss.seam.xml</groupId>
<artifactId>seam-xml-config</artifactId>
- <version>${project.version}</version>
+ <version>${seam.xml.version}</version>
</dependency>
<dependency>
14 years, 2 months
Seam SVN: r13838 - modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-10-13 06:22:06 -0400 (Wed, 13 Oct 2010)
New Revision: 13838
Modified:
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/SeSynchronizations.java
Log:
minor
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/SeSynchronizations.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/SeSynchronizations.java 2010-10-13 10:14:22 UTC (rev 13837)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/SeSynchronizations.java 2010-10-13 10:22:06 UTC (rev 13838)
@@ -35,7 +35,6 @@
* is not fully aware of container managed transaction lifecycle, and is not
* able to register Synchronizations with a container managed transaction.
*
- * This is an alternative, and as such must be enabled in beans.xml.
*
* @author Gavin King
* @author Stuart Douglas
14 years, 2 months
Seam SVN: r13837 - modules/persistence/trunk/docs/src/main/docbook/en-US.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-10-13 06:14:22 -0400 (Wed, 13 Oct 2010)
New Revision: 13837
Modified:
modules/persistence/trunk/docs/src/main/docbook/en-US/persistence-general.xml
Log:
update documentation
Modified: modules/persistence/trunk/docs/src/main/docbook/en-US/persistence-general.xml
===================================================================
--- modules/persistence/trunk/docs/src/main/docbook/en-US/persistence-general.xml 2010-10-13 08:26:08 UTC (rev 13836)
+++ modules/persistence/trunk/docs/src/main/docbook/en-US/persistence-general.xml 2010-10-13 10:14:22 UTC (rev 13837)
@@ -79,6 +79,54 @@
</section>
+ <section>
+ <title>Getting Started</title>
+
+ <para>
+ To get started with Seam persistence you need to add the
+ <literal>seam-persistence.jar </literal> and the
+ <literal>weld-extensions.jar</literal> to you deployment. If you are in
+ a java SE environment you will probably also require
+ <literal>seam-xml.jar</literal> as well for configuration purposes. The
+ relevant maven configuration is as follows:
+ </para>
+<programlisting role="XML><![CDATA[<dependency>
+ <groupId>org.jboss.seam.persistence</groupId>
+ <artifactId>seam-persistence-api</artifactId>
+ <version>${seam.persistence.version}</version>
+</dependency>
+
+<dependency>
+ <groupId>org.jboss.seam.persistence</groupId>
+ <artifactId>seam-persistence-impl</artifactId>
+ <version>${seam.persistence.version}</version>
+</dependency>
+
+<dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-extensions</artifactId>
+ <version>${weld.extensions.version}</version>
+</dependency>
+
+<dependency>
+ <groupId>org.jboss.seam.xml</groupId>
+ <artifactId>seam-xml-config</artifactId>
+ <version>${seam.xml.version}</version>
+</dependency>
+]]></programlisting>
+
+ <para>
+ You will also need to have a JPA provider on the classpath. If you are
+ using java EE this is taken care of for you. If not, we recommend hibernate.
+ </para>
+
+<programlisting role="XML><![CDATA[<dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <version>3.5.1-Final</version>
+</dependency>]]></programlisting>
+ </section>
+
<section id="persistence.transactions" >
<title>Transaction Management</title>
@@ -92,11 +140,24 @@
<section>
<title>Configuration</title>
<para>
- If you are in an EE 6 environment then no configuration is necessary,
- simply drop the seam-persistence jar into your app and you are ready
- to go.
+ In order to enable declarative transaction management for managed beans
+ you need to list the transaction interceptor in beans.xml:
</para>
+ <programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://docs.jboss.org/cdi/beans_1_0.xsd">
+ <interceptors>
+ <class>org.jboss.seam.persistence.transaction.TransactionInterceptor</class>
+ </interceptors>
+</beans>]]></programlisting>
<para>
+ If you are in a Java EE 6 environment then you are good to go,
+ no additional configuration is required.
+ </para>
+ <para>
If you are not in an EE environment you may need to configure some
things with seam-xml. You may need the following entries in your
beans.xml file:
14 years, 2 months
Seam SVN: r13836 - modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-10-13 04:26:08 -0400 (Wed, 13 Oct 2010)
New Revision: 13836
Modified:
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/ResourceLoaderXmlDocumentProvider.java
Log:
SEAMXML-16 seam-beans.xml is only loaded from WEB-INF and META-INF
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/ResourceLoaderXmlDocumentProvider.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/ResourceLoaderXmlDocumentProvider.java 2010-10-13 08:18:12 UTC (rev 13835)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/ResourceLoaderXmlDocumentProvider.java 2010-10-13 08:26:08 UTC (rev 13836)
@@ -47,7 +47,7 @@
private final ResourceLoaderManager manager = new ResourceLoaderManager();
- static final String[] DEFAULT_RESOURCES = { "seam-beans.xml", "META-INF/seam-beans.xml", "META-INF/beans.xml", "WEB-INF/beans.xml" };
+ static final String[] DEFAULT_RESOURCES = { "META-INF/seam-beans.xml", "META-INF/beans.xml", "WEB-INF/beans.xml", "WEB-INF/seam-beans.xml" };
final String[] resources;
14 years, 2 months
Seam SVN: r13835 - in modules/xml/trunk: examples/princess-rescue and 1 other directories.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-10-13 04:18:12 -0400 (Wed, 13 Oct 2010)
New Revision: 13835
Modified:
modules/xml/trunk/examples/princess-rescue/pom.xml
modules/xml/trunk/impl/pom.xml
modules/xml/trunk/pom.xml
Log:
update princess-rescue example
Modified: modules/xml/trunk/examples/princess-rescue/pom.xml
===================================================================
--- modules/xml/trunk/examples/princess-rescue/pom.xml 2010-10-13 06:47:59 UTC (rev 13834)
+++ modules/xml/trunk/examples/princess-rescue/pom.xml 2010-10-13 08:18:12 UTC (rev 13835)
@@ -27,7 +27,14 @@
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
+ <scope>provided</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging</artifactId>
+ <scope>runtime</scope>
+ </dependency>
<dependency>
<groupId>javax.annotation</groupId>
@@ -67,20 +74,15 @@
<groupId>org.jboss.weld</groupId>
<artifactId>weld-extensions</artifactId>
<scope>runtime</scope>
- <version>1.0.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.glassfish.web</groupId>
- <artifactId>el-impl</artifactId>
- <scope>runtime</scope>
<exclusions>
- <exclusion>
- <groupId>javax.el</groupId>
- <artifactId>el-api</artifactId>
+ <exclusion>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
</exclusion>
</exclusions>
</dependency>
+
+
<!-- end Jetty/Tomcat-specific scopes and artifacts -->
</dependencies>
Modified: modules/xml/trunk/impl/pom.xml
===================================================================
--- modules/xml/trunk/impl/pom.xml 2010-10-13 06:47:59 UTC (rev 13834)
+++ modules/xml/trunk/impl/pom.xml 2010-10-13 08:18:12 UTC (rev 13835)
@@ -17,10 +17,10 @@
<dependencies>
+
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
- <version>1.0-SP2</version>
</dependency>
<dependency>
Modified: modules/xml/trunk/pom.xml
===================================================================
--- modules/xml/trunk/pom.xml 2010-10-13 06:47:59 UTC (rev 13834)
+++ modules/xml/trunk/pom.xml 2010-10-13 08:18:12 UTC (rev 13835)
@@ -20,6 +20,7 @@
<el-impl.version>1.0</el-impl.version>
<weld.version>1.1.0.Beta1</weld.version>
<jboss.logging.version>3.0.0.Beta4</jboss.logging.version>
+ <cdi-api.version>1.0-SP2</cdi-api.version>
</properties>
<prerequisites>
@@ -48,6 +49,12 @@
</dependency>
<dependency>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
+ <version>${cdi-api.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-extensions</artifactId>
<version>${weld-extensions.version}</version>
@@ -60,10 +67,10 @@
</dependency>
<dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- </dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ </dependency>
<dependency>
<groupId>org.jboss.weld</groupId>
@@ -79,6 +86,12 @@
</dependency>
<dependency>
+ <groupId>org.jboss.weld.servlet</groupId>
+ <artifactId>weld-servlet</artifactId>
+ <version>${weld.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>${jboss.logging.version}</version>
14 years, 2 months
Seam SVN: r13834 - modules/persistence/trunk.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-10-13 02:47:59 -0400 (Wed, 13 Oct 2010)
New Revision: 13834
Modified:
modules/persistence/trunk/pom.xml
Log:
update pom to use weldx Beta1
Modified: modules/persistence/trunk/pom.xml
===================================================================
--- modules/persistence/trunk/pom.xml 2010-10-13 06:45:05 UTC (rev 13833)
+++ modules/persistence/trunk/pom.xml 2010-10-13 06:47:59 UTC (rev 13834)
@@ -36,7 +36,7 @@
<properties>
<seam.version>3.0.0.b01</seam.version>
<jboss-javaee6-spec.version>1.0.0.Beta4</jboss-javaee6-spec.version>
- <weld.extensions.version>1.0.0-SNAPSHOT</weld.extensions.version>
+ <weld.extensions.version>1.0.0.Beta1</weld.extensions.version>
<hibernate.search.version>3.2.1.Final</hibernate.search.version>
<arquillian.version>1.0.0.Alpha4</arquillian.version>
<jboss.server.manager.version>1.0.3.GA</jboss.server.manager.version>
14 years, 2 months
Seam SVN: r13833 - modules/xml/trunk.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-10-13 02:45:05 -0400 (Wed, 13 Oct 2010)
New Revision: 13833
Modified:
modules/xml/trunk/pom.xml
Log:
update pom to weldx Beta1
Modified: modules/xml/trunk/pom.xml
===================================================================
--- modules/xml/trunk/pom.xml 2010-10-13 04:06:09 UTC (rev 13832)
+++ modules/xml/trunk/pom.xml 2010-10-13 06:45:05 UTC (rev 13833)
@@ -16,7 +16,7 @@
<properties>
<seam.version>3.0.0.b01</seam.version>
- <weld-extensions.version>1.0.0-SNAPSHOT</weld-extensions.version>
+ <weld-extensions.version>1.0.0.Beta1</weld-extensions.version>
<el-impl.version>1.0</el-impl.version>
<weld.version>1.1.0.Beta1</weld.version>
<jboss.logging.version>3.0.0.Beta4</jboss.logging.version>
14 years, 2 months