Seam SVN: r13084 - in modules/international/tags/3.0.0.Alpha1: dist/src/main/assembly and 2 other directories.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2010-06-08 11:33:47 -0400 (Tue, 08 Jun 2010)
New Revision: 13084
Modified:
modules/international/tags/3.0.0.Alpha1/dist/pom.xml
modules/international/tags/3.0.0.Alpha1/dist/src/main/assembly/readme.txt
modules/international/tags/3.0.0.Alpha1/docs/reference/pom.xml
modules/international/tags/3.0.0.Alpha1/docs/reference/src/main/docbook/en-US/book_info.xml
Log:
replace residual references to SNAPSHOT with 3.0.0.Alpha1
Modified: modules/international/tags/3.0.0.Alpha1/dist/pom.xml
===================================================================
--- modules/international/tags/3.0.0.Alpha1/dist/pom.xml 2010-06-08 14:19:25 UTC (rev 13083)
+++ modules/international/tags/3.0.0.Alpha1/dist/pom.xml 2010-06-08 15:33:47 UTC (rev 13084)
@@ -6,7 +6,7 @@
<parent>
<groupId>org.jboss.seam.international</groupId>
<artifactId>seam-international-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.Alpha1</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: modules/international/tags/3.0.0.Alpha1/dist/src/main/assembly/readme.txt
===================================================================
--- modules/international/tags/3.0.0.Alpha1/dist/src/main/assembly/readme.txt 2010-06-08 14:19:25 UTC (rev 13083)
+++ modules/international/tags/3.0.0.Alpha1/dist/src/main/assembly/readme.txt 2010-06-08 15:33:47 UTC (rev 13084)
@@ -1,6 +1,6 @@
Seam International Module
- 3.0.0 SNAPSHOT
+ 3.0.0.Alpha1
What is it?
===========
Modified: modules/international/tags/3.0.0.Alpha1/docs/reference/pom.xml
===================================================================
--- modules/international/tags/3.0.0.Alpha1/docs/reference/pom.xml 2010-06-08 14:19:25 UTC (rev 13083)
+++ modules/international/tags/3.0.0.Alpha1/docs/reference/pom.xml 2010-06-08 15:33:47 UTC (rev 13084)
@@ -6,13 +6,13 @@
<parent>
<groupId>org.jboss.seam.international</groupId>
<artifactId>seam-international-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.Alpha1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<groupId>org.jboss.seam.international</groupId>
<artifactId>seam-international-reference-guide</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.0.Alpha1</version>
<packaging>jdocbook</packaging>
<name>Seam International Module Reference Guide</name>
Modified: modules/international/tags/3.0.0.Alpha1/docs/reference/src/main/docbook/en-US/book_info.xml
===================================================================
--- modules/international/tags/3.0.0.Alpha1/docs/reference/src/main/docbook/en-US/book_info.xml 2010-06-08 14:19:25 UTC (rev 13083)
+++ modules/international/tags/3.0.0.Alpha1/docs/reference/src/main/docbook/en-US/book_info.xml 2010-06-08 15:33:47 UTC (rev 13084)
@@ -5,7 +5,7 @@
<bookinfo>
<title>Seam International Module</title>
<subtitle>Reference Guide</subtitle>
- <releaseinfo>3.0.0-SNAPSHOT</releaseinfo>
+ <releaseinfo>3.0.0.Alpha1</releaseinfo>
<xi:include href="author_group.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
14 years
Seam SVN: r13083 - in branches/enterprise/JBPAPP_5_0: build/embedded and 3 other directories.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-06-08 10:19:25 -0400 (Tue, 08 Jun 2010)
New Revision: 13083
Modified:
branches/enterprise/JBPAPP_5_0/build/build.properties
branches/enterprise/JBPAPP_5_0/build/common.build.xml
branches/enterprise/JBPAPP_5_0/build/embedded/hibernate-all.pom.xml
branches/enterprise/JBPAPP_5_0/build/embedded/jboss-embedded-all.pom.xml
branches/enterprise/JBPAPP_5_0/build/embedded/jboss-embedded.pom.xml
branches/enterprise/JBPAPP_5_0/build/embedded/shaded/hibernate-all.pom.xml
branches/enterprise/JBPAPP_5_0/build/embedded/shaded/jboss-embedded-all.pom.xml
branches/enterprise/JBPAPP_5_0/build/embedded/shaded/jboss-embedded.pom.xml
branches/enterprise/JBPAPP_5_0/build/embedded/shaded/thirdparty-all.pom.xml
branches/enterprise/JBPAPP_5_0/build/embedded/thirdparty-all.pom.xml
branches/enterprise/JBPAPP_5_0/build/root.pom.xml
branches/enterprise/JBPAPP_5_0/seam-gen/ivy/ivy-build.xml
branches/enterprise/JBPAPP_5_0/src/resteasy/org/jboss/seam/resteasy/ResourceHome.java
Log:
upgraded resteasy to 1.2.1.GA, jboss-embedded beta3.SP13, hibernate's
Modified: branches/enterprise/JBPAPP_5_0/build/build.properties
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/build.properties 2010-06-08 13:31:37 UTC (rev 13082)
+++ branches/enterprise/JBPAPP_5_0/build/build.properties 2010-06-08 14:19:25 UTC (rev 13083)
@@ -1,6 +1,6 @@
-offline.repository.jboss.org /home/mnovotny/projects/jboss-maven-repository/maven2
+offline.repository.jboss.org /home/mnovotny/projects/jboss-maven-repository/maven2-brew
embedded.poms.dir /home/mnovotny/workspaces/jboss/jboss-seam-2_2_eap5/build/embedded
embedded.dir /home/mnovotny/projects/EMBEDDED_JBOSS_BETA3_JBPAPP_5_0/embedded
#embedded.jars.dir /Users/pmuir/tmp/embedded-jboss-beta3/lib
#�embedded.dist.zip /Users/pmuir/Desktop/downloads/embedded-jboss-beta3.zip
-embedded.version beta3.SP11
\ No newline at end of file
+embedded.version beta3.SP13
Modified: branches/enterprise/JBPAPP_5_0/build/common.build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/common.build.xml 2010-06-08 13:31:37 UTC (rev 13082)
+++ branches/enterprise/JBPAPP_5_0/build/common.build.xml 2010-06-08 14:19:25 UTC (rev 13083)
@@ -23,7 +23,7 @@
<property name="maven.settings.xml" location="${build.dir}/settings.xml" />
- <property name="embedded.version" value="beta3.SP11" />
+ <property name="embedded.version" value="beta3.SP13" />
<import file="${build.dir}/utilities.build.xml" />
Modified: branches/enterprise/JBPAPP_5_0/build/embedded/hibernate-all.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/embedded/hibernate-all.pom.xml 2010-06-08 13:31:37 UTC (rev 13082)
+++ branches/enterprise/JBPAPP_5_0/build/embedded/hibernate-all.pom.xml 2010-06-08 14:19:25 UTC (rev 13083)
@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.embedded</groupId>
<artifactId>hibernate-all</artifactId>
- <version>beta3.SP11</version>
+ <version>beta3.SP13</version>
<description>The hibernate-all.jar distributed with JBoss Embedded. This contains Hibernate
for running in an EJB3 enviroment (Hibernate, Hibernate Annotations, Hibernate EntityManager, Hibernate Validator, Hibernate Commons Annotations)</description>
</project>
Modified: branches/enterprise/JBPAPP_5_0/build/embedded/jboss-embedded-all.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/embedded/jboss-embedded-all.pom.xml 2010-06-08 13:31:37 UTC (rev 13082)
+++ branches/enterprise/JBPAPP_5_0/build/embedded/jboss-embedded-all.pom.xml 2010-06-08 14:19:25 UTC (rev 13083)
@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.embedded</groupId>
<artifactId>jboss-embedded-all</artifactId>
- <version>beta3.SP11</version>
+ <version>beta3.SP13</version>
<description>The jboss-embedded-all.jar distributed with JBoss Embedded. This contains all depdencies
from JBoss AS that originate in JBoss. This jar has has the org.jboss.embedded packages split out.</description>
@@ -13,7 +13,7 @@
<dependency>
<groupId>org.jboss.embedded</groupId>
<artifactId>jboss-embedded</artifactId>
- <version>beta3.SP11</version>
+ <version>beta3.SP13</version>
<exclusions>
<exclusion></exclusion>
</exclusions>
Modified: branches/enterprise/JBPAPP_5_0/build/embedded/jboss-embedded.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/embedded/jboss-embedded.pom.xml 2010-06-08 13:31:37 UTC (rev 13082)
+++ branches/enterprise/JBPAPP_5_0/build/embedded/jboss-embedded.pom.xml 2010-06-08 14:19:25 UTC (rev 13083)
@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.embedded</groupId>
<artifactId>jboss-embedded</artifactId>
- <version>beta3.SP11</version>
+ <version>beta3.SP13</version>
<description>This jar has the org.jboss.embedded packages split out from jboss-embedded-all.</description>
<dependencies>
Modified: branches/enterprise/JBPAPP_5_0/build/embedded/shaded/hibernate-all.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/embedded/shaded/hibernate-all.pom.xml 2010-06-08 13:31:37 UTC (rev 13082)
+++ branches/enterprise/JBPAPP_5_0/build/embedded/shaded/hibernate-all.pom.xml 2010-06-08 14:19:25 UTC (rev 13083)
@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.seam.embedded</groupId>
<artifactId>hibernate-all</artifactId>
- <version>beta3.SP11</version>
+ <version>beta3.SP13</version>
<description>The hibernate-all.jar distributed with JBoss Embedded. This contains Hibernate
for running in an EJB3 enviroment (Hibernate, Hibernate Annotations, Hibernate EntityManager, Hibernate Validator, Hibernate Commons Annotations) and Hibernate Search (specific to this seam version of hibernate-all)</description>
</project>
Modified: branches/enterprise/JBPAPP_5_0/build/embedded/shaded/jboss-embedded-all.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/embedded/shaded/jboss-embedded-all.pom.xml 2010-06-08 13:31:37 UTC (rev 13082)
+++ branches/enterprise/JBPAPP_5_0/build/embedded/shaded/jboss-embedded-all.pom.xml 2010-06-08 14:19:25 UTC (rev 13083)
@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.seam.embedded</groupId>
<artifactId>jboss-embedded-all</artifactId>
- <version>beta3.SP11</version>
+ <version>beta3.SP13</version>
<description>The jboss-embedded-all.jar distributed with JBoss Embedded. This contains all depdencies
from JBoss AS that originate in JBoss. This jar has has the org.jboss.embedded packages split out.</description>
@@ -13,7 +13,7 @@
<dependency>
<groupId>org.jboss.seam.embedded</groupId>
<artifactId>jboss-embedded-api</artifactId>
- <version>beta3.SP11</version>
+ <version>beta3.SP13</version>
<exclusions>
<exclusion></exclusion>
</exclusions>
Modified: branches/enterprise/JBPAPP_5_0/build/embedded/shaded/jboss-embedded.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/embedded/shaded/jboss-embedded.pom.xml 2010-06-08 13:31:37 UTC (rev 13082)
+++ branches/enterprise/JBPAPP_5_0/build/embedded/shaded/jboss-embedded.pom.xml 2010-06-08 14:19:25 UTC (rev 13083)
@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.seam.embedded</groupId>
<artifactId>jboss-embedded-api</artifactId>
- <version>beta3.SP11</version>
+ <version>beta3.SP13</version>
<description>This jar has the org.jboss.embedded packages split out from jboss-embedded-all. This Seam specific version simply keeps the old jboss-embedded-api name for tooling compatibility</description>
<dependencies>
Modified: branches/enterprise/JBPAPP_5_0/build/embedded/shaded/thirdparty-all.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/embedded/shaded/thirdparty-all.pom.xml 2010-06-08 13:31:37 UTC (rev 13082)
+++ branches/enterprise/JBPAPP_5_0/build/embedded/shaded/thirdparty-all.pom.xml 2010-06-08 14:19:25 UTC (rev 13083)
@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.seam.embedded</groupId>
<artifactId>thirdparty-all</artifactId>
- <version>beta3.SP11</version>
+ <version>beta3.SP13</version>
<description>The thirdparty-all.jar distributed with JBoss Embedded. This contains thirdparty
dependencies distributed with JBoss AS. This Seam version also includes lucene, a dependency
of hibernate search</description>
Modified: branches/enterprise/JBPAPP_5_0/build/embedded/thirdparty-all.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/embedded/thirdparty-all.pom.xml 2010-06-08 13:31:37 UTC (rev 13082)
+++ branches/enterprise/JBPAPP_5_0/build/embedded/thirdparty-all.pom.xml 2010-06-08 14:19:25 UTC (rev 13083)
@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.embedded</groupId>
<artifactId>thirdparty-all</artifactId>
- <version>beta3.SP11</version>
+ <version>beta3.SP13</version>
<description>The thirdparty-all.jar distributed with JBoss Embedded. This contains thirdparty
dependencies distributed with JBoss AS.</description>
</project>
Modified: branches/enterprise/JBPAPP_5_0/build/root.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/root.pom.xml 2010-06-08 13:31:37 UTC (rev 13082)
+++ branches/enterprise/JBPAPP_5_0/build/root.pom.xml 2010-06-08 14:19:25 UTC (rev 13083)
@@ -50,7 +50,7 @@
<version.richfaces>3.3.1.SP2</version.richfaces>
<version.drools>5.0.1</version.drools>
<version.testng>5.9</version.testng>
- <version.resteasy>1.1.GA_CP01</version.resteasy>
+ <version.resteasy>1.2.1.GA</version.resteasy>
</properties>
<dependencyManagement>
@@ -283,7 +283,7 @@
<dependency>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-core</artifactId>
- <version>3.2.2.GA</version>
+ <version>3.2.5.GA</version>
<exclusions>
<exclusion>
<groupId>org.jboss</groupId>
@@ -299,7 +299,7 @@
<dependency>
<groupId>jgroups</groupId>
<artifactId>jgroups</artifactId>
- <version>2.6.13.GA</version>
+ <version>2.6.15.GA</version>
</dependency>
<dependency>
@@ -379,7 +379,7 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
- <version>3.3.2.GA_CP01</version>
+ <version>3.3.2.GA_CP02</version>
<exclusions>
<exclusion>
<groupId>commons-collections</groupId>
@@ -407,7 +407,7 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
- <version>3.4.0.GA_CP01</version>
+ <version>3.4.0.GA_CP02</version>
<exclusions>
<exclusion>
<groupId>junit</groupId>
@@ -431,7 +431,7 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
- <version>3.4.0.GA_CP01</version>
+ <version>3.4.0.GA_CP02</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
@@ -467,7 +467,7 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search</artifactId>
- <version>3.1.1.GA_CP01</version>
+ <version>3.1.1.GA_CP02</version>
</dependency>
<dependency>
@@ -622,7 +622,7 @@
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
- <version>3.9.0.GA</version>
+ <version>3.12.0.GA</version>
</dependency>
<dependency>
@@ -862,7 +862,7 @@
<dependency>
<groupId>org.jboss.seam.embedded</groupId>
<artifactId>jboss-embedded-api</artifactId>
- <version>beta3.SP11</version>
+ <version>beta3.SP13</version>
</dependency>
<dependency>
Modified: branches/enterprise/JBPAPP_5_0/seam-gen/ivy/ivy-build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/seam-gen/ivy/ivy-build.xml 2010-06-08 13:31:37 UTC (rev 13082)
+++ branches/enterprise/JBPAPP_5_0/seam-gen/ivy/ivy-build.xml 2010-06-08 14:19:25 UTC (rev 13083)
@@ -12,7 +12,7 @@
<property name="seam.version" value="2.1.2"/>
<property name="jsf.version" value="1.2_12"/>
<property name="richfaces.version" value="3.3.1.GA"/>
- <property name="jboss-embedded.version" value="beta3.SP11"/>
+ <property name="jboss-embedded.version" value="beta3.SP13"/>
<target name="init-ivy">
<available property="ivy.installed" value="true" file="${ivy.jar.file}" type="file"/>
Modified: branches/enterprise/JBPAPP_5_0/src/resteasy/org/jboss/seam/resteasy/ResourceHome.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/resteasy/org/jboss/seam/resteasy/ResourceHome.java 2010-06-08 13:31:37 UTC (rev 13082)
+++ branches/enterprise/JBPAPP_5_0/src/resteasy/org/jboss/seam/resteasy/ResourceHome.java 2010-06-08 14:19:25 UTC (rev 13083)
@@ -292,8 +292,7 @@
*/
private T2 unmarshallId(String id)
{
- //StringParameterInjector injector = new StringParameterInjector(getEntityIdClass(), getEntityIdClass(), "id", PathParam.class, null, null, new Annotation[] {pathParamAnnotation}, SeamResteasyProviderFactory.getInstance());
- StringParameterInjector injector = new StringParameterInjector(getEntityIdClass(), getEntityIdClass(), "id", PathParam.class, null, null, SeamResteasyProviderFactory.getInstance());
+ StringParameterInjector injector = new StringParameterInjector(getEntityIdClass(), getEntityIdClass(), "id", PathParam.class, null, null, new Annotation[] {pathParamAnnotation}, SeamResteasyProviderFactory.getInstance());
return (T2) injector.extractValue(id);
}
14 years
Seam SVN: r13082 - in modules: resteasy and 40 other directories.
by seam-commits@lists.jboss.org
Author: jharting
Date: 2010-06-08 09:31:37 -0400 (Tue, 08 Jun 2010)
New Revision: 13082
Added:
modules/resteasy/
modules/resteasy/branches/
modules/resteasy/tags/
modules/resteasy/trunk/
modules/resteasy/trunk/api/
modules/resteasy/trunk/api/pom.xml
modules/resteasy/trunk/api/src/
modules/resteasy/trunk/api/src/main/
modules/resteasy/trunk/api/src/main/java/
modules/resteasy/trunk/api/src/main/java/org/
modules/resteasy/trunk/api/src/main/java/org/jboss/
modules/resteasy/trunk/api/src/main/java/org/jboss/seam/
modules/resteasy/trunk/api/src/main/java/org/jboss/seam/resteasy/
modules/resteasy/trunk/api/src/main/java/org/jboss/seam/resteasy/configuration/
modules/resteasy/trunk/api/src/main/java/org/jboss/seam/resteasy/configuration/SeamResteasyConfiguration.java
modules/resteasy/trunk/api/src/main/java/org/jboss/seam/resteasy/validation/
modules/resteasy/trunk/api/src/main/java/org/jboss/seam/resteasy/validation/ValidateRequest.java
modules/resteasy/trunk/api/src/main/resources/
modules/resteasy/trunk/impl/
modules/resteasy/trunk/impl/pom.xml
modules/resteasy/trunk/impl/src/
modules/resteasy/trunk/impl/src/main/
modules/resteasy/trunk/impl/src/main/java/
modules/resteasy/trunk/impl/src/main/java/org/
modules/resteasy/trunk/impl/src/main/java/org/jboss/
modules/resteasy/trunk/impl/src/main/java/org/jboss/seam/
modules/resteasy/trunk/impl/src/main/java/org/jboss/seam/resteasy/
modules/resteasy/trunk/impl/src/main/java/org/jboss/seam/resteasy/configuration/
modules/resteasy/trunk/impl/src/main/java/org/jboss/seam/resteasy/configuration/ConfigurationListener.java
modules/resteasy/trunk/impl/src/main/java/org/jboss/seam/resteasy/configuration/GenericExceptionMapper.java
modules/resteasy/trunk/impl/src/main/java/org/jboss/seam/resteasy/validation/
modules/resteasy/trunk/impl/src/main/java/org/jboss/seam/resteasy/validation/ValidationException.java
modules/resteasy/trunk/impl/src/main/java/org/jboss/seam/resteasy/validation/ValidationExceptionMapper.java
modules/resteasy/trunk/impl/src/main/java/org/jboss/seam/resteasy/validation/ValidationInterceptor.java
modules/resteasy/trunk/impl/src/main/resources/
modules/resteasy/trunk/impl/src/main/resources/META-INF/
modules/resteasy/trunk/impl/src/main/resources/META-INF/beans.xml
modules/resteasy/trunk/impl/src/main/resources/META-INF/web-fragment.xml
modules/resteasy/trunk/impl/src/test/
modules/resteasy/trunk/impl/src/test/java/
modules/resteasy/trunk/impl/src/test/java/org/
modules/resteasy/trunk/impl/src/test/java/org/jboss/
modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/
modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/
modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/
modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/configuration/
modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/configuration/ConfigurationTest.java
modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/configuration/CustomSeamResteasyConfiguration.java
modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/configuration/EntityNotFoundException.java
modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/configuration/TestProvider.java
modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/configuration/TestResource.java
modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/validation/
modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/validation/FormBean.java
modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/validation/PartialValidation.java
modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/validation/Person.java
modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/validation/Resource.java
modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/validation/ValidationTest.java
modules/resteasy/trunk/impl/src/test/resources/
modules/resteasy/trunk/impl/src/test/resources/jndi.properties
modules/resteasy/trunk/impl/src/test/resources/org/
modules/resteasy/trunk/impl/src/test/resources/org/jboss/
modules/resteasy/trunk/impl/src/test/resources/org/jboss/seam/
modules/resteasy/trunk/impl/src/test/resources/org/jboss/seam/resteasy/
modules/resteasy/trunk/impl/src/test/resources/org/jboss/seam/resteasy/test/
modules/resteasy/trunk/impl/src/test/resources/org/jboss/seam/resteasy/test/configuration/
modules/resteasy/trunk/impl/src/test/resources/org/jboss/seam/resteasy/test/configuration/web.xml
modules/resteasy/trunk/impl/src/test/resources/org/jboss/seam/resteasy/test/validation/
modules/resteasy/trunk/impl/src/test/resources/org/jboss/seam/resteasy/test/validation/beans.xml
modules/resteasy/trunk/pom.xml
modules/resteasy/trunk/readme.txt
Log:
Initial commit of seam-resteasy.
Added: modules/resteasy/trunk/api/pom.xml
===================================================================
--- modules/resteasy/trunk/api/pom.xml (rev 0)
+++ modules/resteasy/trunk/api/pom.xml 2010-06-08 13:31:37 UTC (rev 13082)
@@ -0,0 +1,18 @@
+<project 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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>seam-resteasy-parent</artifactId>
+ <groupId>org.jboss.seam.resteasy</groupId>
+ <version>3.0.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>seam-resteasy-api</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+
+ <packaging>jar</packaging>
+ <name>Seam RESTEasy Module API</name>
+
+</project>
Added: modules/resteasy/trunk/api/src/main/java/org/jboss/seam/resteasy/configuration/SeamResteasyConfiguration.java
===================================================================
--- modules/resteasy/trunk/api/src/main/java/org/jboss/seam/resteasy/configuration/SeamResteasyConfiguration.java (rev 0)
+++ modules/resteasy/trunk/api/src/main/java/org/jboss/seam/resteasy/configuration/SeamResteasyConfiguration.java 2010-06-08 13:31:37 UTC (rev 13082)
@@ -0,0 +1,113 @@
+package org.jboss.seam.resteasy.configuration;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.enterprise.context.ApplicationScoped;
+
+/**
+ * Holds configuration options for seam-resteasy extension. It can be used to configure the extension via XML descriptor
+ * using seam-xml extension. Alternatively, you can configure the extension programatically by providing an
+ * @{link @Alternative} subclass of SeamResteasyConfiguration.
+ *
+ * This class allows declarative exception mapping to be used. The way exceptions are treated in the application is based on
+ * what @{link {@link #getExceptionMappings()} returns. Override this method or use seam-xml module to set up exception mapping
+ * declaratively.
+ *
+ * @author <a href="mailto:jharting@redhat.com">Jozef Hartinger</a>
+ *
+ */
+@ApplicationScoped
+public class SeamResteasyConfiguration
+{
+ private Set<Class<?>> resources = new HashSet<Class<?>>();
+ private Set<Class<?>> providers = new HashSet<Class<?>>();
+
+ private Map<String, String> mediaTypeMappings = new HashMap<String, String>();
+ private Map<String, String> languageMappings = new HashMap<String, String>();
+
+ private Map<Class<? extends Throwable>, Integer> exceptionMappings = new HashMap<Class<? extends Throwable>, Integer>();
+
+ private boolean registerValidationExceptionMapper = true;
+
+ /**
+ * Returns a set of resource classes to be registered.
+ */
+ public Set<Class<?>> getResources()
+ {
+ return resources;
+ }
+
+ public void setResources(Set<Class<?>> resources)
+ {
+ this.resources = resources;
+ }
+
+ /**
+ * Returns a set of provider classes to be registered.
+ */
+ public Set<Class<?>> getProviders()
+ {
+ return providers;
+ }
+
+ public void setProviders(Set<Class<?>> providers)
+ {
+ this.providers = providers;
+ }
+
+ /**
+ * Returns a map of media type mappings to be registered.
+ */
+ public Map<String, String> getMediaTypeMappings()
+ {
+ return mediaTypeMappings;
+ }
+
+
+ public void setMediaTypeMappings(Map<String, String> mediaTypeMappings)
+ {
+ this.mediaTypeMappings = mediaTypeMappings;
+ }
+
+ /**
+ * Returns a map of language mappings to be registered.
+ */
+ public Map<String, String> getLanguageMappings()
+ {
+ return languageMappings;
+ }
+
+ public void setLanguageMappings(Map<String, String> languageMappings)
+ {
+ this.languageMappings = languageMappings;
+ }
+
+ /**
+ * Returns a map of exception mappings.
+ */
+ public Map<Class<? extends Throwable>, Integer> getExceptionMappings()
+ {
+ return exceptionMappings;
+ }
+
+ public void setExceptionMappings(Map<Class<? extends Throwable>, Integer> exceptionMapping)
+ {
+ this.exceptionMappings = exceptionMapping;
+ }
+
+ /**
+ * If set to true, the default exception mapper for {@link org.jboss.seam.resteasy.validation.ValidationException} will be registered.
+ */
+ public boolean isRegisterValidationExceptionMapper()
+ {
+ return registerValidationExceptionMapper;
+ }
+
+ public void setRegisterValidationExceptionMapper(boolean registerValidationExceptionMapper)
+ {
+ this.registerValidationExceptionMapper = registerValidationExceptionMapper;
+ }
+}
Added: modules/resteasy/trunk/api/src/main/java/org/jboss/seam/resteasy/validation/ValidateRequest.java
===================================================================
--- modules/resteasy/trunk/api/src/main/java/org/jboss/seam/resteasy/validation/ValidateRequest.java (rev 0)
+++ modules/resteasy/trunk/api/src/main/java/org/jboss/seam/resteasy/validation/ValidateRequest.java 2010-06-08 13:31:37 UTC (rev 13082)
@@ -0,0 +1,84 @@
+package org.jboss.seam.resteasy.validation;
+
+import static java.lang.annotation.ElementType.METHOD;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.AnnotationLiteral;
+import javax.enterprise.util.Nonbinding;
+import javax.interceptor.InterceptorBinding;
+import javax.validation.groups.Default;
+
+/**
+ * Triggers validation of incomming HTTP requests.
+ * The {@link Default} group is validated if not specified otherwise. By default, the message body parameter
+ * and {@link org.jboss.resteasy.annotations.Form} parameters are validated. This behaviour can be altered
+ * using {@link #validateMessageBody()} and {@link #validateFormParameters()} attributes.
+ *
+ * @author <a href="mailto:jharting@redhat.com">Jozef Hartinger</a>
+ *
+ */
+@Target( { TYPE, METHOD })
+@Retention(RUNTIME)
+@Documented
+@InterceptorBinding
+public @interface ValidateRequest
+{
+ /**
+ * Validation group that will be used during validation process.
+ */
+ @Nonbinding
+ Class<?>[] groups() default Default.class;
+
+ /**
+ * If set to false, the message body parameter will not be validated.
+ */
+ @Nonbinding
+ boolean validateMessageBody() default true;
+
+ /**
+ * If set to false, {@link org.jboss.resteasy.annotations.Form} parameters will not be validated.
+ * @return
+ */
+ @Nonbinding
+ boolean validateFormParameters() default true;
+
+ /**
+ * Annotation literal for {@link ValidateRequest} interceptor binding.
+ */
+ static class ValidateLiteral extends AnnotationLiteral<ValidateRequest> implements ValidateRequest
+ {
+ private static final long serialVersionUID = 6404662043744038090L;
+
+ private final Class<?>[] groups;
+ private final boolean validateFormParameters;
+ private final boolean validateMessageBody;
+
+ public ValidateLiteral(Class<?>[] groups, boolean validateFormParameters, boolean validateMessageBody)
+ {
+ this.groups = groups;
+ this.validateFormParameters = validateFormParameters;
+ this.validateMessageBody = validateMessageBody;
+ }
+
+ public Class<?>[] groups()
+ {
+ return groups;
+ }
+
+ public boolean validateFormParameters()
+ {
+ return validateFormParameters;
+ }
+
+ public boolean validateMessageBody()
+ {
+ return validateMessageBody;
+ }
+ }
+}
Added: modules/resteasy/trunk/impl/pom.xml
===================================================================
--- modules/resteasy/trunk/impl/pom.xml (rev 0)
+++ modules/resteasy/trunk/impl/pom.xml 2010-06-08 13:31:37 UTC (rev 13082)
@@ -0,0 +1,27 @@
+<project 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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>seam-resteasy-parent</artifactId>
+ <groupId>org.jboss.seam.resteasy</groupId>
+ <version>3.0.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>seam-resteasy</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+
+ <packaging>jar</packaging>
+ <name>Seam RESTEasy Module Implementation</name>
+
+ <dependencies>
+ <dependency>
+ <artifactId>seam-resteasy-api</artifactId>
+ <groupId>org.jboss.seam.resteasy</groupId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+</project>
+
Added: modules/resteasy/trunk/impl/src/main/java/org/jboss/seam/resteasy/configuration/ConfigurationListener.java
===================================================================
--- modules/resteasy/trunk/impl/src/main/java/org/jboss/seam/resteasy/configuration/ConfigurationListener.java (rev 0)
+++ modules/resteasy/trunk/impl/src/main/java/org/jboss/seam/resteasy/configuration/ConfigurationListener.java 2010-06-08 13:31:37 UTC (rev 13082)
@@ -0,0 +1,108 @@
+package org.jboss.seam.resteasy.configuration;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import javax.inject.Inject;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.ext.ExceptionMapper;
+
+import org.jboss.resteasy.core.Dispatcher;
+import org.jboss.resteasy.spi.Registry;
+import org.jboss.resteasy.spi.ResteasyProviderFactory;
+import org.jboss.seam.resteasy.validation.ValidationExceptionMapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ConfigurationListener implements ServletContextListener
+{
+ @Inject
+ private SeamResteasyConfiguration configuration;
+ private Dispatcher dispatcher;
+ private ResteasyProviderFactory factory;
+ private Registry registry;
+
+ private static final Logger log = LoggerFactory.getLogger(ConfigurationListener.class);
+
+ public void contextInitialized(ServletContextEvent sce)
+ {
+ dispatcher = (Dispatcher) sce.getServletContext().getAttribute(Dispatcher.class.getName());
+ factory = dispatcher.getProviderFactory();
+ registry = dispatcher.getRegistry();
+
+ log.info("Processing seam-resteasy configuration.");
+
+ registerProviders();
+ registerResources();
+ dispatcher.setLanguageMappings(configuration.getLanguageMappings());
+ registerMediaTypeMappings();
+ registerExceptionMappings();
+ }
+
+ private void registerResources()
+ {
+ for (Class<?> clazz : configuration.getResources())
+ {
+ log.info("Adding root resource {}.", clazz);
+ registry.addPerRequestResource(clazz);
+ }
+ }
+
+ private void registerProviders()
+ {
+ for (Class<?> clazz : configuration.getProviders())
+ {
+ log.info("Adding provider {}.", clazz);
+ factory.registerProvider(clazz);
+ }
+ }
+
+ private void registerExceptionMappings()
+ {
+ for (Entry<Class<? extends Throwable>, Integer> item : configuration.getExceptionMappings().entrySet())
+ {
+ if (Throwable.class.isAssignableFrom(item.getKey()))
+ {
+ Class<? extends Throwable> exceptionType = item.getKey();
+ int status = item.getValue();
+ ExceptionMapper<? extends Throwable> provider = new GenericExceptionMapper<Throwable>(status);
+ log.info("Adding exception mapping {} -> {}", exceptionType, status);
+ try
+ {
+ factory.addExceptionMapper(provider, exceptionType);
+ }
+ catch (NoSuchMethodError e)
+ {
+ log.warn("You are using old version of RESTEasy. Exception mapper for {} will not be registered.", exceptionType);
+ }
+ }
+ else
+ {
+ log.warn("{} is not an exception. Skipping mapping of the exception to {} status code.", item.getKey(), item.getValue());
+ }
+ }
+
+ // register ExceptionMapper for Bean Validation integration
+ if (configuration.isRegisterValidationExceptionMapper())
+ {
+ factory.addExceptionMapper(ValidationExceptionMapper.class);
+ }
+ }
+
+ private void registerMediaTypeMappings()
+ {
+ Map<String, MediaType> mediaTypeMappings = new HashMap<String, MediaType>();
+ for (Entry<String, String> entry : configuration.getMediaTypeMappings().entrySet())
+ {
+ mediaTypeMappings.put(entry.getKey(), MediaType.valueOf(entry.getValue()));
+ }
+ dispatcher.setMediaTypeMappings(mediaTypeMappings);
+ }
+
+ public void contextDestroyed(ServletContextEvent sce)
+ {
+ }
+}
Added: modules/resteasy/trunk/impl/src/main/java/org/jboss/seam/resteasy/configuration/GenericExceptionMapper.java
===================================================================
--- modules/resteasy/trunk/impl/src/main/java/org/jboss/seam/resteasy/configuration/GenericExceptionMapper.java (rev 0)
+++ modules/resteasy/trunk/impl/src/main/java/org/jboss/seam/resteasy/configuration/GenericExceptionMapper.java 2010-06-08 13:31:37 UTC (rev 13082)
@@ -0,0 +1,19 @@
+package org.jboss.seam.resteasy.configuration;
+
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.ExceptionMapper;
+
+public class GenericExceptionMapper<T extends Throwable> implements ExceptionMapper<T>
+{
+ private int status;
+
+ public GenericExceptionMapper(int status)
+ {
+ this.status = status;
+ }
+
+ public Response toResponse(T exception)
+ {
+ return Response.status(status).build();
+ }
+}
Added: modules/resteasy/trunk/impl/src/main/java/org/jboss/seam/resteasy/validation/ValidationException.java
===================================================================
--- modules/resteasy/trunk/impl/src/main/java/org/jboss/seam/resteasy/validation/ValidationException.java (rev 0)
+++ modules/resteasy/trunk/impl/src/main/java/org/jboss/seam/resteasy/validation/ValidationException.java 2010-06-08 13:31:37 UTC (rev 13082)
@@ -0,0 +1,22 @@
+package org.jboss.seam.resteasy.validation;
+
+import java.util.Set;
+
+import javax.validation.ConstraintViolation;
+
+public class ValidationException extends RuntimeException
+{
+ private static final long serialVersionUID = -2779809222298578247L;
+
+ private Set<ConstraintViolation<Object>> violations;
+
+ public ValidationException(Set<ConstraintViolation<Object>> violations)
+ {
+ this.violations = violations;
+ }
+
+ public Set<ConstraintViolation<Object>> getViolations()
+ {
+ return violations;
+ }
+}
Added: modules/resteasy/trunk/impl/src/main/java/org/jboss/seam/resteasy/validation/ValidationExceptionMapper.java
===================================================================
--- modules/resteasy/trunk/impl/src/main/java/org/jboss/seam/resteasy/validation/ValidationExceptionMapper.java (rev 0)
+++ modules/resteasy/trunk/impl/src/main/java/org/jboss/seam/resteasy/validation/ValidationExceptionMapper.java 2010-06-08 13:31:37 UTC (rev 13082)
@@ -0,0 +1,23 @@
+package org.jboss.seam.resteasy.validation;
+
+import javax.validation.ConstraintViolation;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.ResponseBuilder;
+
+import static javax.ws.rs.core.Response.Status.BAD_REQUEST;
+import javax.ws.rs.ext.ExceptionMapper;
+
+public class ValidationExceptionMapper implements ExceptionMapper<ValidationException>
+{
+ public Response toResponse(ValidationException exception)
+ {
+ ResponseBuilder response = Response.status(BAD_REQUEST);
+
+ StringBuilder str = new StringBuilder();
+ for (ConstraintViolation<Object> violation : exception.getViolations())
+ {
+ str.append(violation.getMessage());
+ }
+ return response.entity(str.toString()).build();
+ }
+}
Added: modules/resteasy/trunk/impl/src/main/java/org/jboss/seam/resteasy/validation/ValidationInterceptor.java
===================================================================
--- modules/resteasy/trunk/impl/src/main/java/org/jboss/seam/resteasy/validation/ValidationInterceptor.java (rev 0)
+++ modules/resteasy/trunk/impl/src/main/java/org/jboss/seam/resteasy/validation/ValidationInterceptor.java 2010-06-08 13:31:37 UTC (rev 13082)
@@ -0,0 +1,84 @@
+package org.jboss.seam.resteasy.validation;
+
+import java.io.Serializable;
+import java.lang.annotation.Annotation;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.inject.Inject;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+import javax.validation.ConstraintViolation;
+import javax.validation.Validator;
+import javax.validation.groups.Default;
+
+import org.jboss.resteasy.annotations.Form;
+
+@Interceptor
+@ValidateRequest
+public class ValidationInterceptor implements Serializable
+{
+ private static final long serialVersionUID = -5804986456381504613L;
+ private static final Class<?>[] DEFAULT_GROUPS = new Class<?>[] {Default.class};
+ private static final ValidateRequest DEFAULT_INTERCEPTOR_BINDING = new ValidateRequest.ValidateLiteral(DEFAULT_GROUPS, true, true);
+
+ @Inject
+ private Validator validator;
+
+ @AroundInvoke
+ public Object intercept(InvocationContext ctx) throws Exception
+ {
+ Set<ConstraintViolation<Object>> violations = new HashSet<ConstraintViolation<Object>>();
+
+ ValidateRequest interceptorBinding = getInterceptorBinding(ctx);
+ Class<?>[] groups = interceptorBinding.groups();
+
+ // perform validation
+ Annotation[][] parameterAnnotations = ctx.getMethod().getParameterAnnotations();
+ for (int i = 0; i < parameterAnnotations.length; i++)
+ {
+ if (parameterAnnotations[i].length == 0 && interceptorBinding.validateMessageBody())
+ {
+ // entity body
+ violations.addAll(validator.validate(ctx.getParameters()[i], groups));
+ }
+
+ if (parameterAnnotations[i].length > 0 && interceptorBinding.validateFormParameters())
+ {
+ // @Form parameters
+ for (Annotation annotation : parameterAnnotations[i])
+ {
+ if (annotation instanceof Form)
+ {
+ violations.addAll(validator.validate(ctx.getParameters()[i], groups));
+ }
+ }
+ }
+ }
+
+ if (violations.isEmpty())
+ {
+ return ctx.proceed();
+ }
+ else
+ {
+ throw new ValidationException(violations);
+ }
+ }
+
+ private ValidateRequest getInterceptorBinding(InvocationContext ctx)
+ {
+ ValidateRequest interceptorBinding = ctx.getMethod().getAnnotation(ValidateRequest.class);
+ if (interceptorBinding == null)
+ {
+ // There is no @Validate on the method
+ // The interceptor is probably bound to the bean by @Interceptors annotation
+ return DEFAULT_INTERCEPTOR_BINDING;
+ }
+ else
+ {
+ return interceptorBinding;
+ }
+ }
+}
Added: modules/resteasy/trunk/impl/src/main/resources/META-INF/beans.xml
===================================================================
--- modules/resteasy/trunk/impl/src/main/resources/META-INF/beans.xml (rev 0)
+++ modules/resteasy/trunk/impl/src/main/resources/META-INF/beans.xml 2010-06-08 13:31:37 UTC (rev 13082)
@@ -0,0 +1,6 @@
+<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:s="urn:java:seam:core" xmlns:test="urn:java:org.jboss.seam.resteasy.configuration"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+</beans>
\ No newline at end of file
Added: modules/resteasy/trunk/impl/src/main/resources/META-INF/web-fragment.xml
===================================================================
--- modules/resteasy/trunk/impl/src/main/resources/META-INF/web-fragment.xml (rev 0)
+++ modules/resteasy/trunk/impl/src/main/resources/META-INF/web-fragment.xml 2010-06-08 13:31:37 UTC (rev 13082)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-fragment 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://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd"
+ version="3.0">
+
+ <!-- Seam-RESTEasy Configuration Listener -->
+ <listener>
+ <listener-class>org.jboss.seam.resteasy.configuration.ConfigurationListener</listener-class>
+ </listener>
+</web-fragment>
\ No newline at end of file
Added: modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/configuration/ConfigurationTest.java
===================================================================
--- modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/configuration/ConfigurationTest.java (rev 0)
+++ modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/configuration/ConfigurationTest.java 2010-06-08 13:31:37 UTC (rev 13082)
@@ -0,0 +1,89 @@
+package org.jboss.seam.resteasy.test.configuration;
+
+
+import static org.testng.Assert.assertEquals;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.api.Run;
+import org.jboss.arquillian.api.RunModeType;
+import org.jboss.arquillian.testng.Arquillian;
+import org.jboss.seam.resteasy.configuration.ConfigurationListener;
+import org.jboss.seam.resteasy.configuration.GenericExceptionMapper;
+import org.jboss.seam.resteasy.configuration.SeamResteasyConfiguration;
+import org.jboss.seam.resteasy.validation.ValidationException;
+import org.jboss.seam.resteasy.validation.ValidationExceptionMapper;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.testng.annotations.Test;
+
+(a)Run(RunModeType.AS_CLIENT)
+public class ConfigurationTest
+extends Arquillian
+{
+ private HttpClient client = new HttpClient();
+
+ @Deployment
+ public static WebArchive createDeployment()
+ {
+ JavaArchive jar = ShrinkWrap.create("seam-resteasy.jar", JavaArchive.class);
+ jar.addManifestResource("META-INF/web-fragment.xml", "web-fragment.xml");
+ jar.addManifestResource("META-INF/beans.xml", ArchivePaths.create("beans.xml"));
+ jar.addClass(SeamResteasyConfiguration.class);
+ jar.addClass(ConfigurationListener.class);
+ jar.addClass(GenericExceptionMapper.class);
+ jar.addClass(ValidationExceptionMapper.class);
+ jar.addClass(ValidationException.class);
+ WebArchive war = ShrinkWrap.create("test.war", WebArchive.class);
+ war.addClass(CustomSeamResteasyConfiguration.class);
+ war.addClass(EntityNotFoundException.class);
+ war.addClass(TestProvider.class);
+ war.addClass(TestResource.class);
+ war.addLibrary(jar);
+ war.addResource("META-INF/beans.xml", ArchivePaths.create("WEB-INF/beans.xml"));
+ war.setWebXML("org/jboss/seam/resteasy/test/configuration/web.xml");
+ return war;
+ }
+
+
+ @Test
+ public void testResource() throws Exception
+ {
+ test("http://localhost:8080/test/foo", 200, "foo");
+ }
+
+ @Test
+ public void testProvider() throws Exception
+ {
+ GetMethod get = new GetMethod("http://localhost:8080/test/foo/bar");
+ get.setRequestHeader("Accept", "foo/bar");
+ assertEquals(client.executeMethod(get), 200);
+ assertEquals(get.getResponseBodyAsString(), "foobar");
+ }
+
+ @Test
+ public void testExceptionMapping() throws Exception
+ {
+ test("http://localhost:8080/test/foo/notFound", 404, null);
+ }
+
+ @Test
+ public void testMediaTypeMapping() throws Exception
+ {
+ test("http://localhost:8080/test/foo.xml", 200, "<foo/>");
+ }
+
+ private void test(String url, int expectedStatus, String expectedBody) throws Exception
+ {
+ GetMethod get = new GetMethod(url);
+ get.setRequestHeader("Accept", "text/plain");
+ assertEquals(client.executeMethod(get), expectedStatus);
+ if (expectedBody != null)
+ {
+ assertEquals(get.getResponseBodyAsString(), expectedBody);
+ }
+ }
+}
Added: modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/configuration/CustomSeamResteasyConfiguration.java
===================================================================
--- modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/configuration/CustomSeamResteasyConfiguration.java (rev 0)
+++ modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/configuration/CustomSeamResteasyConfiguration.java 2010-06-08 13:31:37 UTC (rev 13082)
@@ -0,0 +1,18 @@
+package org.jboss.seam.resteasy.test.configuration;
+
+import javax.enterprise.inject.Specializes;
+
+import org.jboss.seam.resteasy.configuration.SeamResteasyConfiguration;
+
+@Specializes
+public class CustomSeamResteasyConfiguration extends SeamResteasyConfiguration
+{
+
+ public CustomSeamResteasyConfiguration()
+ {
+ getResources().add(TestResource.class);
+ getProviders().add(TestProvider.class);
+ getExceptionMappings().put(EntityNotFoundException.class, 404);
+ getMediaTypeMappings().put("xml", "application/xml");
+ }
+}
Added: modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/configuration/EntityNotFoundException.java
===================================================================
--- modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/configuration/EntityNotFoundException.java (rev 0)
+++ modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/configuration/EntityNotFoundException.java 2010-06-08 13:31:37 UTC (rev 13082)
@@ -0,0 +1,6 @@
+package org.jboss.seam.resteasy.test.configuration;
+
+public class EntityNotFoundException extends RuntimeException
+{
+ private static final long serialVersionUID = 1L;
+}
Added: modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/configuration/TestProvider.java
===================================================================
--- modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/configuration/TestProvider.java (rev 0)
+++ modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/configuration/TestProvider.java 2010-06-08 13:31:37 UTC (rev 13082)
@@ -0,0 +1,34 @@
+package org.jboss.seam.resteasy.test.configuration;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.ext.MessageBodyWriter;
+import javax.ws.rs.ext.Provider;
+
+@Provider
+public class TestProvider implements MessageBodyWriter<String>
+{
+ public long getSize(String t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
+ {
+ return -1;
+ }
+
+ public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
+ {
+ return mediaType.equals(MediaType.valueOf("foo/bar"));
+ }
+
+ public void writeTo(String t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException
+ {
+ OutputStreamWriter writer = new OutputStreamWriter(entityStream);
+ writer.write("foo"+t);
+ writer.flush();
+ }
+}
Added: modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/configuration/TestResource.java
===================================================================
--- modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/configuration/TestResource.java (rev 0)
+++ modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/configuration/TestResource.java 2010-06-08 13:31:37 UTC (rev 13082)
@@ -0,0 +1,38 @@
+package org.jboss.seam.resteasy.test.configuration;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+
+@Path("foo")
+@Produces("text/plain")
+public class TestResource
+{
+ @GET
+ public String foo()
+ {
+ return "foo";
+ }
+
+ @GET
+ @Produces("application/xml")
+ public String xmlFoo()
+ {
+ return "<foo/>";
+ }
+
+ @GET
+ @Path("bar")
+ @Produces("foo/bar")
+ public String bar()
+ {
+ return "bar";
+ }
+
+ @GET
+ @Path("notFound")
+ public void notFound()
+ {
+ throw new EntityNotFoundException();
+ }
+}
Added: modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/validation/FormBean.java
===================================================================
--- modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/validation/FormBean.java (rev 0)
+++ modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/validation/FormBean.java 2010-06-08 13:31:37 UTC (rev 13082)
@@ -0,0 +1,41 @@
+package org.jboss.seam.resteasy.test.validation;
+
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import javax.ws.rs.FormParam;
+
+public class FormBean
+{
+ @FormParam("foo")
+ @NotNull
+ private String foo;
+ @FormParam("bar")
+ @Size(min = 2)
+ private String bar;
+
+ public FormBean(String foo, String bar)
+ {
+ this.foo = foo;
+ this.bar = bar;
+ }
+
+ public String getFoo()
+ {
+ return foo;
+ }
+
+ public void setFoo(String foo)
+ {
+ this.foo = foo;
+ }
+
+ public String getBar()
+ {
+ return bar;
+ }
+
+ public void setBar(String bar)
+ {
+ this.bar = bar;
+ }
+}
Added: modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/validation/PartialValidation.java
===================================================================
--- modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/validation/PartialValidation.java (rev 0)
+++ modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/validation/PartialValidation.java 2010-06-08 13:31:37 UTC (rev 13082)
@@ -0,0 +1,5 @@
+package org.jboss.seam.resteasy.test.validation;
+
+public interface PartialValidation
+{
+}
Added: modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/validation/Person.java
===================================================================
--- modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/validation/Person.java (rev 0)
+++ modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/validation/Person.java 2010-06-08 13:31:37 UTC (rev 13082)
@@ -0,0 +1,90 @@
+package org.jboss.seam.resteasy.test.validation;
+
+import javax.validation.constraints.AssertFalse;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import javax.validation.groups.Default;
+
+public class Person
+{
+
+ @Size(min = 2, max = 20, groups = { PartialValidation.class, Default.class })
+ private String firstName;
+ @Size(min = 2, max = 20, groups = { PartialValidation.class, Default.class })
+ private String surname;
+ @Min(value = 18, groups = { PartialValidation.class, Default.class })
+ private int age;
+ @AssertFalse(groups = { PartialValidation.class, Default.class })
+ private boolean zombie;
+ @NotNull // not validated during partial validation
+ private String bio;
+
+ public Person(String firstName, String surname, int age, boolean zombie)
+ {
+ this.firstName = firstName;
+ this.surname = surname;
+ this.age = age;
+ this.zombie = zombie;
+ }
+
+ public Person(String firstName, String surname, int age, boolean zombie, String bio)
+ {
+ this(firstName, surname, age, zombie);
+ this.bio = bio;
+ }
+
+ public Person()
+ {
+ }
+
+ public String getFirstName()
+ {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName)
+ {
+ this.firstName = firstName;
+ }
+
+ public String getSurname()
+ {
+ return surname;
+ }
+
+ public void setSurname(String surname)
+ {
+ this.surname = surname;
+ }
+
+ public int getAge()
+ {
+ return age;
+ }
+
+ public void setAge(int age)
+ {
+ this.age = age;
+ }
+
+ public boolean isZombie()
+ {
+ return zombie;
+ }
+
+ public void setZombie(boolean zombie)
+ {
+ this.zombie = zombie;
+ }
+
+ public String getBio()
+ {
+ return bio;
+ }
+
+ public void setBio(String bio)
+ {
+ this.bio = bio;
+ }
+}
Added: modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/validation/Resource.java
===================================================================
--- modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/validation/Resource.java (rev 0)
+++ modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/validation/Resource.java 2010-06-08 13:31:37 UTC (rev 13082)
@@ -0,0 +1,33 @@
+package org.jboss.seam.resteasy.test.validation;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+
+import org.jboss.resteasy.annotations.Form;
+import org.jboss.seam.resteasy.validation.ValidateRequest;
+
+@Path("validation")
+@Produces("text/plain")
+@Consumes("text/plain")
+public class Resource
+{
+ @POST
+ @ValidateRequest(groups = PartialValidation.class)
+ public void partiallyValidatedOperation(Person person)
+ {
+ }
+
+ @POST
+ @ValidateRequest
+ public void completelyValidatedOperation(Person person)
+ {
+ }
+
+ @POST
+ @ValidateRequest
+ public void formOperation(@Form FormBean form1, @Form FormBean form2)
+ {
+ }
+}
Added: modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/validation/ValidationTest.java
===================================================================
--- modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/validation/ValidationTest.java (rev 0)
+++ modules/resteasy/trunk/impl/src/test/java/org/jboss/seam/resteasy/test/validation/ValidationTest.java 2010-06-08 13:31:37 UTC (rev 13082)
@@ -0,0 +1,107 @@
+package org.jboss.seam.resteasy.test.validation;
+
+import static org.testng.Assert.assertEquals;
+
+import javax.inject.Inject;
+import javax.ws.rs.core.Response;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.testng.Arquillian;
+import org.jboss.seam.resteasy.validation.ValidateRequest;
+import org.jboss.seam.resteasy.validation.ValidationException;
+import org.jboss.seam.resteasy.validation.ValidationExceptionMapper;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.testng.annotations.Test;
+
+public class ValidationTest extends Arquillian
+{
+ @Inject
+ private Resource testResource;
+
+ @Deployment
+ public static JavaArchive createDeployment()
+ {
+ JavaArchive jar = ShrinkWrap.create("test.jar", JavaArchive.class);
+ jar.addManifestResource("org/jboss/seam/resteasy/test/validation/beans.xml", ArchivePaths.create("beans.xml"));
+ jar.addPackage(ValidateRequest.class.getPackage());
+ jar.addPackage(ValidationTest.class.getPackage());
+ return jar;
+ }
+
+ @Test
+ public void testCorrectMessageBody()
+ {
+ Person tester = new Person("Jozef", "Hartinger", 22, false);
+ testResource.partiallyValidatedOperation(tester);
+ }
+
+ @Test
+ public void testIncorrectMessageBody()
+ {
+ Person tester = new Person("foo", "b", 5, true);
+ try
+ {
+ testResource.partiallyValidatedOperation(tester);
+ throw new RuntimeException("Expected exception not thrown.");
+ }
+ catch (ValidationException e)
+ {
+ assertEquals(e.getViolations().size(), 3);
+ }
+ }
+
+ @Test
+ public void testIncorrectFormBean()
+ {
+ FormBean form1 = new FormBean(null, "a");
+ FormBean form2 = new FormBean(null, "bb");
+ try
+ {
+ testResource.formOperation(form1, form2);
+ throw new RuntimeException("Expected exception not thrown.");
+ }
+ catch (ValidationException e)
+ {
+ assertEquals(e.getViolations().size(), 3);
+ }
+ }
+
+ @Test
+ public void testValidationExceptionMapper()
+ {
+ Person tester = new Person("foo", "bar", 100, true);
+ ValidationExceptionMapper mapper = new ValidationExceptionMapper();
+ try
+ {
+ testResource.partiallyValidatedOperation(tester);
+ throw new RuntimeException("Expected exception not thrown.");
+ }
+ catch (ValidationException e)
+ {
+ Response response = mapper.toResponse(e);
+ assertEquals(response.getEntity().toString(), "must be false");
+ }
+ }
+
+ @Test
+ public void testGroups()
+ {
+ Person partiallyValidPerson = new Person("foo", "bar", 100, false);
+ Person completelyValidPerson = new Person("foo", "bar", 100, false, "foobar");
+
+ testResource.partiallyValidatedOperation(partiallyValidPerson);
+ testResource.completelyValidatedOperation(completelyValidPerson);
+
+ try
+ {
+ testResource.completelyValidatedOperation(partiallyValidPerson);
+ throw new RuntimeException("Expected exception not thrown.");
+ }
+ catch (ValidationException e)
+ {
+ // expected
+ }
+ }
+}
Added: modules/resteasy/trunk/impl/src/test/resources/jndi.properties
===================================================================
--- modules/resteasy/trunk/impl/src/test/resources/jndi.properties (rev 0)
+++ modules/resteasy/trunk/impl/src/test/resources/jndi.properties 2010-06-08 13:31:37 UTC (rev 13082)
@@ -0,0 +1,3 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.factory.url.pkgs=org.jboss.naming\:org.jnp.interfaces
+java.naming.provider.url=jnp\://localhost\:1099
Added: modules/resteasy/trunk/impl/src/test/resources/org/jboss/seam/resteasy/test/configuration/web.xml
===================================================================
--- modules/resteasy/trunk/impl/src/test/resources/org/jboss/seam/resteasy/test/configuration/web.xml (rev 0)
+++ modules/resteasy/trunk/impl/src/test/resources/org/jboss/seam/resteasy/test/configuration/web.xml 2010-06-08 13:31:37 UTC (rev 13082)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.5" 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://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+ <context-param>
+ <param-name>resteasy.scan</param-name>
+ <param-value>false</param-value>
+ </context-param>
+
+ <listener>
+ <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>Resteasy</servlet-name>
+ <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Resteasy</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
\ No newline at end of file
Added: modules/resteasy/trunk/impl/src/test/resources/org/jboss/seam/resteasy/test/validation/beans.xml
===================================================================
--- modules/resteasy/trunk/impl/src/test/resources/org/jboss/seam/resteasy/test/validation/beans.xml (rev 0)
+++ modules/resteasy/trunk/impl/src/test/resources/org/jboss/seam/resteasy/test/validation/beans.xml 2010-06-08 13:31:37 UTC (rev 13082)
@@ -0,0 +1,9 @@
+<?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://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+ <interceptors>
+ <class>org.jboss.seam.resteasy.validation.ValidationInterceptor</class>
+ </interceptors>
+</beans>
Added: modules/resteasy/trunk/pom.xml
===================================================================
--- modules/resteasy/trunk/pom.xml (rev 0)
+++ modules/resteasy/trunk/pom.xml 2010-06-08 13:31:37 UTC (rev 13082)
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project 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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>seam-parent</artifactId>
+ <version>1</version>
+ </parent>
+
+ <groupId>org.jboss.seam.resteasy</groupId>
+ <artifactId>seam-resteasy-parent</artifactId>
+ <name>Seam RESTEasy Module</name>
+ <version>3.0.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <properties>
+ <seam.version>3.0.0.b01</seam.version>
+ </properties>
+
+ <url>http://www.seamframework.org</url>
+
+ <developers>
+ <developer>
+ <name>Jozef Hartinger</name>
+ <email>jharting(a)redhat.com</email>
+ <timezone>GMT+1</timezone>
+ <roles>
+ <role>Module Lead</role>
+ </roles>
+ </developer>
+ </developers>
+
+ <modules>
+ <module>api</module>
+ <module>impl</module>
+ </modules>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>seam</artifactId>
+ <version>${seam.version}</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <!-- CDI (JSR-299) -->
+ <dependency>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <!-- Bean validation -->
+ <dependency>
+ <groupId>javax.validation</groupId>
+ <artifactId>validation-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <!-- Interceptors -->
+ <dependency>
+ <groupId>org.jboss.spec.javax.interceptor</groupId>
+ <artifactId>jboss-interceptors-api_1.1_spec</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <!-- RESTEasy -->
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxrs</artifactId>
+ <version>2.0-beta-3-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ <!-- Required until the Servlet 3.0 API can be resolved in Central -->
+ <dependency>
+ <groupId>org.jboss.spec.javax.servlet</groupId>
+ <artifactId>jboss-servlet-api_3.0_spec</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <!-- Test dependencies -->
+ <dependency>
+ <groupId>org.jboss.arquillian</groupId>
+ <artifactId>arquillian-testng</artifactId>
+ <version>${arquillian.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.arquillian.container</groupId>
+ <artifactId>arquillian-jbossas-remote-60</artifactId>
+ <version>${arquillian.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-client</artifactId>
+ <version>6.0.0.20100429-M3</version>
+ <type>pom</type>
+ </dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>3.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <classifier>jdk15</classifier>
+ <version>5.10</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <!-- We need test dependencies on server's classpath until ARQ-165 is resolved -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <configuration>
+ <includeArtifactIds>arquillian-testng,arquillian-api,arquillian-spi,commons-httpclient,testng,shrinkwrap-api,shrinkwrap-impl-base,resteasy-jaxrs</includeArtifactIds>
+ <outputDirectory>${basedir}/test-dependencies</outputDirectory>
+ </configuration>
+ </plugin>
+ <!-- Remove test-dependencies -->
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>${basedir}/test-dependencies</directory>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/seam/modules/resteasy/trunk</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/seam/modules/resteasy/trunk</developerConnection>
+ <url>http://fisheye.jboss.org/browse/Seam/modules/resteasy/trunk</url>
+ </scm>
+</project>
Added: modules/resteasy/trunk/readme.txt
===================================================================
--- modules/resteasy/trunk/readme.txt (rev 0)
+++ modules/resteasy/trunk/readme.txt 2010-06-08 13:31:37 UTC (rev 13082)
@@ -0,0 +1,4 @@
+seam-resteasy
+=============
+
+TODO
14 years
Seam SVN: r13081 - branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-06-08 03:51:44 -0400 (Tue, 08 Jun 2010)
New Revision: 13081
Modified:
branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/Getting_Started_With_JBoss_Tools.xml
Log:
JBPAPP-3818 - changed JBoss Tools to JBDS
Modified: branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/Getting_Started_With_JBoss_Tools.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/Getting_Started_With_JBoss_Tools.xml 2010-06-08 01:11:25 UTC (rev 13080)
+++ branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/Getting_Started_With_JBoss_Tools.xml 2010-06-08 07:51:44 UTC (rev 13081)
@@ -626,8 +626,8 @@
</itemizedlist>
<para>
- If you create a WAR project using JBoss Tools, incremental hot deployment
- is available out of the box. However, JBoss Tools
+ If you create a WAR project using JBoss Developer Studio, incremental hot deployment
+ is available out of the box. However, JBoss Developer Studio
does not support incremental hot deployment for EAR projects.
</para>
</section>
14 years
Seam SVN: r13080 - in modules/security/trunk: impl/src/main/java/org/jboss/seam/security/management and 1 other directories.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-06-07 21:11:25 -0400 (Mon, 07 Jun 2010)
New Revision: 13080
Removed:
modules/security/trunk/api/src/main/java/org/jboss/seam/security/management/IdentityStore.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/PicketLinkIdentityStore.java
Modified:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagerImpl.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
Log:
use picketlink identitystore api
Deleted: modules/security/trunk/api/src/main/java/org/jboss/seam/security/management/IdentityStore.java
===================================================================
--- modules/security/trunk/api/src/main/java/org/jboss/seam/security/management/IdentityStore.java 2010-06-07 17:23:29 UTC (rev 13079)
+++ modules/security/trunk/api/src/main/java/org/jboss/seam/security/management/IdentityStore.java 2010-06-08 01:11:25 UTC (rev 13080)
@@ -1,256 +0,0 @@
-package org.jboss.seam.security.management;
-
-import java.io.Serializable;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.picketlink.idm.api.Credential;
-import org.picketlink.idm.api.Group;
-import org.picketlink.idm.api.IdentityType;
-import org.picketlink.idm.api.Role;
-
-/**
- * The identity store does the actual work of persisting user accounts and roles in a
- * database, LDAP directory, etc.
- *
- * @author Shane Bryzak
- */
-public interface IdentityStore
-{
- public enum Feature { createUser, deleteUser, enableUser, disableUser,
- changePassword, createRole, deleteRole, grantRole, revokeRole,
- createGroup, addToGroup, removeFromGroup, deleteGroup }
-
- /**
- * Represents a set of optional features that an IdentityStore implementation might support.
- */
- public class FeatureSet implements Serializable
- {
- private static final long serialVersionUID = 1100272929055626911L;
-
- private Set<Feature> features;
-
- public FeatureSet()
- {
- this(null);
- }
-
- public FeatureSet(Set<Feature> features)
- {
- if (features != null)
- {
- this.features = features;
- }
- else
- {
- this.features = new HashSet<Feature>();
- }
- }
-
- public Set<Feature> getFeatures()
- {
- return features;
- }
-
- public boolean supports(Feature feature)
- {
- return features.contains(feature);
- }
-
- public void addFeature(Feature feature)
- {
- features.add(feature);
- }
-
- public void removeFeature(Feature feature)
- {
- features.remove(feature);
- }
-
- public void enableAll()
- {
- for (Feature f : Feature.values()) addFeature(f);
- }
- }
-
- /**
- * Returns true if the IdentityStore implementation supports the specified feature.
- *
- */
- boolean supportsFeature(Feature feature);
-
- /**
- * Creates a new user with the specified username and credential.
- * @return true if the user was successfully created.
- */
- boolean createUser(String username, Credential credential, Map<String,?> attributes);
-
- /**
- * Deletes the user with the specified username.
- * @return true if the user was successfully deleted.
- */
- boolean deleteUser(String username);
-
- /**
- * Enables the user with the specified username. Enabled users are able to authenticate.
- * @return true if the specified user was successfully enabled.
- */
- boolean enableUser(String username);
-
- /**
- * Disables the user with the specified username. Disabled users are unable to authenticate.
- * @return true if the specified user was successfully disabled.
- */
- boolean disableUser(String username);
-
- /**
- * Returns true if the specified user is enabled.
- */
- boolean isUserEnabled(String username);
-
- /**
- * Updates the credential of the specified user.
- * @return true if the user's credential was successfully changed.
- */
- boolean updateCredential(String username, Credential credential);
-
- /**
- * Returns true if the specified user exists.
- */
- boolean userExists(String username);
-
- /**
- *
- * @param username
- * @param attribute
- * @param value
- * @return
- */
- boolean setUserAttribute(String username, String attribute, Object value);
-
- /**
- *
- * @param username
- * @param attribute
- * @return
- */
- boolean deleteUserAttribute(String username, String attribute);
-
- /**
- * Creates a new role type with the specified role type name.
- * @return true if the role type was created successfully.
- */
- boolean createRoleType(String roleType);
-
- /**
- * Grants the specified role to the specified user.
- *
- * @param name The name of the user
- * @param roleType The name of the role type to grant to the user.
- * @param groupName The name of the group to grant the role in
- * @param groupType The group type
- * @return true if the role was successfully granted.
- */
- boolean grantRole(String username, String roleType, String groupName, String groupType);
-
- /**
- * Revokes the specified role from the specified user.
- *
- * @param name The name of the user
- * @param roleType The name of the role type to revoke from the user.
- * @param groupName The name of the group which contains the user role
- * @param groupType The group type
- * @return true if the role was successfully revoked.
- */
- boolean revokeRole(String username, String roleType, String groupName, String groupType);
-
- /**
- * Deletes the specified role type.
- * @return true if the role type was successfully deleted.
- */
- boolean deleteRoleType(String roleType);
-
- /**
- * Returns true if the specified role type exists.
- */
- boolean roleTypeExists(String roleType);
-
- /**
- * Creates a new group with the specified name
- *
- * @param name The name of the group
- * @return true if the group was created successfully
- */
- boolean createGroup(String name, String groupType);
-
- boolean associateUser(String groupName, String groupType, String username);
-
- boolean disassociateUser(String groupName, String groupType, String username);
-
- boolean associateGroup(String groupName, String groupType, String memberGroupName, String memberGroupType);
-
- boolean disassociateGroup(String groupName, String groupType, String memberGroupName, String memberGroupType);
-
- /**
- * Deletes the specified group
- *
- * @param group The name of the group to delete
- * @return true if the group was successfully deleted
- */
- boolean deleteGroup(String name, String groupType);
-
- /**
- *
- * @param name
- * @param type
- * @return
- */
- Group findGroup(String name, String groupType);
-
- /**
- * Returns a list of all user names containing the specified filter text within their username.
- */
- List<String> findUsers(String filter);
-
- /**
- * Returns a list of all the role types.
- */
- List<String> listRoleTypes();
-
- /**
- * Returns a list of role types that can be granted (i.e, excluding conditional roles)
- */
- List<String> listGrantableRoleTypes();
-
- /**
- * Returns a list of all the roles explicitly granted to the specified user.
- */
- List<Role> listGrantedRoles(String username);
-
- /**
- * Returns a list of all roles that the specified user is a member of. This list may contain
- * roles that may not have been explicitly granted to the user, which are indirectly implied
- * due to role memberships.
-
- */
- List<Role> listImpliedRoles(String username);
-
- /**
- * Lists the members of the specified role
- */
- List<IdentityType> listRoleMembers(String roleType, String groupName, String groupType);
-
- /**
- * Lists the members of the specified group
- */
- List<IdentityType> listGroupMembers(Group group);
-
- /**
- * Authenticates the specified user, using the specified credential.
- *
- * @return true if authentication is successful.
- */
- boolean authenticate(String username, Credential credential);
-}
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagerImpl.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagerImpl.java 2010-06-07 17:23:29 UTC (rev 13079)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagerImpl.java 2010-06-08 01:11:25 UTC (rev 13080)
@@ -1,8 +1,6 @@
package org.jboss.seam.security.management;
import java.io.Serializable;
-import java.util.Collections;
-import java.util.Comparator;
import java.util.List;
import javax.annotation.PostConstruct;
@@ -14,7 +12,6 @@
import org.jboss.seam.security.Identity;
import org.jboss.seam.security.util.Strings;
import org.picketlink.idm.api.Credential;
-import org.picketlink.idm.api.Group;
import org.picketlink.idm.api.IdentityType;
import org.picketlink.idm.api.Role;
import org.slf4j.Logger;
@@ -44,101 +41,94 @@
@Inject BeanManager manager;
@Inject Identity identity;
- protected IdentityStore identityStore;
- protected IdentityStore roleIdentityStore;
- protected IdentityStore groupIdentityStore;
-
@PostConstruct
public void create()
{
- if (roleIdentityStore == null && identityStore != null)
- {
- roleIdentityStore = identityStore;
- }
- if (identityStore == null)
- {
- log.warn("No identity store available - please configure an identityStore if identity " +
- "management is required.");
- }
-
- if (roleIdentityStore == null)
- {
- log.warn("No role identity store available - please configure a roleIdentityStore if identity " +
- "management is required.");
- }
}
public boolean createUser(String name, Credential credential)
{
identity.checkPermission(USER_PERMISSION_NAME, PERMISSION_CREATE);
- return identityStore.createUser(name, credential, null);
+ //return identityStore.createUser(name, credential, null);
+ return false;
}
public boolean deleteUser(String name)
{
identity.checkPermission(USER_PERMISSION_NAME, PERMISSION_DELETE);
- return identityStore.deleteUser(name);
+ //return identityStore.deleteUser(name);
+ return false;
}
public boolean enableUser(String name)
{
identity.checkPermission(USER_PERMISSION_NAME, PERMISSION_UPDATE);
- return identityStore.enableUser(name);
+ //return identityStore.enableUser(name);
+ return false;
}
public boolean disableUser(String name)
{
identity.checkPermission(USER_PERMISSION_NAME, PERMISSION_UPDATE);
- return identityStore.disableUser(name);
+ //return identityStore.disableUser(name);
+ return false;
}
public boolean updateCredential(String name, Credential credential)
{
identity.checkPermission(USER_PERMISSION_NAME, PERMISSION_UPDATE);
- return identityStore.updateCredential(name, credential);
+ //return identityStore.updateCredential(name, credential);
+ return false;
}
public boolean isUserEnabled(String name)
{
identity.checkPermission(USER_PERMISSION_NAME, PERMISSION_READ);
- return identityStore.isUserEnabled(name);
+ //return identityStore.isUserEnabled(name);
+ return false;
}
public boolean setUserAttribute(String username, String attribute, Object value)
{
identity.checkPermission(USER_PERMISSION_NAME, PERMISSION_UPDATE);
- return identityStore.setUserAttribute(username, attribute, value);
+ //return identityStore.setUserAttribute(username, attribute, value);
+ return false;
}
public boolean deleteUserAttribute(String username, String attribute)
{
identity.checkPermission(USER_PERMISSION_NAME, PERMISSION_UPDATE);
- return identityStore.deleteUserAttribute(username, attribute);
+ //return identityStore.deleteUserAttribute(username, attribute);
+ return false;
}
public boolean grantRole(String name, String role, String groupName, String groupType)
{
identity.checkPermission(USER_PERMISSION_NAME, PERMISSION_UPDATE);
- return roleIdentityStore.grantRole(name, role, groupName, groupType);
+ //return roleIdentityStore.grantRole(name, role, groupName, groupType);
+ return false;
}
public boolean revokeRole(String name, String role, String groupName, String groupType)
{
identity.checkPermission(USER_PERMISSION_NAME, PERMISSION_UPDATE);
- return roleIdentityStore.revokeRole(name, role, groupName, groupType);
+ //return roleIdentityStore.revokeRole(name, role, groupName, groupType);
+ return false;
}
public boolean associateUser(String groupName, String groupType, String username)
{
identity.checkPermission(USER_PERMISSION_NAME, PERMISSION_UPDATE);
- return identityStore.associateUser(groupName, groupType, username);
+ //return identityStore.associateUser(groupName, groupType, username);
+ return false;
}
public boolean disassociateUser(String groupName, String groupType, String username)
{
identity.checkPermission(USER_PERMISSION_NAME, PERMISSION_UPDATE);
- return identityStore.disassociateUser(groupName, groupType, username);
+ //return identityStore.disassociateUser(groupName, groupType, username);
+ return false;
}
public boolean associateGroup(String groupName, String groupType, String memberGroupName, String memberGroupType)
@@ -154,77 +144,65 @@
public boolean createRoleType(String roleType)
{
identity.checkPermission(ROLE_PERMISSION_NAME, PERMISSION_CREATE);
- return roleIdentityStore.createRoleType(roleType);
+ //return roleIdentityStore.createRoleType(roleType);
+ return false;
}
public boolean deleteRoleType(String roleType)
{
identity.checkPermission(ROLE_PERMISSION_NAME, PERMISSION_DELETE);
- return roleIdentityStore.deleteRoleType(roleType);
+ //return roleIdentityStore.deleteRoleType(roleType);
+ return false;
}
public boolean createGroup(String groupName, String groupType)
{
identity.checkPermission(GROUP_PERMISSION_NAME, PERMISSION_CREATE);
- return groupIdentityStore.createGroup(groupName, groupType);
+ //return groupIdentityStore.createGroup(groupName, groupType);
+ return false;
}
public boolean deleteGroup(String groupName, String groupType)
{
identity.checkPermission(GROUP_PERMISSION_NAME, PERMISSION_DELETE);
- return groupIdentityStore.deleteGroup(groupName, groupType);
+ //return groupIdentityStore.deleteGroup(groupName, groupType);
+ return false;
}
public boolean userExists(String name)
{
identity.checkPermission(USER_PERMISSION_NAME, PERMISSION_READ);
- return identityStore.userExists(name);
+ //return identityStore.userExists(name);
+ return false;
}
public boolean roleTypeExists(String roleType)
{
- return roleIdentityStore.roleTypeExists(roleType);
+ //return roleIdentityStore.roleTypeExists(roleType);
+ return false;
}
public List<String> findUsers(String filter)
{
identity.checkPermission(USER_PERMISSION_NAME, PERMISSION_READ);
- List<String> users = identityStore.findUsers(filter);
+ //List<String> users = identityStore.findUsers(filter);
- Collections.sort(users, new Comparator<String>() {
- public int compare(String value1, String value2) {
- return value1.compareTo(value2);
- }
- });
-
- return users;
+ return null;
}
public List<String> listRoleTypes()
{
identity.checkPermission(ROLE_PERMISSION_NAME, PERMISSION_READ);
- List<String> roles = roleIdentityStore.listRoleTypes();
+ //List<String> roles = roleIdentityStore.listRoleTypes();
- Collections.sort(roles, new Comparator<String>() {
- public int compare(String value1, String value2) {
- return value1.compareTo(value2);
- }
- });
-
- return roles;
+ return null;
}
public List<String> getGrantableRoles()
{
- List<String> roles = roleIdentityStore.listGrantableRoleTypes();
+ //List<String> roles = roleIdentityStore.listGrantableRoleTypes();
- Collections.sort(roles, new Comparator<String>() {
- public int compare(String value1, String value2) {
- return value1.compareTo(value2);
- }
- });
-
- return roles;
+ return null;
}
/**
@@ -235,7 +213,8 @@
*/
public List<Role> getGrantedRoles(String username)
{
- return roleIdentityStore.listGrantedRoles(username);
+ //return roleIdentityStore.listGrantedRoles(username);
+ return null;
}
/**
@@ -246,43 +225,23 @@
*/
public List<Role> getImpliedRoles(String username)
{
- return roleIdentityStore.listImpliedRoles(username);
+ //return roleIdentityStore.listImpliedRoles(username);
+ return null;
}
public List<IdentityType> listRoleMembers(String roleType, String groupName, String groupType)
{
identity.checkPermission(ROLE_PERMISSION_NAME, PERMISSION_READ);
- return roleIdentityStore.listRoleMembers(roleType, groupName, groupType);
+ //return roleIdentityStore.listRoleMembers(roleType, groupName, groupType);
+ return null;
}
public boolean authenticate(String username, Credential credential)
{
if (Strings.isEmpty(username)) return false;
- return identityStore.authenticate(username, credential);
+ //return identityStore.authenticate(username, credential);
+ return false;
}
- public IdentityStore getIdentityStore()
- {
- return identityStore;
- }
-
- public void setIdentityStore(IdentityStore identityStore)
- {
- this.identityStore = identityStore;
- }
-
- public IdentityStore getRoleIdentityStore()
- {
- return roleIdentityStore;
- }
-
- public void setRoleIdentityStore(IdentityStore roleIdentityStore)
- {
- this.roleIdentityStore = roleIdentityStore;
- }
-
- public boolean isEnabled()
- {
- return identityStore != null && roleIdentityStore != null;
- }
+
}
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2010-06-07 17:23:29 UTC (rev 13079)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2010-06-08 01:11:25 UTC (rev 13080)
@@ -3,9 +3,11 @@
import java.io.Serializable;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
+import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Instance;
@@ -25,8 +27,23 @@
import org.picketlink.idm.api.Group;
import org.picketlink.idm.api.IdentityType;
import org.picketlink.idm.api.Role;
+import org.picketlink.idm.common.exception.IdentityException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.picketlink.idm.spi.configuration.IdentityStoreConfigurationContext;
+import org.picketlink.idm.spi.configuration.metadata.IdentityObjectAttributeMetaData;
+import org.picketlink.idm.spi.exception.OperationNotSupportedException;
+import org.picketlink.idm.spi.model.IdentityObject;
+import org.picketlink.idm.spi.model.IdentityObjectAttribute;
+import org.picketlink.idm.spi.model.IdentityObjectCredential;
+import org.picketlink.idm.spi.model.IdentityObjectRelationship;
+import org.picketlink.idm.spi.model.IdentityObjectRelationshipType;
+import org.picketlink.idm.spi.model.IdentityObjectType;
+import org.picketlink.idm.spi.search.IdentityObjectSearchCriteria;
+import org.picketlink.idm.spi.store.FeaturesMetaData;
+import org.picketlink.idm.spi.store.IdentityStore;
+import org.picketlink.idm.spi.store.IdentityStoreInvocationContext;
+import org.picketlink.idm.spi.store.IdentityStoreSession;
/**
* IdentityStore implementation that allows identity related data to be
@@ -34,7 +51,7 @@
*
* @author Shane Bryzak
*/
-public @ApplicationScoped class JpaIdentityStore implements IdentityStore, Serializable
+public @ApplicationScoped class JpaIdentityStore implements org.picketlink.idm.spi.store.IdentityStore, Serializable
{
private static final long serialVersionUID = 7729139146633529501L;
@@ -65,6 +82,7 @@
private static final String PROPERTY_RELATIONSHIP_NAME = "RELATIONSHIP_NAME";
private static final String PROPERTY_ATTRIBUTE_NAME = "ATTRIBUTE_NAME";
private static final String PROPERTY_ATTRIBUTE_VALUE = "ATTRIBUTE_VALUE";
+ private static final String PROPERTY_ROLE_TYPE_NAME = "ROLE_TYPE_NAME";
// Entity classes
@@ -682,12 +700,41 @@
p);
}
- // TODO scan any entity classes referenced by the identity class also
+ // scan any entity classes referenced by the identity class also
+ props = PropertyQueries.createQuery(identityClass)
+ .getResultList();
+
+ for (Property<Object> p : props)
+ {
+ if (p.getJavaClass().isAnnotationPresent(Entity.class))
+ {
+ List<Property<Object>> pp = PropertyQueries.createQuery(p.getJavaClass())
+ .addCriteria(new PropertyTypeCriteria(PropertyType.ATTRIBUTE))
+ .getResultList();
+
+ for (Property<Object> attributeProperty : pp)
+ {
+ attributeProperties.put(
+ attributeProperty.getAnnotatedElement().getAnnotation(IdentityProperty.class).attributeName(),
+ attributeProperty);
+ }
+ }
+ }
}
protected void configureRoleTypeNames()
{
-
+ if (roleTypeClass != null)
+ {
+ List<Property<Object>> props = PropertyQueries.createQuery(roleTypeClass)
+ .addCriteria(new PropertyTypeCriteria(PropertyType.NAME))
+ .getResultList();
+
+ if (props.size() == 1)
+ {
+ modelProperties.put(PROPERTY_ROLE_TYPE_NAME, props.get(0));
+ }
+ }
}
public String getUserIdentityType()
@@ -760,10 +807,10 @@
throw new IdentityManagementException("Could not create user, identityObjectEntity not set.");
}
- if (userExists(username))
- {
- log.warn("Could not create user, already exists.");
- }
+ //if (userExists(username))
+ //{
+ // log.warn("Could not create user, already exists.");
+ //}
Object userInstance = identityClass.newInstance();
Object credentialInstance = null;
@@ -842,178 +889,307 @@
}
}
- public boolean associateUser(String groupName, String groupType, String username)
+ public void bootstrap(IdentityStoreConfigurationContext configurationContext)
+ throws IdentityException
{
- return false;
+ // TODO Auto-generated method stub
+
}
-
- public boolean disassociateUser(String groupName, String groupType, String username)
+
+ public IdentityObject createIdentityObject(
+ IdentityStoreInvocationContext invocationCtx, String name,
+ IdentityObjectType identityObjectType) throws IdentityException
{
- return false;
+ // TODO Auto-generated method stub
+ return null;
}
-
- public boolean associateGroup(String groupName, String groupType, String memberGroupName, String memberGroupType)
+
+ public IdentityObject createIdentityObject(
+ IdentityStoreInvocationContext invocationCtx, String name,
+ IdentityObjectType identityObjectType, Map<String, String[]> attributes)
+ throws IdentityException
{
- return false;
+ // TODO Auto-generated method stub
+ return null;
}
-
- public boolean disassociateGroup(String groupName, String groupType, String memberGroupName, String memberGroupType)
+
+ public IdentityObjectRelationship createRelationship(
+ IdentityStoreInvocationContext invocationCxt,
+ IdentityObject fromIdentity, IdentityObject toIdentity,
+ IdentityObjectRelationshipType relationshipType,
+ String relationshipName, boolean createNames) throws IdentityException
{
- return false;
+ // TODO Auto-generated method stub
+ return null;
}
- public boolean authenticate(String username, Credential credential)
+ public String createRelationshipName(IdentityStoreInvocationContext ctx,
+ String name) throws IdentityException, OperationNotSupportedException
{
// TODO Auto-generated method stub
- return false;
+ return null;
}
- public boolean createGroup(String name, String groupType)
+ public IdentityObject findIdentityObject(
+ IdentityStoreInvocationContext invocationContext, String id)
+ throws IdentityException
{
// TODO Auto-generated method stub
- return false;
+ return null;
}
- public boolean createRoleType(String roleType)
+ public IdentityObject findIdentityObject(
+ IdentityStoreInvocationContext invocationContext, String name,
+ IdentityObjectType identityObjectType) throws IdentityException
{
// TODO Auto-generated method stub
- return false;
+ return null;
}
- public boolean deleteGroup(String name, String groupType)
+ public Collection<IdentityObject> findIdentityObject(
+ IdentityStoreInvocationContext invocationCtx,
+ IdentityObjectType identityType, IdentityObjectSearchCriteria criteria)
+ throws IdentityException
{
// TODO Auto-generated method stub
- return false;
+ return null;
}
- public boolean deleteRoleType(String roleType)
+ public Collection<IdentityObject> findIdentityObject(
+ IdentityStoreInvocationContext invocationCxt, IdentityObject identity,
+ IdentityObjectRelationshipType relationshipType, boolean parent,
+ IdentityObjectSearchCriteria criteria) throws IdentityException
{
// TODO Auto-generated method stub
- return false;
+ return null;
}
- public boolean deleteUser(String username)
+ public String getId()
{
// TODO Auto-generated method stub
- return false;
+ return null;
}
- public boolean deleteUserAttribute(String username, String attribute)
+ public int getIdentityObjectsCount(
+ IdentityStoreInvocationContext invocationCtx,
+ IdentityObjectType identityType) throws IdentityException
{
// TODO Auto-generated method stub
- return false;
+ return 0;
}
- public boolean disableUser(String username)
+ public Map<String, String> getRelationshipNameProperties(
+ IdentityStoreInvocationContext ctx, String name)
+ throws IdentityException, OperationNotSupportedException
{
// TODO Auto-generated method stub
- return false;
+ return null;
}
- public boolean enableUser(String username)
+ public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx,
+ IdentityObjectSearchCriteria criteria) throws IdentityException,
+ OperationNotSupportedException
{
// TODO Auto-generated method stub
- return false;
+ return null;
}
- public Group findGroup(String name, String groupType)
+ public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx,
+ IdentityObject identity, IdentityObjectSearchCriteria criteria)
+ throws IdentityException, OperationNotSupportedException
{
// TODO Auto-generated method stub
return null;
}
- public List<String> findUsers(String filter)
+ public Map<String, String> getRelationshipProperties(
+ IdentityStoreInvocationContext ctx,
+ IdentityObjectRelationship relationship) throws IdentityException,
+ OperationNotSupportedException
{
// TODO Auto-generated method stub
return null;
}
- public boolean grantRole(String username, String roleType, String groupName,
- String groupType)
+ public FeaturesMetaData getSupportedFeatures()
{
// TODO Auto-generated method stub
- return false;
+ return null;
}
- public boolean isUserEnabled(String username)
+ public void removeIdentityObject(
+ IdentityStoreInvocationContext invocationCtx, IdentityObject identity)
+ throws IdentityException
{
// TODO Auto-generated method stub
- return false;
+
}
- public List<String> listGrantableRoleTypes()
+ public void removeRelationship(IdentityStoreInvocationContext invocationCxt,
+ IdentityObject fromIdentity, IdentityObject toIdentity,
+ IdentityObjectRelationshipType relationshipType,
+ String relationshipName) throws IdentityException
{
// TODO Auto-generated method stub
- return null;
+
}
- public List<Role> listGrantedRoles(String username)
+ public String removeRelationshipName(IdentityStoreInvocationContext ctx,
+ String name) throws IdentityException, OperationNotSupportedException
{
// TODO Auto-generated method stub
return null;
}
- public List<IdentityType> listGroupMembers(Group group)
+ public void removeRelationshipNameProperties(
+ IdentityStoreInvocationContext ctx, String name, Set<String> properties)
+ throws IdentityException, OperationNotSupportedException
{
// TODO Auto-generated method stub
+
+ }
+
+ public void removeRelationshipProperties(IdentityStoreInvocationContext ctx,
+ IdentityObjectRelationship relationship, Set<String> properties)
+ throws IdentityException, OperationNotSupportedException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void removeRelationships(
+ IdentityStoreInvocationContext invocationCtx,
+ IdentityObject identity1, IdentityObject identity2, boolean named)
+ throws IdentityException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public Set<IdentityObjectRelationship> resolveRelationships(
+ IdentityStoreInvocationContext invocationCxt,
+ IdentityObject fromIdentity, IdentityObject toIdentity,
+ IdentityObjectRelationshipType relationshipType)
+ throws IdentityException
+ {
+ // TODO Auto-generated method stub
return null;
}
- public List<Role> listImpliedRoles(String username)
+ public Set<IdentityObjectRelationship> resolveRelationships(
+ IdentityStoreInvocationContext invocationCxt, IdentityObject identity,
+ IdentityObjectRelationshipType relationshipType, boolean parent,
+ boolean named, String name) throws IdentityException
{
// TODO Auto-generated method stub
return null;
}
- public List<IdentityType> listRoleMembers(String roleType, String groupName,
- String groupType)
+ public void setRelationshipNameProperties(
+ IdentityStoreInvocationContext ctx, String name,
+ Map<String, String> properties) throws IdentityException,
+ OperationNotSupportedException
{
// TODO Auto-generated method stub
+
+ }
+
+ public void setRelationshipProperties(IdentityStoreInvocationContext ctx,
+ IdentityObjectRelationship relationship, Map<String, String> properties)
+ throws IdentityException, OperationNotSupportedException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void updateCredential(IdentityStoreInvocationContext ctx,
+ IdentityObject identityObject, IdentityObjectCredential credential)
+ throws IdentityException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public boolean validateCredential(IdentityStoreInvocationContext ctx,
+ IdentityObject identityObject, IdentityObjectCredential credential)
+ throws IdentityException
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public void addAttributes(IdentityStoreInvocationContext invocationCtx,
+ IdentityObject identity, IdentityObjectAttribute[] attributes)
+ throws IdentityException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public IdentityObject findIdentityObjectByUniqueAttribute(
+ IdentityStoreInvocationContext invocationCtx,
+ IdentityObjectType identityObjectType,
+ IdentityObjectAttribute attribute) throws IdentityException
+ {
+ // TODO Auto-generated method stub
return null;
}
- public List<String> listRoleTypes()
+ public IdentityObjectAttribute getAttribute(
+ IdentityStoreInvocationContext invocationContext,
+ IdentityObject identity, String name) throws IdentityException
{
// TODO Auto-generated method stub
return null;
}
- public boolean revokeRole(String username, String roleType,
- String groupName, String groupType)
+ public Map<String, IdentityObjectAttribute> getAttributes(
+ IdentityStoreInvocationContext invocationContext,
+ IdentityObject identity) throws IdentityException
{
// TODO Auto-generated method stub
- return false;
+ return null;
}
- public boolean roleTypeExists(String roleType)
+ public Map<String, IdentityObjectAttributeMetaData> getAttributesMetaData(
+ IdentityStoreInvocationContext invocationContext,
+ IdentityObjectType identityType)
{
// TODO Auto-generated method stub
- return false;
+ return null;
}
- public boolean setUserAttribute(String username, String attribute,
- Object value)
+ public Set<String> getSupportedAttributeNames(
+ IdentityStoreInvocationContext invocationContext,
+ IdentityObjectType identityType) throws IdentityException
{
// TODO Auto-generated method stub
- return false;
+ return null;
}
- public boolean supportsFeature(Feature feature)
+ public void removeAttributes(IdentityStoreInvocationContext invocationCtx,
+ IdentityObject identity, String[] attributeNames)
+ throws IdentityException
{
// TODO Auto-generated method stub
- return false;
+
}
- public boolean updateCredential(String username, Credential credential)
+ public void updateAttributes(IdentityStoreInvocationContext invocationCtx,
+ IdentityObject identity, IdentityObjectAttribute[] attributes)
+ throws IdentityException
{
// TODO Auto-generated method stub
- return false;
+
}
- public boolean userExists(String username)
+ public IdentityStoreSession createIdentityStoreSession()
+ throws IdentityException
{
// TODO Auto-generated method stub
- return false;
- }
+ return null;
+ }
+
+
}
Deleted: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/PicketLinkIdentityStore.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/PicketLinkIdentityStore.java 2010-06-07 17:23:29 UTC (rev 13079)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/PicketLinkIdentityStore.java 2010-06-08 01:11:25 UTC (rev 13080)
@@ -1,211 +0,0 @@
-package org.jboss.seam.security.management.picketlink;
-
-import java.util.List;
-import java.util.Map;
-
-import javax.enterprise.context.Dependent;
-import javax.inject.Inject;
-
-import org.jboss.seam.security.management.IdentityStore;
-import org.picketlink.idm.api.Credential;
-import org.picketlink.idm.api.Group;
-import org.picketlink.idm.api.IdentitySession;
-import org.picketlink.idm.api.IdentityType;
-import org.picketlink.idm.api.Role;
-
-@Dependent
-public class PicketLinkIdentityStore implements IdentityStore
-{
- @Inject IdentitySession identitySession;
-
- public boolean associateGroup(String groupName, String groupType,
- String memberGroupName, String memberGroupType)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean associateUser(String groupName, String groupType,
- String username)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean authenticate(String username, Credential credential)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean createGroup(String name, String groupType)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean createRoleType(String roleType)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean createUser(String username, Credential credential,
- Map<String, ?> attributes)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean deleteGroup(String name, String groupType)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean deleteRoleType(String roleType)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean deleteUser(String username)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean deleteUserAttribute(String username, String attribute)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean disableUser(String username)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean disassociateGroup(String groupName, String groupType,
- String memberGroupName, String memberGroupType)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean disassociateUser(String groupName, String groupType,
- String username)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean enableUser(String username)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public Group findGroup(String name, String groupType)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public List<String> findUsers(String filter)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public boolean grantRole(String username, String roleType, String groupName,
- String groupType)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean isUserEnabled(String username)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public List<String> listGrantableRoleTypes()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public List<Role> listGrantedRoles(String username)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public List<IdentityType> listGroupMembers(Group group)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public List<Role> listImpliedRoles(String username)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public List<IdentityType> listRoleMembers(String roleType, String groupName,
- String groupType)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public List<String> listRoleTypes()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public boolean revokeRole(String username, String roleType,
- String groupName, String groupType)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean roleTypeExists(String roleType)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean setUserAttribute(String username, String attribute,
- Object value)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean supportsFeature(Feature feature)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean updateCredential(String username, Credential credential)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean userExists(String username)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
-
-}
14 years
Seam SVN: r13079 - in modules/faces/branches/exception_handling: docs/reference and 3 other directories.
by seam-commits@lists.jboss.org
Author: lightguard
Date: 2010-06-07 13:23:29 -0400 (Mon, 07 Jun 2010)
New Revision: 13079
Added:
modules/faces/branches/exception_handling/docs/reference/src/main/assembly/
modules/faces/branches/exception_handling/docs/reference/src/main/assembly/assembly.xml
Removed:
modules/faces/branches/exception_handling/docs/reference/src/main/assembly/assembly.xml
Modified:
modules/faces/branches/exception_handling/
modules/faces/branches/exception_handling/docs/reference/pom.xml
modules/faces/branches/exception_handling/docs/reference/src/main/docbook/en-US/installation.xml
modules/faces/branches/exception_handling/docs/reference/src/main/docbook/en-US/messages.xml
Log:
Merged revisions 13058-13059,13065 via svnmerge from
https://svn.jboss.org/repos/seam/modules/faces/trunk
.......
r13058 | pete.muir(a)jboss.org | 2010-06-04 15:22:58 -0600 (Fri, 04 Jun 2010) | 1 line
create a source distro for the ref guide
.......
r13059 | pete.muir(a)jboss.org | 2010-06-04 15:25:16 -0600 (Fri, 04 Jun 2010) | 1 line
minor
.......
r13065 | pete.muir(a)jboss.org | 2010-06-04 16:23:53 -0600 (Fri, 04 Jun 2010) | 1 line
namespace conflicting ids
.......
Property changes on: modules/faces/branches/exception_handling
___________________________________________________________________
Name: svnmerge-integrated
- /modules/faces/trunk:1-13056
+ /modules/faces/trunk:1-13078
Modified: modules/faces/branches/exception_handling/docs/reference/pom.xml
===================================================================
--- modules/faces/branches/exception_handling/docs/reference/pom.xml 2010-06-07 17:12:43 UTC (rev 13078)
+++ modules/faces/branches/exception_handling/docs/reference/pom.xml 2010-06-07 17:23:29 UTC (rev 13079)
@@ -51,4 +51,23 @@
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>distribution</id>
+ <activation>
+ <property>
+ <name>release</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
</project>
Copied: modules/faces/branches/exception_handling/docs/reference/src/main/assembly (from rev 13065, modules/faces/trunk/docs/reference/src/main/assembly)
Deleted: modules/faces/branches/exception_handling/docs/reference/src/main/assembly/assembly.xml
===================================================================
--- modules/faces/trunk/docs/reference/src/main/assembly/assembly.xml 2010-06-04 22:23:53 UTC (rev 13065)
+++ modules/faces/branches/exception_handling/docs/reference/src/main/assembly/assembly.xml 2010-06-07 17:23:29 UTC (rev 13079)
@@ -1,17 +0,0 @@
-<assembly
- xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
- <id>sources</id>
- <formats>
- <format>zip</format>
- </formats>
- <baseDirectory>${project.artifactId}</baseDirectory>
- <fileSets>
- <fileSet>
- <outputDirectory>.</outputDirectory>
- <directory>${project.basedir}/src/main/docbook/en-US</directory>
- <useDefaultExcludes>true</useDefaultExcludes>
- </fileSet>
- </fileSets>
-</assembly>
Copied: modules/faces/branches/exception_handling/docs/reference/src/main/assembly/assembly.xml (from rev 13065, modules/faces/trunk/docs/reference/src/main/assembly/assembly.xml)
===================================================================
--- modules/faces/branches/exception_handling/docs/reference/src/main/assembly/assembly.xml (rev 0)
+++ modules/faces/branches/exception_handling/docs/reference/src/main/assembly/assembly.xml 2010-06-07 17:23:29 UTC (rev 13079)
@@ -0,0 +1,17 @@
+<assembly
+ xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+ <id>sources</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <baseDirectory>${project.artifactId}</baseDirectory>
+ <fileSets>
+ <fileSet>
+ <outputDirectory>.</outputDirectory>
+ <directory>${project.basedir}/src/main/docbook/en-US</directory>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ </fileSet>
+ </fileSets>
+</assembly>
Modified: modules/faces/branches/exception_handling/docs/reference/src/main/docbook/en-US/installation.xml
===================================================================
--- modules/faces/branches/exception_handling/docs/reference/src/main/docbook/en-US/installation.xml 2010-06-07 17:12:43 UTC (rev 13078)
+++ modules/faces/branches/exception_handling/docs/reference/src/main/docbook/en-US/installation.xml 2010-06-07 17:23:29 UTC (rev 13079)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
-<chapter id="installation">
+<chapter id="faces.installation">
<title>Installation</title>
<para>
Most features of Seam Faces are installed automatically by including the seam-faces.jar and seam-faces-api.jar
Modified: modules/faces/branches/exception_handling/docs/reference/src/main/docbook/en-US/messages.xml
===================================================================
--- modules/faces/branches/exception_handling/docs/reference/src/main/docbook/en-US/messages.xml 2010-06-07 17:12:43 UTC (rev 13078)
+++ modules/faces/branches/exception_handling/docs/reference/src/main/docbook/en-US/messages.xml 2010-06-07 17:23:29 UTC (rev 13079)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
-<chapter id="messages">
+<chapter id="faces.messages">
<title>Messages API</title>
<para>
While JSF already has the concept of adding <literal>FacesMessage</literal> objects to the FacesContext in order for those messages to be
14 years
Seam SVN: r13077 - in modules/faces/branches/exception_handling/impl/src/main: resources/META-INF and 1 other directory.
by seam-commits@lists.jboss.org
Author: lightguard
Date: 2010-06-07 11:35:45 -0400 (Mon, 07 Jun 2010)
New Revision: 13077
Modified:
modules/faces/branches/exception_handling/impl/src/main/java/org/jboss/seam/exceptionhandling/SeamExceptionHandler.java
modules/faces/branches/exception_handling/impl/src/main/java/org/jboss/seam/exceptionhandling/SeamExceptionHandlerFactory.java
modules/faces/branches/exception_handling/impl/src/main/resources/META-INF/faces-config.xml
Log:
I got a little help, still not there yet though
Modified: modules/faces/branches/exception_handling/impl/src/main/java/org/jboss/seam/exceptionhandling/SeamExceptionHandler.java
===================================================================
--- modules/faces/branches/exception_handling/impl/src/main/java/org/jboss/seam/exceptionhandling/SeamExceptionHandler.java 2010-06-07 07:50:09 UTC (rev 13076)
+++ modules/faces/branches/exception_handling/impl/src/main/java/org/jboss/seam/exceptionhandling/SeamExceptionHandler.java 2010-06-07 15:35:45 UTC (rev 13077)
@@ -22,12 +22,20 @@
package org.jboss.seam.exceptionhandling;
+import org.jboss.seam.faces.util.BeanManagerUtils;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.util.TypeLiteral;
import javax.faces.FacesException;
import javax.faces.context.*;
import javax.faces.context.ExceptionHandler;
import javax.faces.event.ExceptionQueuedEvent;
import javax.inject.Inject;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Iterator;
import java.util.List;
@@ -35,43 +43,60 @@
public class SeamExceptionHandler extends ExceptionHandlerWrapper
{
- @Inject
private BeanManager beanManager;
+ private BeanManagerUtils managerUtils;
+
private ExceptionHandler wrapped;
- public SeamExceptionHandler()
+ public SeamExceptionHandler() throws NamingException
{
+ this.beanManager = (BeanManager) new InitialContext().lookup("java:comp/BeanManager");
+ this.managerUtils = new BeanManagerUtils();
}
- public SeamExceptionHandler(ExceptionHandler wrappedHandler)
+ public SeamExceptionHandler(ExceptionHandler wrappedHandler) throws NamingException
{
+ this();
this.wrapped = wrappedHandler;
}
@Override
public void handle() throws FacesException
{
- Set<?> beans;
+ Set<Bean<?>> beans;
ExceptionQueuedEvent event;
Throwable exception;
- Throwable realException;
+ HandlerChain chain;
+ FacesState state = this.managerUtils.getContextualInstance(this.beanManager, FacesStateImpl.class);
for (Iterator<ExceptionQueuedEvent> i = this.getUnhandledExceptionQueuedEvents().iterator(); i.hasNext();)
{
event = i.next();
exception = event.getContext().getException();
- realException = this.getRootCause(exception);
+ final Throwable realException = (this.getRootCause(exception) != null) ? this.getRootCause(exception) : exception;
- if (realException == null)
- {
- realException = exception;
- }
+ chain = new HandlerChainImpl();
+ beans = this.beanManager.getBeans(new ParameterizedType() {
+ public Type[] getActualTypeArguments()
+ {
+ return new Type[] {realException.getClass(), FacesState.class};
+ }
+ public Type getRawType()
+ {
+ return org.jboss.seam.exceptionhandling.ExceptionHandler.class;
+ }
+
+ public Type getOwnerType()
+ {
+ return null;
+ }
+ });
// TODO: Find handlers for the exception type
- // TODO: Create handler chain
// TODO: execute handler
+
}
if (this.wrapped != null)
Modified: modules/faces/branches/exception_handling/impl/src/main/java/org/jboss/seam/exceptionhandling/SeamExceptionHandlerFactory.java
===================================================================
--- modules/faces/branches/exception_handling/impl/src/main/java/org/jboss/seam/exceptionhandling/SeamExceptionHandlerFactory.java 2010-06-07 07:50:09 UTC (rev 13076)
+++ modules/faces/branches/exception_handling/impl/src/main/java/org/jboss/seam/exceptionhandling/SeamExceptionHandlerFactory.java 2010-06-07 15:35:45 UTC (rev 13077)
@@ -24,6 +24,7 @@
import javax.faces.context.ExceptionHandler;
import javax.faces.context.ExceptionHandlerFactory;
+import javax.naming.NamingException;
public class SeamExceptionHandlerFactory extends ExceptionHandlerFactory
{
@@ -38,7 +39,13 @@
public javax.faces.context.ExceptionHandler getExceptionHandler()
{
ExceptionHandler result = this.parent.getExceptionHandler();
- result = new SeamExceptionHandler(result);
- return result;
+ try
+ {
+ return new SeamExceptionHandler(result);
+ }
+ catch (NamingException e)
+ {
+ return result;
+ }
}
}
Modified: modules/faces/branches/exception_handling/impl/src/main/resources/META-INF/faces-config.xml
===================================================================
--- modules/faces/branches/exception_handling/impl/src/main/resources/META-INF/faces-config.xml 2010-06-07 07:50:09 UTC (rev 13076)
+++ modules/faces/branches/exception_handling/impl/src/main/resources/META-INF/faces-config.xml 2010-06-07 15:35:45 UTC (rev 13077)
@@ -19,6 +19,7 @@
<factory>
<external-context-factory>org.jboss.seam.faces.environment.SeamExternalContextFactory</external-context-factory>
+ <exception-handler-factory>org.jboss.seam.exceptionhandling.SeamExceptionHandlerFactory</exception-handler-factory>
</factory>
<application>
@@ -60,4 +61,4 @@
</system-event-listener>
</application>
-</faces-config>
\ No newline at end of file
+</faces-config>
14 years
Seam SVN: r13076 - modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-06-07 03:50:09 -0400 (Mon, 07 Jun 2010)
New Revision: 13076
Modified:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
Log:
oops, have to scan for a dedicated attribute entity also
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2010-06-07 07:33:25 UTC (rev 13075)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2010-06-07 07:50:09 UTC (rev 13076)
@@ -63,6 +63,8 @@
private static final String PROPERTY_RELATIONSHIP_TYPE = "RELATIONSHIP_TYPE";
private static final String PROPERTY_RELATIONSHIP_TYPE_NAME = "RELATIONSHIP_TYPE_NAME";
private static final String PROPERTY_RELATIONSHIP_NAME = "RELATIONSHIP_NAME";
+ private static final String PROPERTY_ATTRIBUTE_NAME = "ATTRIBUTE_NAME";
+ private static final String PROPERTY_ATTRIBUTE_VALUE = "ATTRIBUTE_VALUE";
// Entity classes
@@ -625,15 +627,47 @@
if (attributeClass != null)
{
List<Property<Object>> props = PropertyQueries.createQuery(attributeClass)
- .addCriteria(new PropertyTypeCriteria(PropertyType.ATTRIBUTE))
+ .addCriteria(new PropertyTypeCriteria(PropertyType.NAME))
+ .addCriteria(new TypedPropertyCriteria(String.class))
.getResultList();
- for (Property<Object> p : props)
+ if (props.size() == 1)
{
- attributeProperties.put(
- p.getAnnotatedElement().getAnnotation(IdentityProperty.class).attributeName(),
- p);
- }
+ modelProperties.put(PROPERTY_ATTRIBUTE_NAME, props.get(0));
+ }
+ else if (props.size() > 1)
+ {
+ throw new IdentityManagementException(
+ "Ambiguous attribute name property in class " +
+ attributeClass.getName());
+ }
+ else
+ {
+ Property<Object> prop = findNamedProperty(attributeClass,
+ "attributeName", "name");
+ if (prop != null) modelProperties.put(PROPERTY_ATTRIBUTE_NAME, prop);
+ }
+
+ props = PropertyQueries.createQuery(attributeClass)
+ .addCriteria(new PropertyTypeCriteria(PropertyType.VALUE))
+ .getResultList();
+
+ if (props.size() == 1)
+ {
+ modelProperties.put(PROPERTY_ATTRIBUTE_VALUE, props.get(0));
+ }
+ else if (props.size() > 1)
+ {
+ throw new IdentityManagementException(
+ "Ambiguous attribute value property in class " +
+ attributeClass.getName());
+ }
+ else
+ {
+ Property<Object> prop = findNamedProperty(attributeClass,
+ "attributeValue", "value");
+ if (prop != null) modelProperties.put(PROPERTY_ATTRIBUTE_VALUE, prop);
+ }
}
// Scan for additional attributes in the identity class also
@@ -647,6 +681,8 @@
p.getAnnotatedElement().getAnnotation(IdentityProperty.class).attributeName(),
p);
}
+
+ // TODO scan any entity classes referenced by the identity class also
}
protected void configureRoleTypeNames()
14 years
Seam SVN: r13075 - modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-06-07 03:33:25 -0400 (Mon, 07 Jun 2010)
New Revision: 13075
Modified:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
Log:
attribute configuration
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2010-06-07 05:38:30 UTC (rev 13074)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2010-06-07 07:33:25 UTC (rev 13075)
@@ -84,6 +84,11 @@
*/
private Map<String,Property<Object>> modelProperties = new HashMap<String,Property<Object>>();
+ /**
+ * Attribute properties
+ */
+ private Map<String,Property<Object>> attributeProperties = new HashMap<String,Property<Object>>();
+
private class PropertyTypeCriteria implements PropertyCriteria
{
private PropertyType pt;
@@ -616,14 +621,31 @@
protected void configureAttributes()
{
+ // If an attribute class has been configured, scan it for attributes
if (attributeClass != null)
{
+ List<Property<Object>> props = PropertyQueries.createQuery(attributeClass)
+ .addCriteria(new PropertyTypeCriteria(PropertyType.ATTRIBUTE))
+ .getResultList();
-
+ for (Property<Object> p : props)
+ {
+ attributeProperties.put(
+ p.getAnnotatedElement().getAnnotation(IdentityProperty.class).attributeName(),
+ p);
+ }
}
- else
+
+ // Scan for additional attributes in the identity class also
+ List<Property<Object>> props = PropertyQueries.createQuery(identityClass)
+ .addCriteria(new PropertyTypeCriteria(PropertyType.ATTRIBUTE))
+ .getResultList();
+
+ for (Property<Object> p : props)
{
-
+ attributeProperties.put(
+ p.getAnnotatedElement().getAnnotation(IdentityProperty.class).attributeName(),
+ p);
}
}
14 years