Seam SVN: r13703 - in branches/community/Seam_2_2: src/test/ftest/examples/spring and 1 other directory.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-09-02 09:00:26 -0400 (Thu, 02 Sep 2010)
New Revision: 13703
Added:
branches/community/Seam_2_2/examples/spring/build-jboss42.xml
Modified:
branches/community/Seam_2_2/examples/spring/build.xml
branches/community/Seam_2_2/examples/spring/readme.txt
branches/community/Seam_2_2/src/test/ftest/examples/spring/build.xml
Log:
JBSEAM-4573 - added new ant target jboss42 for deploying to JBoss AS 4.2
Added: branches/community/Seam_2_2/examples/spring/build-jboss42.xml
===================================================================
--- branches/community/Seam_2_2/examples/spring/build-jboss42.xml (rev 0)
+++ branches/community/Seam_2_2/examples/spring/build-jboss42.xml 2010-09-02 13:00:26 UTC (rev 13703)
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+
+<project name="Spring JBossWar 4.2" default="jbosswar.deploy" basedir=".">
+
+ <property name="han.lib" value="yes"/>
+
+ <import file="./build-jbosswar.xml"/>
+
+</project>
Property changes on: branches/community/Seam_2_2/examples/spring/build-jboss42.xml
___________________________________________________________________
Name: svn:executable
+ *
Modified: branches/community/Seam_2_2/examples/spring/build.xml
===================================================================
--- branches/community/Seam_2_2/examples/spring/build.xml 2010-09-02 11:32:48 UTC (rev 13702)
+++ branches/community/Seam_2_2/examples/spring/build.xml 2010-09-02 13:00:26 UTC (rev 13703)
@@ -17,6 +17,10 @@
</target>
<target name="all" depends="jbosswar" description="Build Spring Booking example, for deployment to all supported application servers"/>
+
+ <target name="jboss42" description="Build the Spring example, and deploy to JBoss 4.2.x.GA">
+ <ant antfile="build-jboss42.xml"/>
+ </target>
</project>
Modified: branches/community/Seam_2_2/examples/spring/readme.txt
===================================================================
--- branches/community/Seam_2_2/examples/spring/readme.txt 2010-09-02 11:32:48 UTC (rev 13702)
+++ branches/community/Seam_2_2/examples/spring/readme.txt 2010-09-02 13:00:26 UTC (rev 13703)
@@ -5,4 +5,6 @@
as a WAR. It is deployed using the command "ant jbosswar" and undeployed using
the command "ant jbosswar.undeploy".
+JBoss AS 4.2 needs additional hibernate libraries, use ant target jboss42 for deploying to it.
+
Visit http://localhost:8080/jboss-seam-spring
Modified: branches/community/Seam_2_2/src/test/ftest/examples/spring/build.xml
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/examples/spring/build.xml 2010-09-02 11:32:48 UTC (rev 13702)
+++ branches/community/Seam_2_2/src/test/ftest/examples/spring/build.xml 2010-09-02 13:00:26 UTC (rev 13703)
@@ -22,7 +22,7 @@
-->
<project name="spring.ftest.build" basedir="." default="build">
<property name="example.name" value="spring" />
- <property name="jboss4.deploy.target" value="jbosswar" />
+ <property name="jboss4.deploy.target" value="jboss42" />
<property name="jboss4.undeploy.target" value="jbosswar.undeploy" />
<property name="jboss4.context.path" value="/jboss-seam-spring" />
14 years, 3 months
Seam SVN: r13702 - modules/persistence/trunk.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-09-02 07:32:48 -0400 (Thu, 02 Sep 2010)
New Revision: 13702
Added:
modules/persistence/trunk/readme.txt
Log:
add brief readme
Added: modules/persistence/trunk/readme.txt
===================================================================
--- modules/persistence/trunk/readme.txt (rev 0)
+++ modules/persistence/trunk/readme.txt 2010-09-02 11:32:48 UTC (rev 13702)
@@ -0,0 +1,9 @@
+To run the tests you can use either a remote or managed jboss instance.
+
+To use a managed instance set the JBOSS_HOME environment variable and run
+
+mvn install.
+
+To use a remote jboss instance start jboss and then run
+
+mvn install -Pjbossas-remote-6
14 years, 3 months
Seam SVN: r13701 - in modules/persistence/trunk/impl: src/test/resources and 1 other directory.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-09-02 07:29:55 -0400 (Thu, 02 Sep 2010)
New Revision: 13701
Modified:
modules/persistence/trunk/impl/pom.xml
modules/persistence/trunk/impl/src/test/resources/arquillian.xml
Log:
use the jboss managed profile by default
Modified: modules/persistence/trunk/impl/pom.xml
===================================================================
--- modules/persistence/trunk/impl/pom.xml 2010-09-02 11:18:41 UTC (rev 13700)
+++ modules/persistence/trunk/impl/pom.xml 2010-09-02 11:29:55 UTC (rev 13701)
@@ -157,15 +157,59 @@
<activation>
<activeByDefault>true</activeByDefault>
</activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.arquillian.container</groupId>
+ <artifactId>arquillian-jbossas-managed-6</artifactId>
+ <version>${arquillian.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-server-manager</artifactId>
+ <version>1.0.3.GA</version>
+ </dependency>
+
+ <!-- need for org.jnp.interfaces.NamingContextFactory -->
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-client</artifactId>
+ <version>${jboss-as-client.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
<build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ </testResource>
+ <testResource>
+ <directory>src/test/resources-jbossas</directory>
+ </testResource>
+ </testResources>
<plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- </plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>enforce-property</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireProperty>
+ <property>jboss.home</property>
+ </requireProperty>
+ </rules>
+ <fail>true</fail>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
</build>
</profile>
Modified: modules/persistence/trunk/impl/src/test/resources/arquillian.xml
===================================================================
--- modules/persistence/trunk/impl/src/test/resources/arquillian.xml 2010-09-02 11:18:41 UTC (rev 13700)
+++ modules/persistence/trunk/impl/src/test/resources/arquillian.xml 2010-09-02 11:29:55 UTC (rev 13701)
@@ -2,7 +2,8 @@
<arquillian xmlns="http://jboss.com/arquillian"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gfembedded="urn:arq:org.jboss.arquillian.glassfish.embedded30"
- xmlns:gfremote="urn:arq:org.jboss.arquillian.container.glassfish.remote30">
+ xmlns:gfremote="urn:arq:org.jboss.arquillian.container.glassfish.remote30"
+ xmlns:jbossmanaged="urn:arq:org.jboss.arquillian.container.jbossas.managed_6">
<engine>
<deploymentExportPath>/tmp/</deploymentExportPath>
@@ -15,5 +16,7 @@
<gfembedded:container>
<gfembedded:sunResourcesXml>src/test/resources-glassfish/sun-resources.xml</gfembedded:sunResourcesXml>
</gfembedded:container>
-
+ <jbossmanaged:container>
+ <javaVmArguments>-Xmx512m -XX:MaxPermSize=256m</javaVmArguments>
+ </jbossmanaged:container>
</arquillian>
14 years, 3 months
Seam SVN: r13700 - in modules/persistence/trunk: impl/src/main/java/org/jboss/seam/persistence and 1 other directory.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-09-02 07:18:41 -0400 (Thu, 02 Sep 2010)
New Revision: 13700
Modified:
modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/PersistenceContexts.java
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/DefaultPersistenceProvider.java
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextExtension.java
Log:
minor
Modified: modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/PersistenceContexts.java
===================================================================
--- modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/PersistenceContexts.java 2010-09-02 08:32:11 UTC (rev 13699)
+++ modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/PersistenceContexts.java 2010-09-02 11:18:41 UTC (rev 13700)
@@ -1,6 +1,26 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.persistence;
-
/**
* PersistenceContexts tracks active persistence contexts within a conversation.
*
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/DefaultPersistenceProvider.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/DefaultPersistenceProvider.java 2010-09-02 08:32:11 UTC (rev 13699)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/DefaultPersistenceProvider.java 2010-09-02 11:18:41 UTC (rev 13700)
@@ -31,8 +31,6 @@
import javax.persistence.OptimisticLockException;
import javax.transaction.Synchronization;
-import org.jboss.weld.extensions.defaultbean.DefaultBean;
-
/**
* Abstraction layer for persistence providers (JPA implementations). This class
* provides a working base implementation that can be optimized for performance
@@ -46,7 +44,6 @@
* @author Stuart Douglas
*
*/
-@DefaultBean(type = DefaultPersistenceProvider.class)
public class DefaultPersistenceProvider implements SeamPersistenceProvider
{
public enum Feature
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextExtension.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextExtension.java 2010-09-02 08:32:11 UTC (rev 13699)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextExtension.java 2010-09-02 11:18:41 UTC (rev 13700)
@@ -178,7 +178,7 @@
{
// we need to add all additional interfaces from our
// SeamPersistenceProvider to the bean as at this stage we have no way of
- // knowing which persistence provider is actually in use this only time
+ // knowing which persistence provider is actually in use. The only time
// that this may cause slightly odd behaviour is if two providers are on
// the class path, in which case the entity manager may be assignable to
// additional interfaces that it does not support.
14 years, 3 months
Seam SVN: r13699 - in modules/persistence/trunk/impl: src/test/java/org/jboss/seam/persistence/test and 2 other directories.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-09-02 04:32:11 -0400 (Thu, 02 Sep 2010)
New Revision: 13699
Modified:
modules/persistence/trunk/impl/pom.xml
modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/EntityInjectionTest.java
modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/HibernateSearchTest.java
modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/ManagedPersistenceContextELTest.java
modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/ManagedPersistenceContextFlushModeTest.java
modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/ManagedPersistenceContextTest.java
modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionAttributeInterceptorTest.java
modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionInterceptorTest.java
modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionScopedTest.java
modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/UserTransactionTest.java
modules/persistence/trunk/impl/src/test/java/org/jboss/seam/transactions/test/util/ArtifactNames.java
modules/persistence/trunk/impl/src/test/java/org/jboss/seam/transactions/test/util/MavenArtifactResolver.java
Log:
change tests to run in the intergration-tests phase and borrow upgraded MavenArtifactResolver from welx
Modified: modules/persistence/trunk/impl/pom.xml
===================================================================
--- modules/persistence/trunk/impl/pom.xml 2010-09-02 08:22:41 UTC (rev 13698)
+++ modules/persistence/trunk/impl/pom.xml 2010-09-02 08:32:11 UTC (rev 13699)
@@ -122,6 +122,34 @@
</dependencies>
+ <build>
+ <plugins>
+ <!--
+ skip unit test run, tests to be executed during
+ integration-test
+ -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>surefire-it</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
<profiles>
<profile>
Modified: modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/EntityInjectionTest.java
===================================================================
--- modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/EntityInjectionTest.java 2010-09-02 08:22:41 UTC (rev 13698)
+++ modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/EntityInjectionTest.java 2010-09-02 08:32:11 UTC (rev 13699)
@@ -32,12 +32,8 @@
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.seam.persistence.InjectionEventListener;
import org.jboss.seam.persistence.transaction.DefaultTransaction;
import org.jboss.seam.persistence.transaction.SeamTransaction;
-import org.jboss.seam.persistence.transaction.TransactionExtension;
-import org.jboss.seam.persistence.transaction.scope.TransactionScopeExtension;
-import org.jboss.seam.persistence.util.NamingUtils;
import org.jboss.seam.transactions.test.util.ArtifactNames;
import org.jboss.seam.transactions.test.util.HelloService;
import org.jboss.seam.transactions.test.util.Hotel;
@@ -66,10 +62,7 @@
WebArchive war = ShrinkWrap.createDomain().getArchiveFactory().create(WebArchive.class, "test.war");
war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.WELD_EXTENSIONS));
war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_API));
- war.addPackage(TransactionExtension.class.getPackage());
- war.addPackage(TransactionScopeExtension.class.getPackage());
- war.addPackage(InjectionEventListener.class.getPackage());
- war.addPackage(NamingUtils.class.getPackage());
+ war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_IMPL));
war.addClasses(EntityInjectionTest.class, Hotel.class, ManagedPersistenceContextProvider.class, HelloService.class);
war.addWebResource("META-INF/services/javax.enterprise.inject.spi.Extension", "classes/META-INF/services/javax.enterprise.inject.spi.Extension");
war.addWebResource("META-INF/persistence-orm.xml", "classes/META-INF/persistence.xml");
Modified: modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/HibernateSearchTest.java
===================================================================
--- modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/HibernateSearchTest.java 2010-09-02 08:22:41 UTC (rev 13698)
+++ modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/HibernateSearchTest.java 2010-09-02 08:32:11 UTC (rev 13699)
@@ -34,12 +34,8 @@
import org.hibernate.search.jpa.FullTextEntityManager;
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.seam.persistence.SePersistenceContextExtension;
import org.jboss.seam.persistence.transaction.DefaultTransaction;
import org.jboss.seam.persistence.transaction.SeamTransaction;
-import org.jboss.seam.persistence.transaction.TransactionExtension;
-import org.jboss.seam.persistence.transaction.scope.TransactionScopeExtension;
-import org.jboss.seam.persistence.util.NamingUtils;
import org.jboss.seam.transactions.test.util.ArtifactNames;
import org.jboss.seam.transactions.test.util.HelloService;
import org.jboss.seam.transactions.test.util.IndexedHotel;
@@ -65,10 +61,7 @@
war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.HIBERNATE_SEARCH));
war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.LUCENE_ANALYZERS));
war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.LUCENE_CORE));
- war.addPackage(TransactionExtension.class.getPackage());
- war.addPackage(SePersistenceContextExtension.class.getPackage());
- war.addPackage(TransactionScopeExtension.class.getPackage());
- war.addPackage(NamingUtils.class.getPackage());
+ war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_IMPL));
war.addClasses(HibernateSearchTest.class, IndexedHotel.class, ManagedPersistenceContextProvider.class, HelloService.class);
war.addWebResource("META-INF/persistence-search.xml", "classes/META-INF/persistence.xml");
war.addWebResource(new ByteArrayAsset(new byte[0]), "beans.xml");
Modified: modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/ManagedPersistenceContextELTest.java
===================================================================
--- modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/ManagedPersistenceContextELTest.java 2010-09-02 08:22:41 UTC (rev 13698)
+++ modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/ManagedPersistenceContextELTest.java 2010-09-02 08:32:11 UTC (rev 13699)
@@ -31,12 +31,8 @@
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.seam.persistence.SePersistenceContextExtension;
import org.jboss.seam.persistence.transaction.DefaultTransaction;
import org.jboss.seam.persistence.transaction.SeamTransaction;
-import org.jboss.seam.persistence.transaction.TransactionExtension;
-import org.jboss.seam.persistence.transaction.scope.TransactionScopeExtension;
-import org.jboss.seam.persistence.util.NamingUtils;
import org.jboss.seam.transactions.test.util.ArtifactNames;
import org.jboss.seam.transactions.test.util.HelloService;
import org.jboss.seam.transactions.test.util.Hotel;
@@ -59,11 +55,7 @@
WebArchive war = ShrinkWrap.createDomain().getArchiveFactory().create(WebArchive.class, "test.war");
war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.WELD_EXTENSIONS));
war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_API));
- war.addPackage(TransactionExtension.class.getPackage());
- war.addPackage(SePersistenceContextExtension.class.getPackage());
- war.addPackage(TransactionExtension.class.getPackage());
- war.addPackage(TransactionScopeExtension.class.getPackage());
- war.addPackage(NamingUtils.class.getPackage());
+ war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_IMPL));
war.addClasses(ManagedPersistenceContextELTest.class, Hotel.class, ManagedPersistenceContextProvider.class, HotelNameProducer.class, HelloService.class);
war.addWebResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
war.addWebResource(new ByteArrayAsset(new byte[0]), "beans.xml");
Modified: modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/ManagedPersistenceContextFlushModeTest.java
===================================================================
--- modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/ManagedPersistenceContextFlushModeTest.java 2010-09-02 08:22:41 UTC (rev 13698)
+++ modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/ManagedPersistenceContextFlushModeTest.java 2010-09-02 08:32:11 UTC (rev 13699)
@@ -39,11 +39,7 @@
import org.jboss.seam.persistence.FlushModeManager;
import org.jboss.seam.persistence.FlushModeType;
import org.jboss.seam.persistence.ManagedPersistenceContext;
-import org.jboss.seam.persistence.SePersistenceContextExtension;
import org.jboss.seam.persistence.PersistenceContexts;
-import org.jboss.seam.persistence.transaction.TransactionExtension;
-import org.jboss.seam.persistence.transaction.scope.TransactionScopeExtension;
-import org.jboss.seam.persistence.util.NamingUtils;
import org.jboss.seam.transactions.test.util.ArtifactNames;
import org.jboss.seam.transactions.test.util.HelloService;
import org.jboss.seam.transactions.test.util.Hotel;
@@ -65,10 +61,7 @@
WebArchive war = ShrinkWrap.createDomain().getArchiveFactory().create(WebArchive.class, "test.war");
war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.WELD_EXTENSIONS));
war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_API));
- war.addPackage(TransactionExtension.class.getPackage());
- war.addPackage(SePersistenceContextExtension.class.getPackage());
- war.addPackage(TransactionScopeExtension.class.getPackage());
- war.addPackage(NamingUtils.class.getPackage());
+ war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_IMPL));
war.addClasses(ManagedPersistenceContextFlushModeTest.class, Hotel.class, ManagedPersistenceContextProvider.class, HelloService.class);
war.addWebResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
war.addWebResource(new ByteArrayAsset(new byte[0]), "beans.xml");
Modified: modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/ManagedPersistenceContextTest.java
===================================================================
--- modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/ManagedPersistenceContextTest.java 2010-09-02 08:22:41 UTC (rev 13698)
+++ modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/ManagedPersistenceContextTest.java 2010-09-02 08:32:11 UTC (rev 13699)
@@ -35,12 +35,8 @@
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.seam.persistence.SePersistenceContextExtension;
import org.jboss.seam.persistence.transaction.DefaultTransaction;
import org.jboss.seam.persistence.transaction.SeamTransaction;
-import org.jboss.seam.persistence.transaction.TransactionExtension;
-import org.jboss.seam.persistence.transaction.scope.TransactionScopeExtension;
-import org.jboss.seam.persistence.util.NamingUtils;
import org.jboss.seam.transactions.test.util.ArtifactNames;
import org.jboss.seam.transactions.test.util.HelloService;
import org.jboss.seam.transactions.test.util.Hotel;
@@ -62,10 +58,7 @@
WebArchive war = ShrinkWrap.createDomain().getArchiveFactory().create(WebArchive.class, "test.war");
war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.WELD_EXTENSIONS));
war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_API));
- war.addPackage(TransactionExtension.class.getPackage());
- war.addPackage(SePersistenceContextExtension.class.getPackage());
- war.addPackage(TransactionScopeExtension.class.getPackage());
- war.addPackage(NamingUtils.class.getPackage());
+ war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_IMPL));
war.addClasses(ManagedPersistenceContextTest.class, Hotel.class, ManagedPersistenceContextProvider.class, HelloService.class);
war.addWebResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
war.addWebResource(new ByteArrayAsset(new byte[0]), "beans.xml");
Modified: modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionAttributeInterceptorTest.java
===================================================================
--- modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionAttributeInterceptorTest.java 2010-09-02 08:22:41 UTC (rev 13698)
+++ modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionAttributeInterceptorTest.java 2010-09-02 08:32:11 UTC (rev 13699)
@@ -37,13 +37,9 @@
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.seam.persistence.DefaultPersistenceProvider;
import org.jboss.seam.persistence.transaction.DefaultTransaction;
import org.jboss.seam.persistence.transaction.SeamTransaction;
-import org.jboss.seam.persistence.transaction.TransactionExtension;
import org.jboss.seam.persistence.transaction.TransactionInterceptor;
-import org.jboss.seam.persistence.transaction.scope.TransactionScopeExtension;
-import org.jboss.seam.persistence.util.NamingUtils;
import org.jboss.seam.transactions.test.util.ArtifactNames;
import org.jboss.seam.transactions.test.util.DontRollBackException;
import org.jboss.seam.transactions.test.util.EntityManagerProvider;
@@ -75,10 +71,7 @@
WebArchive war = ShrinkWrap.createDomain().getArchiveFactory().create(WebArchive.class, "test.war");
war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.WELD_EXTENSIONS));
war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_API));
- war.addPackage(TransactionExtension.class.getPackage());
- war.addPackage(DefaultPersistenceProvider.class.getPackage());
- war.addPackage(TransactionScopeExtension.class.getPackage());
- war.addPackage(NamingUtils.class.getPackage());
+ war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_IMPL));
war.addClasses(TransactionAttributeInterceptorTest.class, TransactionAttributeManagedBean.class, HelloService.class, Hotel.class, EntityManagerProvider.class, DontRollBackException.class);
war.addWebResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
war.addWebResource(new ByteArrayAsset(("<beans><interceptors><class>" + TransactionInterceptor.class.getName() + "</class></interceptors></beans>").getBytes()), "beans.xml");
Modified: modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionInterceptorTest.java
===================================================================
--- modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionInterceptorTest.java 2010-09-02 08:22:41 UTC (rev 13698)
+++ modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionInterceptorTest.java 2010-09-02 08:32:11 UTC (rev 13699)
@@ -37,13 +37,9 @@
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.seam.persistence.DefaultPersistenceProvider;
import org.jboss.seam.persistence.transaction.DefaultTransaction;
import org.jboss.seam.persistence.transaction.SeamTransaction;
-import org.jboss.seam.persistence.transaction.TransactionExtension;
import org.jboss.seam.persistence.transaction.TransactionInterceptor;
-import org.jboss.seam.persistence.transaction.scope.TransactionScopeExtension;
-import org.jboss.seam.persistence.util.NamingUtils;
import org.jboss.seam.transactions.test.util.ArtifactNames;
import org.jboss.seam.transactions.test.util.DontRollBackException;
import org.jboss.seam.transactions.test.util.EntityManagerProvider;
@@ -75,10 +71,7 @@
WebArchive war = ShrinkWrap.createDomain().getArchiveFactory().create(WebArchive.class, "test.war");
war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.WELD_EXTENSIONS));
war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_API));
- war.addPackage(TransactionExtension.class.getPackage());
- war.addPackage(TransactionScopeExtension.class.getPackage());
- war.addPackage(NamingUtils.class.getPackage());
- war.addPackage(DefaultPersistenceProvider.class.getPackage());
+ war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_IMPL));
war.addClasses(TransactionInterceptorTest.class, TransactionManagedBean.class, HelloService.class, Hotel.class, EntityManagerProvider.class, DontRollBackException.class);
war.addWebResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
war.addWebResource(new ByteArrayAsset(("<beans><interceptors><class>" + TransactionInterceptor.class.getName() + "</class></interceptors></beans>").getBytes()), "beans.xml");
Modified: modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionScopedTest.java
===================================================================
--- modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionScopedTest.java 2010-09-02 08:22:41 UTC (rev 13698)
+++ modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionScopedTest.java 2010-09-02 08:32:11 UTC (rev 13699)
@@ -13,12 +13,8 @@
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.seam.persistence.DefaultPersistenceProvider;
import org.jboss.seam.persistence.transaction.DefaultTransaction;
import org.jboss.seam.persistence.transaction.SeamTransaction;
-import org.jboss.seam.persistence.transaction.TransactionExtension;
-import org.jboss.seam.persistence.transaction.scope.TransactionScopeExtension;
-import org.jboss.seam.persistence.util.NamingUtils;
import org.jboss.seam.transactions.test.util.ArtifactNames;
import org.jboss.seam.transactions.test.util.HelloService;
import org.jboss.seam.transactions.test.util.Hotel;
@@ -39,10 +35,7 @@
WebArchive war = ShrinkWrap.createDomain().getArchiveFactory().create(WebArchive.class, "test.war");
war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.WELD_EXTENSIONS));
war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_API));
- war.addPackage(TransactionExtension.class.getPackage());
- war.addPackage(TransactionScopeExtension.class.getPackage());
- war.addPackage(DefaultPersistenceProvider.class.getPackage());
- war.addPackage(NamingUtils.class.getPackage());
+ war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_IMPL));
war.addClasses(TransactionScopedTest.class, Hotel.class, HelloService.class, TransactionScopedObject.class);
war.addWebResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
war.addWebResource(new ByteArrayAsset(new byte[0]), "beans.xml");
Modified: modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/UserTransactionTest.java
===================================================================
--- modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/UserTransactionTest.java 2010-09-02 08:22:41 UTC (rev 13698)
+++ modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/UserTransactionTest.java 2010-09-02 08:32:11 UTC (rev 13699)
@@ -17,8 +17,6 @@
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.seam.persistence.transaction.DefaultTransaction;
import org.jboss.seam.persistence.transaction.SeamTransaction;
-import org.jboss.seam.persistence.transaction.TransactionExtension;
-import org.jboss.seam.persistence.util.NamingUtils;
import org.jboss.seam.transactions.test.util.ArtifactNames;
import org.jboss.seam.transactions.test.util.HelloService;
import org.jboss.seam.transactions.test.util.Hotel;
@@ -39,9 +37,8 @@
WebArchive war = ShrinkWrap.createDomain().getArchiveFactory().create(WebArchive.class, "test.war");
war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.WELD_EXTENSIONS));
war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_API));
- war.addPackage(TransactionExtension.class.getPackage());
+ war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_IMPL));
war.addClasses(UserTransactionTest.class, Hotel.class, HelloService.class);
- war.addPackage(NamingUtils.class.getPackage());
war.addWebResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
war.addWebResource(new ByteArrayAsset(new byte[0]), "beans.xml");
war.addWebResource("META-INF/services/javax.enterprise.inject.spi.Extension", "classes/META-INF/services/javax.enterprise.inject.spi.Extension");
Modified: modules/persistence/trunk/impl/src/test/java/org/jboss/seam/transactions/test/util/ArtifactNames.java
===================================================================
--- modules/persistence/trunk/impl/src/test/java/org/jboss/seam/transactions/test/util/ArtifactNames.java 2010-09-02 08:22:41 UTC (rev 13698)
+++ modules/persistence/trunk/impl/src/test/java/org/jboss/seam/transactions/test/util/ArtifactNames.java 2010-09-02 08:32:11 UTC (rev 13699)
@@ -4,6 +4,7 @@
{
public static final String WELD_EXTENSIONS = "org.jboss.weld:weld-extensions";
public static final String SEAM_PERSISTENCE_API = "org.jboss.seam.persistence:seam-persistence-api";
+ public static final String SEAM_PERSISTENCE_IMPL = "org.jboss.seam.persistence:seam-persistence-impl";
public static final String HIBERNATE_SEARCH = "org.hibernate:hibernate-search";
public static final String LUCENE_CORE = "org.apache.lucene:lucene-core";
public static final String LUCENE_ANALYZERS = "org.apache.lucene:lucene-analyzers";
Modified: modules/persistence/trunk/impl/src/test/java/org/jboss/seam/transactions/test/util/MavenArtifactResolver.java
===================================================================
--- modules/persistence/trunk/impl/src/test/java/org/jboss/seam/transactions/test/util/MavenArtifactResolver.java 2010-09-02 08:22:41 UTC (rev 13698)
+++ modules/persistence/trunk/impl/src/test/java/org/jboss/seam/transactions/test/util/MavenArtifactResolver.java 2010-09-02 08:32:11 UTC (rev 13699)
@@ -1,6 +1,8 @@
package org.jboss.seam.transactions.test.util;
import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -12,33 +14,151 @@
*/
public class MavenArtifactResolver
{
+
public static File resolve(String groupId, String artifactId)
{
- String classPath = System.getProperty("java.class.path");
- // first look for an artefact from the repo
- String pathString = groupId.replace('.', File.separatorChar) + File.separatorChar + artifactId;
- String regex = "[^:]*" + Pattern.quote(pathString) + "[^:]*";
- Pattern p = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
- Matcher matches = p.matcher(classPath);
+ if (groupId == null)
+ {
+ throw new IllegalArgumentException("groupId cannot be null");
+ }
+ if (artifactId == null)
+ {
+ throw new IllegalArgumentException("artifactId cannot be null");
+ }
+ String path = new MavenArtifactResolver(groupId.trim(), artifactId.trim(), System.getProperty("java.class.path"), File.pathSeparatorChar, File.separatorChar).resolve();
+ if (path == null)
+ {
+ throw new IllegalArgumentException("Cannot locate artifact for " + groupId + ":" + artifactId);
+ }
+ return new File(path);
+ }
+ public static File resolve(String qualifiedArtifactId)
+ {
+ String[] segments = qualifiedArtifactId.split(":");
+ if (segments.length == 2)
+ {
+ return resolve(segments[0], segments[1]);
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unable to parse " + qualifiedArtifactId + " as a groupId:artifactId");
+ }
+ }
+
+ private final String classPathSeparatorRegex;
+ private final char fileSeparator;
+ private final String groupId;
+ private final String artifactId;
+ private final String classPath;
+
+ MavenArtifactResolver(String groupId, String artifactId, String classPath, char pathSeparator, char fileSeparator)
+ {
+ this.groupId = groupId;
+ this.artifactId = artifactId;
+ this.classPath = classPath;
+ this.classPathSeparatorRegex = "[^" + pathSeparator + "]*";
+ this.fileSeparator = fileSeparator;
+ }
+
+ String resolve()
+ {
+ Matcher matches = createFullyQualifiedMatcher();
if (!matches.find())
{
- // find a resource from the local build
- String localResource = Pattern.quote("target" + File.separatorChar + artifactId);
- regex = "[^:]*" + localResource + "[^:]*";
- p = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
- matches = p.matcher(classPath);
+ matches = createUnqualifiedMatcher();
if (!matches.find())
{
- throw new RuntimeException("Unable to find maven archive " + groupId + ":" + artifactId + " on the test classpath");
+ matches = createTargetClassesMatcher();
+ if (!matches.find())
+ {
+ return null;
+ }
+ else
+ {
+ String fileName = scanForArtifact(matches);
+ if (fileName == null)
+ {
+ return null;
+ }
+ else
+ {
+ return fileName;
+ }
+ }
}
}
- return new File(matches.group(0));
+ return matches.group(0);
}
- public static File resolve(String qualifiedArtifactId)
+ private String scanForArtifact(Matcher targetClassesMatcher)
{
- String[] segments = qualifiedArtifactId.split(":");
- return resolve(segments[0], segments[1]);
+ // Locate all target/classes in classpath and store the path to all files target/
+ List<String> paths = new ArrayList<String>();
+ do
+ {
+ String path = targetClassesMatcher.group();
+ File target = new File(path.substring(0, path.length() - 8));
+ if (target.exists())
+ {
+ if (!target.isDirectory())
+ {
+ throw new IllegalStateException("Found ${project.dir}/target/ but it is not a directory!");
+ }
+ for (File file : target.listFiles())
+ {
+ paths.add(file.getPath());
+ }
+ }
+ }
+ while (targetClassesMatcher.find());
+ return scanForArtifact(paths);
}
+
+ String scanForArtifact(List<String> paths)
+ {
+ Pattern pattern = Pattern.compile(artifactId + "-[\\d+\\.]+(?:[\\-\\.]\\p{Alpha}*)?.jar$");
+ for (String path : paths)
+ {
+ if (pattern.matcher(path).find())
+ {
+ return path;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Creates a matcher that returns any fully qualified matches of the form
+ * <code>com/acme/acme-core/1.0/acme-core-1.0.jar</code>. This will match
+ * artifacts on the classpath from the Maven repo.
+ */
+ private Matcher createFullyQualifiedMatcher()
+ {
+ String pathString = groupId.replace('.', fileSeparator) + fileSeparator + artifactId;
+ Pattern p = Pattern.compile(classPathSeparatorRegex + Pattern.quote(pathString) + classPathSeparatorRegex, Pattern.CASE_INSENSITIVE);
+ return p.matcher(classPath);
+ }
+
+ /**
+ * Creates a matcher that returns any unqualified matches of the form
+ * <code>target/acme-foo-1.0.jar</code>. This will match artifacts on the
+ * classpath from the reactor.
+ */
+ private Matcher createUnqualifiedMatcher()
+ {
+ Pattern p = Pattern.compile(classPathSeparatorRegex + Pattern.quote("target" + fileSeparator + artifactId) + classPathSeparatorRegex, Pattern.CASE_INSENSITIVE);
+ return p.matcher(classPath);
+ }
+
+ /**
+ * Creates a matcher that returns any unqualified matches of the form
+ * <code>target/acme-foo-1.0.jar</code>. This locates all
+ *
+ */
+ private Matcher createTargetClassesMatcher()
+ {
+ Pattern p = Pattern.compile(classPathSeparatorRegex + Pattern.quote("target" + fileSeparator + "classes") + classPathSeparatorRegex, Pattern.CASE_INSENSITIVE);
+ return p.matcher(classPath);
+ }
}
14 years, 3 months
Seam SVN: r13698 - branches/community/Seam_2_2/ui/src/main/java/org/jboss/seam/ui/component.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-09-02 04:22:41 -0400 (Thu, 02 Sep 2010)
New Revision: 13698
Modified:
branches/community/Seam_2_2/ui/src/main/java/org/jboss/seam/ui/component/UIFileUpload.java
Log:
JBSEAM-4690 - stop processing updates if UIFileUpload is not rendered
Modified: branches/community/Seam_2_2/ui/src/main/java/org/jboss/seam/ui/component/UIFileUpload.java
===================================================================
--- branches/community/Seam_2_2/ui/src/main/java/org/jboss/seam/ui/component/UIFileUpload.java 2010-09-02 07:34:21 UTC (rev 13697)
+++ branches/community/Seam_2_2/ui/src/main/java/org/jboss/seam/ui/component/UIFileUpload.java 2010-09-02 08:22:41 UTC (rev 13698)
@@ -27,6 +27,13 @@
@Override
public void processUpdates(FacesContext context)
{
+
+ // Skip processing if rendered flag is false.
+ // this logic is in javax.faces.component.UIInput.processUpdates(FacesContext context)
+ if (!isRendered()) {
+ return;
+ }
+
ValueExpression dataBinding = getValueExpression("data");
if (dataBinding != null)
{
14 years, 3 months
Seam SVN: r13697 - branches/community/Seam_2_2/src/main/org/jboss/seam/mock.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-09-02 03:34:21 -0400 (Thu, 02 Sep 2010)
New Revision: 13697
Modified:
branches/community/Seam_2_2/src/main/org/jboss/seam/mock/AbstractSeamTest.java
Log:
JBSEAM-4699
Modified: branches/community/Seam_2_2/src/main/org/jboss/seam/mock/AbstractSeamTest.java
===================================================================
--- branches/community/Seam_2_2/src/main/org/jboss/seam/mock/AbstractSeamTest.java 2010-09-02 07:01:52 UTC (rev 13696)
+++ branches/community/Seam_2_2/src/main/org/jboss/seam/mock/AbstractSeamTest.java 2010-09-02 07:34:21 UTC (rev 13697)
@@ -300,6 +300,14 @@
}
/**
+ * Override to implement any logic that requires active scopes
+ * but must happen before the rest of the JSF lifecycle.
+ */
+ protected void afterRestoreViewPhase() throws Exception
+ {
+ }
+
+ /**
* Override to implement the interactions between the JSF page and your
* components that occurs during the apply request values phase.
*/
@@ -583,6 +591,8 @@
restoreViewPhase();
if (!isGetRequest() && !skipToRender())
{
+ afterRestoreViewPhase();
+
applyRequestValuesPhase();
if (!skipToRender())
{
14 years, 3 months
Seam SVN: r13696 - modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/transaction.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-09-02 03:01:52 -0400 (Thu, 02 Sep 2010)
New Revision: 13696
Modified:
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/transaction/TransactionPhaseListener.java
Log:
minor
Modified: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/transaction/TransactionPhaseListener.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/transaction/TransactionPhaseListener.java 2010-09-02 06:53:32 UTC (rev 13695)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/transaction/TransactionPhaseListener.java 2010-09-02 07:01:52 UTC (rev 13696)
@@ -31,7 +31,7 @@
import javax.inject.Inject;
import org.jboss.seam.faces.viewdata.ViewDataStore;
-import org.jboss.seam.persistence.transaction.PersistenceContexts;
+import org.jboss.seam.persistence.PersistenceContexts;
import org.jboss.seam.persistence.transaction.SeamTransaction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
14 years, 3 months
Seam SVN: r13695 - in modules/persistence/trunk: api/src/main/java/org/jboss/seam/persistence/transaction and 2 other directories.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-09-02 02:53:32 -0400 (Thu, 02 Sep 2010)
New Revision: 13695
Added:
modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/FlushModeManager.java
modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/FlushModeType.java
modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContext.java
modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/PersistenceContexts.java
Removed:
modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/FlushModeType.java
modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/PersistenceContexts.java
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/FlushModeManager.java
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContext.java
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContexts.java
Modified:
modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/SeamManagedPersistenceContextCreated.java
modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/SeamPersistenceProvider.java
modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/SeamApplicationException.java
modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/TransactionPropagation.java
modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/TransactionScoped.java
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/DefaultPersistenceProvider.java
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/FlushModeManagerImpl.java
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/HibernatePersistenceProvider.java
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextBeanLifecycle.java
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextProxyHandler.java
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContextsImpl.java
modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/ManagedPersistenceContextFlushModeTest.java
Log:
move classes to API and improve javadoc
Copied: modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/FlushModeManager.java (from rev 13694, modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/FlushModeManager.java)
===================================================================
--- modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/FlushModeManager.java (rev 0)
+++ modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/FlushModeManager.java 2010-09-02 06:53:32 UTC (rev 13695)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.persistence;
+
+/**
+ * provides a means of configuring the default flush mode
+ *
+ * TODO: This needs more thought, especially with regard to how it works in with
+ * {@link PersistenceContexts}
+ *
+ * @author Stuart Douglas
+ *
+ */
+public interface FlushModeManager
+{
+ /**
+ *
+ * @return the default flush mode for all seam managed persistence contexts
+ */
+ public FlushModeType getFlushModeType();
+
+ public void setFlushModeType(FlushModeType flushModeType);
+}
Copied: modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/FlushModeType.java (from rev 13694, modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/FlushModeType.java)
===================================================================
--- modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/FlushModeType.java (rev 0)
+++ modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/FlushModeType.java 2010-09-02 06:53:32 UTC (rev 13695)
@@ -0,0 +1,42 @@
+package org.jboss.seam.persistence;
+
+/**
+ * A full set of flush modes, including MANUAL,
+ * which is a glaring missing feature of the JPA
+ * spec.
+ *
+ * @author Gavin King
+ *
+ */
+public enum FlushModeType
+{
+
+ /**
+ * Flushing never occurs automatically, all changes are queued
+ * until the application calls flush() explicitly.
+ */
+ MANUAL,
+
+ /**
+ * Flushing occurs automatically at commit time and when necessary
+ * before query executions.
+ */
+ AUTO,
+
+ /**
+ * Flushing occurs automatically at transaction commit time.
+ */
+ COMMIT;
+
+ /**
+ * Does this flush mode keep unflushed changes past a
+ * transaction commit?
+ *
+ * @return false for all flush modes except for MANUAL
+ */
+ public boolean dirtyBetweenTransactions()
+ {
+ return this==MANUAL;
+ }
+
+}
Copied: modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContext.java (from rev 13694, modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContext.java)
===================================================================
--- modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContext.java (rev 0)
+++ modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContext.java 2010-09-02 06:53:32 UTC (rev 13695)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.persistence;
+
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+/**
+ * Support for additional operations for all seam managed persistence contexts.
+ *
+ *
+ * @author Gavin King
+ * @author Stuart Douglas
+ *
+ */
+public interface ManagedPersistenceContext
+{
+ /**
+ * changes the flush mode of the persistence context. This allows changing
+ * the flush mode to @{link FlushModeType#MANUAL} provided the underlying
+ * {@link SeamPersistenceProvider} supports it.
+ *
+ * @param flushMode the new flush mode
+ */
+ public void changeFlushMode(FlushModeType flushMode);
+
+ /**
+ *
+ * @return the persistence contexts qualifiers
+ */
+ public Set<Annotation> getQualifiers();
+
+ /**
+ * Returns the type of this persistence context. For JPA persistence contexts
+ * this will be <code>javax.persistence.EntityManager</code>. For pure
+ * hibernate PC's this will be <code>org.hibernate.Session</code>
+ *
+ */
+ public Class<?> getBeanType();
+
+ /**
+ * Returns the appropriate {@link SeamPersistenceProvider} implementation for
+ * this persistence context.
+ *
+ */
+ public SeamPersistenceProvider getProvider();
+
+ /**
+ * Closes the persistence context after the current transaction has
+ * completed.
+ *
+ * If no transaction is active the PC will be closed immediately
+ */
+ public void closeAfterTransaction();
+
+}
Copied: modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/PersistenceContexts.java (from rev 13694, modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/PersistenceContexts.java)
===================================================================
--- modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/PersistenceContexts.java (rev 0)
+++ modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/PersistenceContexts.java 2010-09-02 06:53:32 UTC (rev 13695)
@@ -0,0 +1,41 @@
+package org.jboss.seam.persistence;
+
+
+/**
+ * PersistenceContexts tracks active persistence contexts within a conversation.
+ *
+ * This allows for features such as changing the flush mode of all entity
+ * managers to @{link {@link FlushModeType#MANUAL} during the render response
+ * phase when using seam managed transactions in JSF
+ *
+ */
+public interface PersistenceContexts
+{
+
+ public abstract FlushModeType getFlushMode();
+
+ /**
+ * Changes the flush mode of all persistence contexts in the conversation
+ *
+ * @param flushMode the new flush mode
+ */
+ public abstract void changeFlushMode(FlushModeType flushMode);
+
+ /**
+ * Restore the previous flush mode if the current flush mode is marked as
+ * temporary.
+ */
+ public abstract void restoreFlushMode();
+
+ /**
+ * Perform
+ */
+ public abstract void beforeRender();
+
+ public abstract void afterRender();
+
+ public abstract void touch(ManagedPersistenceContext context);
+
+ public abstract void untouch(ManagedPersistenceContext context);
+
+}
\ No newline at end of file
Modified: modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/SeamManagedPersistenceContextCreated.java
===================================================================
--- modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/SeamManagedPersistenceContextCreated.java 2010-09-01 21:35:41 UTC (rev 13694)
+++ modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/SeamManagedPersistenceContextCreated.java 2010-09-02 06:53:32 UTC (rev 13695)
@@ -22,11 +22,13 @@
package org.jboss.seam.persistence;
import javax.persistence.EntityManager;
+
/**
- * event that is fired when the SMPC is created
+ * event that is fired when the SMPC is created. This allows you to configure
+ * the SMPC before it is used, e.g. by enabling hibernate filters
*
* @author Stuart Douglas <stuart(a)baileyroberts.com.au>
- *
+ *
*/
public class SeamManagedPersistenceContextCreated
{
Modified: modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/SeamPersistenceProvider.java
===================================================================
--- modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/SeamPersistenceProvider.java 2010-09-01 21:35:41 UTC (rev 13694)
+++ modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/SeamPersistenceProvider.java 2010-09-02 06:53:32 UTC (rev 13695)
@@ -1,20 +1,22 @@
package org.jboss.seam.persistence;
-import java.lang.reflect.Method;
import java.util.Set;
import javax.persistence.EntityManager;
import javax.transaction.Synchronization;
-import org.jboss.seam.persistence.transaction.FlushModeType;
-
/**
* The interface can be implemented to provide extra functionality to a seam
* managed persistence context.
*
- * seam-persistence contains a default implementation and a hinbernate based
+ * seam-persistence contains a default implementation and a hibernate based
* implementation.
*
+ * Persistence providers are services rather than beans. Injection etc is not
+ * availible and the implementations classes must be listed in
+ *
+ * META-INF/services/org.jboss.seam.persistence.SeamPersistenceProvider
+ *
* @author Stuart Douglas
*
*/
@@ -87,14 +89,6 @@
public abstract void checkVersion(Object bean, EntityManager entityManager, Object oldVersion, Object version);
/**
- * Enable a Filter. This is here just especially for Hibernate, since we well
- * know that other products don't have such cool features.
- *
- * public void enableFilter(Filter filter, EntityManager entityManager) {
- * throw new UnsupportedOperationException("Use of filters requires Hibernate as the persistence provider. Please use Hibernate or remove the filters configuration."
- * ); }
- */
- /**
* Register a Synchronization with the current transaction.
*/
public abstract boolean registerSynchronization(Synchronization sync, EntityManager entityManager);
@@ -116,12 +110,4 @@
*/
public abstract Class<?> getBeanClass(Object bean);
- public abstract Method getPostLoadMethod(Object bean, EntityManager entityManager);
-
- public abstract Method getPrePersistMethod(Object bean, EntityManager entityManager);
-
- public abstract Method getPreUpdateMethod(Object bean, EntityManager entityManager);
-
- public abstract Method getPreRemoveMethod(Object bean, EntityManager entityManager);
-
}
\ No newline at end of file
Deleted: modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/FlushModeType.java
===================================================================
--- modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/FlushModeType.java 2010-09-01 21:35:41 UTC (rev 13694)
+++ modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/FlushModeType.java 2010-09-02 06:53:32 UTC (rev 13695)
@@ -1,42 +0,0 @@
-package org.jboss.seam.persistence.transaction;
-
-/**
- * A full set of flush modes, including MANUAL,
- * which is a glaring missing feature of the JPA
- * spec.
- *
- * @author Gavin King
- *
- */
-public enum FlushModeType
-{
-
- /**
- * Flushing never occurs automatically, all changes are queued
- * until the application calls flush() explicitly.
- */
- MANUAL,
-
- /**
- * Flushing occurs automatically at commit time and when necessary
- * before query executions.
- */
- AUTO,
-
- /**
- * Flushing occurs automatically at transaction commit time.
- */
- COMMIT;
-
- /**
- * Does this flush mode keep unflushed changes past a
- * transaction commit?
- *
- * @return false for all flush modes except for MANUAL
- */
- public boolean dirtyBetweenTransactions()
- {
- return this==MANUAL;
- }
-
-}
Deleted: modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/PersistenceContexts.java
===================================================================
--- modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/PersistenceContexts.java 2010-09-01 21:35:41 UTC (rev 13694)
+++ modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/PersistenceContexts.java 2010-09-02 06:53:32 UTC (rev 13695)
@@ -1,23 +0,0 @@
-package org.jboss.seam.persistence.transaction;
-
-
-public interface PersistenceContexts
-{
-
- public abstract FlushModeType getFlushMode();
-
- public abstract void changeFlushMode(FlushModeType flushMode);
-
- public abstract void changeFlushMode(FlushModeType flushMode, boolean temporary);
-
- /**
- * Restore the previous flush mode if the current flush mode is marked as
- * temporary.
- */
- public abstract void restoreFlushMode();
-
- public abstract void beforeRender();
-
- public abstract void afterRender();
-
-}
\ No newline at end of file
Modified: modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/SeamApplicationException.java
===================================================================
--- modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/SeamApplicationException.java 2010-09-01 21:35:41 UTC (rev 13694)
+++ modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/SeamApplicationException.java 2010-09-02 06:53:32 UTC (rev 13695)
@@ -7,10 +7,16 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import javax.ejb.ApplicationException;
+
/**
* Seam Annotation for identifying an Exception class as an Application
- * Exception, which does not cause a transaction rollback
+ * Exception, which does not cause a transaction rollback.
*
+ * This will NOT control the behaviour of EJB container managed transactions. To
+ * avoid confusion, it is recommended that this annotation is only used outside
+ * an EE environment when @{link {@link ApplicationException} is not availible.
+ *
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
Modified: modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/TransactionPropagation.java
===================================================================
--- modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/TransactionPropagation.java 2010-09-01 21:35:41 UTC (rev 13694)
+++ modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/TransactionPropagation.java 2010-09-02 06:53:32 UTC (rev 13695)
@@ -26,7 +26,25 @@
*/
public enum TransactionPropagation
{
- REQUIRED, SUPPORTS, MANDATORY, NEVER;
+ /**
+ * A transaction will be started if one is not currently active.
+ */
+ REQUIRED,
+ /**
+ * A transaction will not be started if there is not one currently active,
+ * however this method supports running inside an existing transaction
+ */
+ SUPPORTS,
+ /**
+ * Requires a transaction to be active. If no transaction is active an
+ * {@link IllegalStateException} is thrown
+ */
+ MANDATORY,
+ /**
+ * Requires no transaction to be active. If a transaction is active an
+ * {@link IllegalStateException} is thrown
+ */
+ NEVER;
public boolean isNewTransactionRequired(boolean transactionActive)
{
Modified: modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/TransactionScoped.java
===================================================================
--- modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/TransactionScoped.java 2010-09-01 21:35:41 UTC (rev 13694)
+++ modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/TransactionScoped.java 2010-09-02 06:53:32 UTC (rev 13695)
@@ -30,6 +30,7 @@
import javax.enterprise.context.NormalScope;
/**
+ * CDI Scope that spans the current transaction
*
* @author Stuart Douglas
*
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/DefaultPersistenceProvider.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/DefaultPersistenceProvider.java 2010-09-01 21:35:41 UTC (rev 13694)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/DefaultPersistenceProvider.java 2010-09-02 06:53:32 UTC (rev 13695)
@@ -31,7 +31,6 @@
import javax.persistence.OptimisticLockException;
import javax.transaction.Synchronization;
-import org.jboss.seam.persistence.transaction.FlushModeType;
import org.jboss.weld.extensions.defaultbean.DefaultBean;
/**
Deleted: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/FlushModeManager.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/FlushModeManager.java 2010-09-01 21:35:41 UTC (rev 13694)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/FlushModeManager.java 2010-09-02 06:53:32 UTC (rev 13695)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.seam.persistence;
-
-import org.jboss.seam.persistence.transaction.FlushModeType;
-
-/**
- * provides a means of configuring the default flush mode
- *
- * @author Stuart Douglas
- *
- */
-public interface FlushModeManager
-{
- /**
- *
- * @return the default flush mode for all seam managed persistence contexts
- */
- public FlushModeType getFlushModeType();
-
- public void setFlushModeType(FlushModeType flushModeType);
-}
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/FlushModeManagerImpl.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/FlushModeManagerImpl.java 2010-09-01 21:35:41 UTC (rev 13694)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/FlushModeManagerImpl.java 2010-09-02 06:53:32 UTC (rev 13695)
@@ -25,7 +25,6 @@
import javax.enterprise.context.ApplicationScoped;
-import org.jboss.seam.persistence.transaction.FlushModeType;
import org.jboss.weld.extensions.defaultbean.DefaultBean;
/**
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/HibernatePersistenceProvider.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/HibernatePersistenceProvider.java 2010-09-01 21:35:41 UTC (rev 13694)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/HibernatePersistenceProvider.java 2010-09-02 06:53:32 UTC (rev 13695)
@@ -12,7 +12,6 @@
import org.hibernate.Session;
import org.hibernate.TransientObjectException;
import org.hibernate.proxy.HibernateProxy;
-import org.jboss.seam.persistence.transaction.FlushModeType;
import org.jboss.weld.extensions.util.Reflections;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Deleted: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContext.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContext.java 2010-09-01 21:35:41 UTC (rev 13694)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContext.java 2010-09-02 06:53:32 UTC (rev 13695)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.seam.persistence;
-
-import java.lang.annotation.Annotation;
-import java.util.Set;
-
-import org.jboss.seam.persistence.transaction.FlushModeType;
-
-/**
- * Support for changing flushmodes for an existing persistence context.
- *
- * @author Gavin King
- * @author Stuart Douglas
- *
- */
-public interface ManagedPersistenceContext
-{
- public void changeFlushMode(FlushModeType flushMode);
-
- public Set<Annotation> getQualifiers();
-
- public Class<?> getBeanType();
-
- public SeamPersistenceProvider getProvider();
-
- public void setClosed();
-
-}
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextBeanLifecycle.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextBeanLifecycle.java 2010-09-01 21:35:41 UTC (rev 13694)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextBeanLifecycle.java 2010-09-02 06:53:32 UTC (rev 13695)
@@ -124,7 +124,7 @@
public void destroy(Bean<EntityManager> bean, EntityManager em, CreationalContext<EntityManager> arg1)
{
- ((ManagedPersistenceContext)em).setClosed();
+ ((ManagedPersistenceContext)em).closeAfterTransaction();
arg1.release();
try
{
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextProxyHandler.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextProxyHandler.java 2010-09-01 21:35:41 UTC (rev 13694)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextProxyHandler.java 2010-09-02 06:53:32 UTC (rev 13695)
@@ -35,7 +35,6 @@
import javax.transaction.Synchronization;
import javax.transaction.SystemException;
-import org.jboss.seam.persistence.transaction.FlushModeType;
import org.jboss.seam.persistence.transaction.SeamTransaction;
import org.jboss.seam.persistence.transaction.literal.DefaultTransactionLiteral;
import org.jboss.seam.persistence.util.InstanceResolver;
@@ -68,7 +67,7 @@
private final SeamPersistenceProvider provider;
private boolean persistenceContextsTouched = false;
-
+
private boolean closeOnTransactionCommit = false;
static final Logger log = LoggerFactory.getLogger(ManagedPersistenceContextProxyHandler.class);
@@ -107,9 +106,9 @@
{
return provider;
}
- if ("setClosed".equals(method.getName()) && method.getParameterTypes().length == 0)
+ if ("closeAfterTransaction".equals(method.getName()) && method.getParameterTypes().length == 0)
{
- setClosed();
+ closeAfterTransaction();
return null;
}
return super.invoke(proxy, method, args);
@@ -136,7 +135,7 @@
}
}
- private void setClosed()throws SystemException
+ private void closeAfterTransaction() throws SystemException
{
SeamTransaction transaction = userTransactionInstance.get();
if (transaction.isActive())
@@ -151,7 +150,7 @@
}
}
}
-
+
private void changeFushMode(FlushModeType flushModeType)
{
provider.setFlushMode(delegate, flushModeType);
@@ -178,7 +177,7 @@
public void afterCompletion(int status)
{
synchronizationRegistered = false;
- if(closeOnTransactionCommit && delegate.isOpen())
+ if (closeOnTransactionCommit && delegate.isOpen())
{
delegate.close();
}
Deleted: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContexts.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContexts.java 2010-09-01 21:35:41 UTC (rev 13694)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContexts.java 2010-09-02 06:53:32 UTC (rev 13695)
@@ -1,34 +0,0 @@
-package org.jboss.seam.persistence;
-
-import java.util.Set;
-
-import org.jboss.seam.persistence.PersistenceContextsImpl.PersistenceContextDefintition;
-import org.jboss.seam.persistence.transaction.FlushModeType;
-
-public interface PersistenceContexts
-{
- public abstract void create(FlushModeManager manager);
-
- public abstract FlushModeType getFlushMode();
-
- public abstract Set<PersistenceContextDefintition> getTouchedContexts();
-
- public abstract void touch(ManagedPersistenceContext context);
-
- public abstract void untouch(ManagedPersistenceContext context);
-
- public abstract void changeFlushMode(FlushModeType flushMode);
-
- public abstract void changeFlushMode(FlushModeType flushMode, boolean temporary);
-
- /**
- * Restore the previous flush mode if the current flush mode is marked as
- * temporary.
- */
- public abstract void restoreFlushMode();
-
- public abstract void beforeRender();
-
- public abstract void afterRender();
-
-}
\ No newline at end of file
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContextsImpl.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContextsImpl.java 2010-09-01 21:35:41 UTC (rev 13694)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContextsImpl.java 2010-09-02 06:53:32 UTC (rev 13695)
@@ -12,7 +12,6 @@
import javax.enterprise.inject.spi.BeanManager;
import javax.inject.Inject;
-import org.jboss.seam.persistence.transaction.FlushModeType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -85,15 +84,6 @@
public void changeFlushMode(FlushModeType flushMode)
{
- changeFlushMode(flushMode, false);
- }
-
- public void changeFlushMode(FlushModeType flushMode, boolean temporary)
- {
- if (temporary)
- {
- realFlushMode = this.flushMode;
- }
this.flushMode = flushMode;
changeFlushModes();
}
Modified: modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/ManagedPersistenceContextFlushModeTest.java
===================================================================
--- modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/ManagedPersistenceContextFlushModeTest.java 2010-09-01 21:35:41 UTC (rev 13694)
+++ modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/ManagedPersistenceContextFlushModeTest.java 2010-09-02 06:53:32 UTC (rev 13695)
@@ -37,10 +37,10 @@
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.seam.persistence.FlushModeManager;
+import org.jboss.seam.persistence.FlushModeType;
import org.jboss.seam.persistence.ManagedPersistenceContext;
import org.jboss.seam.persistence.SePersistenceContextExtension;
import org.jboss.seam.persistence.PersistenceContexts;
-import org.jboss.seam.persistence.transaction.FlushModeType;
import org.jboss.seam.persistence.transaction.TransactionExtension;
import org.jboss.seam.persistence.transaction.scope.TransactionScopeExtension;
import org.jboss.seam.persistence.util.NamingUtils;
14 years, 3 months
Seam SVN: r13694 - in modules/security/trunk/examples: openid-rp and 56 other directories.
by seam-commits@lists.jboss.org
Author: marcelkolsteren
Date: 2010-09-01 17:35:41 -0400 (Wed, 01 Sep 2010)
New Revision: 13694
Added:
modules/security/trunk/examples/openid-rp/
modules/security/trunk/examples/openid-rp/pom.xml
modules/security/trunk/examples/openid-rp/readme.txt
modules/security/trunk/examples/openid-rp/src/
modules/security/trunk/examples/openid-rp/src/main/
modules/security/trunk/examples/openid-rp/src/main/java/
modules/security/trunk/examples/openid-rp/src/main/java/org/
modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/
modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/
modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/
modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/examples/
modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/examples/id_consumer/
modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/examples/id_consumer/Configuration.java
modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/examples/id_consumer/Identity.java
modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/examples/id_consumer/OpenIdRelyingPartyCustomizer.java
modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/examples/id_consumer/OpenIdRelyingPartySpiImpl.java
modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/examples/id_consumer/RequestObserver.java
modules/security/trunk/examples/openid-rp/src/main/resources/
modules/security/trunk/examples/openid-rp/src/main/resources/META-INF/
modules/security/trunk/examples/openid-rp/src/main/webapp/
modules/security/trunk/examples/openid-rp/src/main/webapp/AuthenticationFailed.xhtml
modules/security/trunk/examples/openid-rp/src/main/webapp/Configuration.xhtml
modules/security/trunk/examples/openid-rp/src/main/webapp/Index.xhtml
modules/security/trunk/examples/openid-rp/src/main/webapp/Login.xhtml
modules/security/trunk/examples/openid-rp/src/main/webapp/META-INF/
modules/security/trunk/examples/openid-rp/src/main/webapp/META-INF/MANIFEST.MF
modules/security/trunk/examples/openid-rp/src/main/webapp/Menu.xhtml
modules/security/trunk/examples/openid-rp/src/main/webapp/PageTemplate.xhtml
modules/security/trunk/examples/openid-rp/src/main/webapp/UserInfo.xhtml
modules/security/trunk/examples/openid-rp/src/main/webapp/WEB-INF/
modules/security/trunk/examples/openid-rp/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia
modules/security/trunk/examples/openid-rp/src/main/webapp/WEB-INF/beans.xml
modules/security/trunk/examples/openid-rp/src/main/webapp/WEB-INF/context.xml
modules/security/trunk/examples/openid-rp/src/main/webapp/WEB-INF/faces-config.xml
modules/security/trunk/examples/openid-rp/src/main/webapp/WEB-INF/lib/
modules/security/trunk/examples/openid-rp/src/main/webapp/WEB-INF/web.xml
modules/security/trunk/examples/openid-rp/src/main/webapp/index.jsp
modules/security/trunk/examples/openid-rp/src/main/webapp/styles.css
modules/security/trunk/examples/openid-rp/src/test/
modules/security/trunk/examples/openid-rp/src/test/java/
modules/security/trunk/examples/openid-rp/src/test/java/org/
modules/security/trunk/examples/openid-rp/src/test/java/org/jboss/
modules/security/trunk/examples/openid-rp/src/test/java/org/jboss/seam/
modules/security/trunk/examples/openid-rp/src/test/java/org/jboss/seam/security/
modules/security/trunk/examples/openid-rp/src/test/resources/
modules/security/trunk/examples/saml-idp/
modules/security/trunk/examples/saml-idp/pom.xml
modules/security/trunk/examples/saml-idp/readme.txt
modules/security/trunk/examples/saml-idp/src/
modules/security/trunk/examples/saml-idp/src/main/
modules/security/trunk/examples/saml-idp/src/main/java/
modules/security/trunk/examples/saml-idp/src/main/java/org/
modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/
modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/
modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/
modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/
modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/
modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/Configuration.java
modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/Identity.java
modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/Login.java
modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/RequestObserver.java
modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/Saml.java
modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/SamlIdentityProviderSpiImpl.java
modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/SamlIdpCustomizer.java
modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/SessionManagement.java
modules/security/trunk/examples/saml-idp/src/main/resources/
modules/security/trunk/examples/saml-idp/src/main/resources/META-INF/
modules/security/trunk/examples/saml-idp/src/main/resources/test_keystore.jks
modules/security/trunk/examples/saml-idp/src/main/webapp/
modules/security/trunk/examples/saml-idp/src/main/webapp/Configuration.xhtml
modules/security/trunk/examples/saml-idp/src/main/webapp/Index.xhtml
modules/security/trunk/examples/saml-idp/src/main/webapp/Login.xhtml
modules/security/trunk/examples/saml-idp/src/main/webapp/META-INF/
modules/security/trunk/examples/saml-idp/src/main/webapp/META-INF/MANIFEST.MF
modules/security/trunk/examples/saml-idp/src/main/webapp/Menu.xhtml
modules/security/trunk/examples/saml-idp/src/main/webapp/PageTemplate.xhtml
modules/security/trunk/examples/saml-idp/src/main/webapp/SessionManagement.xhtml
modules/security/trunk/examples/saml-idp/src/main/webapp/SingleLogoutFailed.xhtml
modules/security/trunk/examples/saml-idp/src/main/webapp/WEB-INF/
modules/security/trunk/examples/saml-idp/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia
modules/security/trunk/examples/saml-idp/src/main/webapp/WEB-INF/beans.xml
modules/security/trunk/examples/saml-idp/src/main/webapp/WEB-INF/context.xml
modules/security/trunk/examples/saml-idp/src/main/webapp/WEB-INF/faces-config.xml
modules/security/trunk/examples/saml-idp/src/main/webapp/WEB-INF/lib/
modules/security/trunk/examples/saml-idp/src/main/webapp/WEB-INF/web.xml
modules/security/trunk/examples/saml-idp/src/main/webapp/index.jsp
modules/security/trunk/examples/saml-idp/src/main/webapp/styles.css
modules/security/trunk/examples/saml-idp/src/test/
modules/security/trunk/examples/saml-idp/src/test/java/
modules/security/trunk/examples/saml-idp/src/test/java/org/
modules/security/trunk/examples/saml-idp/src/test/java/org/jboss/
modules/security/trunk/examples/saml-idp/src/test/java/org/jboss/seam/
modules/security/trunk/examples/saml-idp/src/test/java/org/jboss/seam/security/
modules/security/trunk/examples/saml-idp/src/test/resources/
modules/security/trunk/examples/saml-sp/
modules/security/trunk/examples/saml-sp/pom.xml
modules/security/trunk/examples/saml-sp/readme.txt
modules/security/trunk/examples/saml-sp/src/
modules/security/trunk/examples/saml-sp/src/main/
modules/security/trunk/examples/saml-sp/src/main/java/
modules/security/trunk/examples/saml-sp/src/main/java/org/
modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/
modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/
modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/
modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/
modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/
modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/Configuration.java
modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/Identity.java
modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/RequestObserver.java
modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/SamlServiceProviderSpiImpl.java
modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/SamlSpCustomizer.java
modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/VirtualApplicationCreator.java
modules/security/trunk/examples/saml-sp/src/main/resources/
modules/security/trunk/examples/saml-sp/src/main/resources/META-INF/
modules/security/trunk/examples/saml-sp/src/main/resources/test_keystore.jks
modules/security/trunk/examples/saml-sp/src/main/webapp/
modules/security/trunk/examples/saml-sp/src/main/webapp/AuthenticationFailed.xhtml
modules/security/trunk/examples/saml-sp/src/main/webapp/Configuration.xhtml
modules/security/trunk/examples/saml-sp/src/main/webapp/GlobalLogoutFailed.xhtml
modules/security/trunk/examples/saml-sp/src/main/webapp/Index.xhtml
modules/security/trunk/examples/saml-sp/src/main/webapp/Login.xhtml
modules/security/trunk/examples/saml-sp/src/main/webapp/META-INF/
modules/security/trunk/examples/saml-sp/src/main/webapp/META-INF/MANIFEST.MF
modules/security/trunk/examples/saml-sp/src/main/webapp/Menu.xhtml
modules/security/trunk/examples/saml-sp/src/main/webapp/PageTemplate.xhtml
modules/security/trunk/examples/saml-sp/src/main/webapp/UserInfo.xhtml
modules/security/trunk/examples/saml-sp/src/main/webapp/WEB-INF/
modules/security/trunk/examples/saml-sp/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia
modules/security/trunk/examples/saml-sp/src/main/webapp/WEB-INF/beans.xml
modules/security/trunk/examples/saml-sp/src/main/webapp/WEB-INF/context.xml
modules/security/trunk/examples/saml-sp/src/main/webapp/WEB-INF/faces-config.xml
modules/security/trunk/examples/saml-sp/src/main/webapp/WEB-INF/lib/
modules/security/trunk/examples/saml-sp/src/main/webapp/WEB-INF/web.xml
modules/security/trunk/examples/saml-sp/src/main/webapp/index.jsp
modules/security/trunk/examples/saml-sp/src/main/webapp/styles.css
modules/security/trunk/examples/saml-sp/src/test/
modules/security/trunk/examples/saml-sp/src/test/java/
modules/security/trunk/examples/saml-sp/src/test/java/org/
modules/security/trunk/examples/saml-sp/src/test/java/org/jboss/
modules/security/trunk/examples/saml-sp/src/test/java/org/jboss/seam/
modules/security/trunk/examples/saml-sp/src/test/java/org/jboss/seam/security/
modules/security/trunk/examples/saml-sp/src/test/resources/
Log:
Added sample applications for external authentication:
- openid-rp: OpenID Relying Party application
- saml-sp: SAMLv2 Service Provider application
- saml-idp: SAMLv2 Identity Provider application
Property changes on: modules/security/trunk/examples/openid-rp
___________________________________________________________________
Name: svn:ignore
+ .settings
target
.classpath
.project
Added: modules/security/trunk/examples/openid-rp/pom.xml
===================================================================
--- modules/security/trunk/examples/openid-rp/pom.xml (rev 0)
+++ modules/security/trunk/examples/openid-rp/pom.xml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,80 @@
+<?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>
+ <groupId>org.jboss.seam.security</groupId>
+ <artifactId>openid-rp</artifactId>
+ <packaging>war</packaging>
+ <name>OpenID Relying Party</name>
+
+ <parent>
+ <groupId>org.jboss.seam.security</groupId>
+ <artifactId>seam-security-parent</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <properties>
+ <seam.faces.version>3.0.0-SNAPSHOT</seam.faces.version>
+ <seam.international.version>3.0.0-SNAPSHOT</seam.international.version>
+ </properties>
+
+ <build>
+ <finalName>openid-rp</finalName>
+ </build>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.seam.security</groupId>
+ <artifactId>seam-security-external</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>validation-api</artifactId>
+ <groupId>javax.validation</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.servlet</groupId>
+ <artifactId>seam-servlet</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <!-- This is necessary until a new JSF-API is published to central -->
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!--
+ <dependency> <groupId>org.jboss.seam.faces</groupId>
+ <artifactId>seam-faces</artifactId>
+ <version>${project.version}</version> </dependency>
+ -->
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <!-- Required until the Servlet 3.0 API can be resolved in Central -->
+ <groupId>org.jboss.spec.javax.servlet</groupId>
+ <artifactId>jboss-servlet-api_3.0_spec</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
Added: modules/security/trunk/examples/openid-rp/readme.txt
===================================================================
--- modules/security/trunk/examples/openid-rp/readme.txt (rev 0)
+++ modules/security/trunk/examples/openid-rp/readme.txt 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,60 @@
+OPENID-RP EXAMPLE
+
+
+What is it?
+===========
+
+This demo shows a web application that uses OpenID to authenticate users (i.e. a
+web application that acts as an OpenID Relying Party).
+
+
+How to deploy it?
+=================
+
+The application is packaged as a war file and should run in any JEE6
+environment. It has been tested on JBoss AS 6. Before deploying the application,
+you need to map this host name to the localhost:
+
+www.openid-rp.com
+
+On Unix based systems, you do this by putting the following lines in
+'/etc/hosts':
+
+127.0.0.1 www.openid-rp.com
+
+
+Some background info
+====================
+
+The Identity Provider is preconfigured to run at port 8080, to use a test key
+store which is included in the war file, and to use the http protocol for
+communicating with IDPs. These settings are ok for a test setup, but please be
+aware that in production, you'd use http on port 443. In the test application
+these settings are done programmatically (by the OpenIdRelyingPartyCustomizer).
+
+
+How to use the application
+==========================
+
+Start the application and fetch this URL in your browser:
+
+http://www.openid-rp.com:8080/openid-rp
+
+Go to the login page. There you'll find three OpenID Providers (OPs) to choose
+from. Just choose one where you have an account, and you'll be redirected to the
+site of that provider. There you authenticate, and there you grant the OpenID
+provider to send your OpenID identifier, and your e-mail address, to the relying
+party, which is the sample application in this case (which won't do anything
+with your e-mail address except from displaying it).
+
+Some OpenID providers will prove reluctant for sending the e-mail attribute, or
+will advice you not to grant permissions to this relying party. In a production
+scenario you won't have this, because you would:
+- use https instead of http
+- use a host name that is registered in DNS
+- use an HTML meta-tag in the file https://www.openid-rp.com to refer to the
+XRDS file that describes the relying party service endpoint
+
+You could have a look at the Configuration page to see what is the realm of the
+OpenID Relying party (it's derived from the host name). On that page you'll also
+find a link to the XRDS file that contains meta data about the relying party.
\ No newline at end of file
Added: modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/examples/id_consumer/Configuration.java
===================================================================
--- modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/examples/id_consumer/Configuration.java (rev 0)
+++ modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/examples/id_consumer/Configuration.java 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.security.examples.id_consumer;
+
+import javax.enterprise.inject.Model;
+import javax.inject.Inject;
+
+import org.jboss.seam.security.external.api.OpenIdRelyingPartyConfigurationApi;
+
+@Model
+public class Configuration
+{
+ @Inject
+ private OpenIdRelyingPartyConfigurationApi confApi;
+
+ public String getRealm()
+ {
+ return confApi.getRealm();
+ }
+
+ public String getXrdsURL()
+ {
+ return confApi.getXrdsURL();
+ }
+}
Property changes on: modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/examples/id_consumer/Configuration.java
___________________________________________________________________
Name: svn
+ eol-style=native
Name: svn:keywords
+ Revision Author Date
Added: modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/examples/id_consumer/Identity.java
===================================================================
--- modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/examples/id_consumer/Identity.java (rev 0)
+++ modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/examples/id_consumer/Identity.java 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,106 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.security.examples.id_consumer;
+
+import java.io.Serializable;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.enterprise.context.SessionScoped;
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import org.jboss.seam.security.external.api.OpenIdAttribute;
+import org.jboss.seam.security.external.api.OpenIdPrincipal;
+import org.jboss.seam.security.external.api.OpenIdRelyingPartyApi;
+
+@SessionScoped
+@Named
+public class Identity implements Serializable
+{
+ private static final long serialVersionUID = -7096110154986991513L;
+
+ private OpenIdPrincipal openIdPrincipal;
+
+ @Inject
+ private OpenIdRelyingPartyApi openIdApi;
+
+ public OpenIdPrincipal getOpenIdPrincipal()
+ {
+ return openIdPrincipal;
+ }
+
+ public void startLogin(String openId)
+ {
+ if (!isLoggedIn())
+ {
+ List<OpenIdAttribute> attributes = new LinkedList<OpenIdAttribute>();
+ attributes.add(new OpenIdAttribute("email", "http://schema.openid.net/contact/email", false));
+ openIdApi.login(openId, attributes);
+ }
+ else
+ {
+ FacesMessage facesMessage = new FacesMessage("Already logged in.");
+ FacesContext.getCurrentInstance().addMessage(null, facesMessage);
+ }
+ }
+
+ public void finishLogin(OpenIdPrincipal openIdPrincipal)
+ {
+ this.openIdPrincipal = openIdPrincipal;
+ }
+
+ public void logout()
+ {
+ if (isLoggedIn())
+ {
+ openIdPrincipal = null;
+ redirectToViewId("/Index.xhtml");
+ }
+ else
+ {
+ FacesMessage facesMessage = new FacesMessage("Not logged in.");
+ FacesContext.getCurrentInstance().addMessage(null, facesMessage);
+ }
+ }
+
+ public boolean isLoggedIn()
+ {
+ return openIdPrincipal != null;
+ }
+
+ public void redirectToLoginIfNotLoggedIn()
+ {
+ if (!isLoggedIn())
+ {
+ redirectToViewId("/Login.xhtml");
+ }
+ }
+
+ private void redirectToViewId(String viewId)
+ {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ FacesContext.getCurrentInstance().getApplication().getNavigationHandler().handleNavigation(facesContext, null, viewId + "?faces-redirect=true");
+ }
+}
Property changes on: modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/examples/id_consumer/Identity.java
___________________________________________________________________
Name: svn
+ eol-style=native
Name: svn:keywords
+ Revision Author Date
Added: modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/examples/id_consumer/OpenIdRelyingPartyCustomizer.java
===================================================================
--- modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/examples/id_consumer/OpenIdRelyingPartyCustomizer.java (rev 0)
+++ modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/examples/id_consumer/OpenIdRelyingPartyCustomizer.java 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.security.examples.id_consumer;
+
+import javax.enterprise.event.Observes;
+import javax.servlet.ServletContextEvent;
+
+import org.jboss.seam.security.external.api.OpenIdRelyingPartyConfigurationApi;
+import org.jboss.seam.servlet.event.qualifier.Initialized;
+
+public class OpenIdRelyingPartyCustomizer
+{
+ public void servletInitialized(@Observes @Initialized final ServletContextEvent e, OpenIdRelyingPartyConfigurationApi rp)
+ {
+ rp.setHostName("www.openid-rp.com");
+ rp.setPort(8080);
+ rp.setProtocol("http");
+ }
+
+}
Property changes on: modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/examples/id_consumer/OpenIdRelyingPartyCustomizer.java
___________________________________________________________________
Name: svn
+ eol-style=native
Name: svn:keywords
+ Revision Author Date
Added: modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/examples/id_consumer/OpenIdRelyingPartySpiImpl.java
===================================================================
--- modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/examples/id_consumer/OpenIdRelyingPartySpiImpl.java (rev 0)
+++ modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/examples/id_consumer/OpenIdRelyingPartySpiImpl.java 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.security.examples.id_consumer;
+
+import java.io.IOException;
+
+import javax.inject.Inject;
+import javax.servlet.ServletContext;
+
+import org.jboss.seam.security.external.api.OpenIdPrincipal;
+import org.jboss.seam.security.external.api.ResponseHolder;
+import org.jboss.seam.security.external.spi.OpenIdRelyingPartySpi;
+
+public class OpenIdRelyingPartySpiImpl implements OpenIdRelyingPartySpi
+{
+ @Inject
+ private ResponseHolder responseHolder;
+
+ @Inject
+ private ServletContext servletContext;
+
+ @Inject
+ private Identity identity;
+
+ public void loginSucceeded(OpenIdPrincipal principal)
+ {
+ try
+ {
+ identity.finishLogin(principal);
+ responseHolder.getResponse().sendRedirect(servletContext.getContextPath() + "/UserInfo.jsf");
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void loginFailed()
+ {
+ try
+ {
+ responseHolder.getResponse().sendRedirect(servletContext.getContextPath() + "/AuthenticationFailed.jsf");
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+}
Property changes on: modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/examples/id_consumer/OpenIdRelyingPartySpiImpl.java
___________________________________________________________________
Name: svn
+ eol-style=native
Name: svn:keywords
+ Revision Author Date
Added: modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/examples/id_consumer/RequestObserver.java
===================================================================
--- modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/examples/id_consumer/RequestObserver.java (rev 0)
+++ modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/examples/id_consumer/RequestObserver.java 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.security.examples.id_consumer;
+
+import javax.enterprise.event.Observes;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.inject.Inject;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jboss.seam.security.external.api.ResponseHolder;
+import org.jboss.seam.security.external.dialogues.api.AfterDialogueActivation;
+
+public class RequestObserver
+{
+ @Inject
+ private ResponseHolder responseHolder;
+
+ public void dialogueCreated(@Observes AfterDialogueActivation event)
+ {
+ if (FacesContext.getCurrentInstance() != null)
+ {
+ ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
+ responseHolder.setResponse((HttpServletResponse) externalContext.getResponse());
+ }
+ }
+
+}
Property changes on: modules/security/trunk/examples/openid-rp/src/main/java/org/jboss/seam/security/examples/id_consumer/RequestObserver.java
___________________________________________________________________
Name: svn
+ eol-style=native
Name: svn:keywords
+ Revision Author Date
Added: modules/security/trunk/examples/openid-rp/src/main/webapp/AuthenticationFailed.xhtml
===================================================================
--- modules/security/trunk/examples/openid-rp/src/main/webapp/AuthenticationFailed.xhtml (rev 0)
+++ modules/security/trunk/examples/openid-rp/src/main/webapp/AuthenticationFailed.xhtml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,10 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+<body>
+<h1>Authentication failed.</h1>
+</body>
+
+</html>
\ No newline at end of file
Added: modules/security/trunk/examples/openid-rp/src/main/webapp/Configuration.xhtml
===================================================================
--- modules/security/trunk/examples/openid-rp/src/main/webapp/Configuration.xhtml (rev 0)
+++ modules/security/trunk/examples/openid-rp/src/main/webapp/Configuration.xhtml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,15 @@
+<f:view xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+ <ui:composition template="/PageTemplate.xhtml">
+ <h1>Configuration</h1>
+ <h:panelGrid columns="2" columnClasses="propertyName, propertyValue">
+ <h:outputText value="XRDS URL" />
+ <h:outputText value="#{configuration.xrdsURL}" />
+ <h:outputText value="Realm" />
+ <h:outputText value="#{configuration.realm}" />
+ </h:panelGrid>
+
+ </ui:composition>
+</f:view>
Added: modules/security/trunk/examples/openid-rp/src/main/webapp/Index.xhtml
===================================================================
--- modules/security/trunk/examples/openid-rp/src/main/webapp/Index.xhtml (rev 0)
+++ modules/security/trunk/examples/openid-rp/src/main/webapp/Index.xhtml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,7 @@
+<f:view xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+ <ui:composition template="/PageTemplate.xhtml">
+ </ui:composition>
+</f:view>
\ No newline at end of file
Added: modules/security/trunk/examples/openid-rp/src/main/webapp/Login.xhtml
===================================================================
--- modules/security/trunk/examples/openid-rp/src/main/webapp/Login.xhtml (rev 0)
+++ modules/security/trunk/examples/openid-rp/src/main/webapp/Login.xhtml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,24 @@
+<f:view xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+ <ui:composition template="/PageTemplate.xhtml">
+
+ <h1>Login</h1>
+
+ <h:form>
+ <h:commandLink
+ action="#{identity.startLogin('https://www.google.com/accounts/o8/id')}"
+ value="Login with Google" />
+ <br />
+ <h:commandLink
+ action="#{identity.startLogin('https://me.yahoo.com')}"
+ value="Login with Yahoo" />
+ <br />
+ <h:commandLink
+ action="#{identity.startLogin('https://myopenid.com')}"
+ value="Login with myOpenID" />
+ </h:form>
+
+ </ui:composition>
+</f:view>
\ No newline at end of file
Added: modules/security/trunk/examples/openid-rp/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- modules/security/trunk/examples/openid-rp/src/main/webapp/META-INF/MANIFEST.MF (rev 0)
+++ modules/security/trunk/examples/openid-rp/src/main/webapp/META-INF/MANIFEST.MF 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added: modules/security/trunk/examples/openid-rp/src/main/webapp/Menu.xhtml
===================================================================
--- modules/security/trunk/examples/openid-rp/src/main/webapp/Menu.xhtml (rev 0)
+++ modules/security/trunk/examples/openid-rp/src/main/webapp/Menu.xhtml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,17 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+ <h:form>
+ <h:commandLink value="Login" action="/Login.xhtml"
+ disabled="#{identity.loggedIn}" /> |
+ <h:outputText value="User Info" action="/UserInfo.xhtml"
+ disabled="#{!identity.loggedIn}" /> |
+ <h:commandLink value="Configuration" action="/Configuration.xhtml" /> |
+ <h:commandLink value="Logout" action="#{identity.logout}"
+ disabled="#{!identity.loggedIn}" />
+ </h:form>
+
+</ui:composition>
\ No newline at end of file
Added: modules/security/trunk/examples/openid-rp/src/main/webapp/PageTemplate.xhtml
===================================================================
--- modules/security/trunk/examples/openid-rp/src/main/webapp/PageTemplate.xhtml (rev 0)
+++ modules/security/trunk/examples/openid-rp/src/main/webapp/PageTemplate.xhtml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<h:body>
+ <h:panelGroup layout="block" styleClass="page">
+
+ <h:head>
+ <link type="text/css" rel="stylesheet" href="styles.css" />
+ </h:head>
+
+ <h:panelGroup layout="block" styleClass="menu">
+ <ui:include src="/Menu.xhtml" />
+ </h:panelGroup>
+
+ <h:messages />
+
+ <h:panelGroup layout="block" styleClass="content">
+ <ui:insert />
+ </h:panelGroup>
+
+ </h:panelGroup>
+</h:body>
+</html>
\ No newline at end of file
Added: modules/security/trunk/examples/openid-rp/src/main/webapp/UserInfo.xhtml
===================================================================
--- modules/security/trunk/examples/openid-rp/src/main/webapp/UserInfo.xhtml (rev 0)
+++ modules/security/trunk/examples/openid-rp/src/main/webapp/UserInfo.xhtml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,24 @@
+<f:view xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
+ xmlns:f="http://java.sun.com/jsf/core">
+ <f:metadata>
+ <f:event type="preRenderView"
+ listener="#{identity.redirectToLoginIfNotLoggedIn}" />
+ </f:metadata>
+ <ui:composition template="/PageTemplate.xhtml">
+
+ <h1>User info</h1>
+
+ <h:panelGrid columns="2" columnClasses="propertyName, propertyValue">
+ <h:outputText value="Verified User Identifier" />
+ <h:outputText value="#{identity.openIdPrincipal.identifier}" />
+ <h:outputText value="OpenID Provider" />
+ <h:outputText value="#{identity.openIdPrincipal.openIdProvider}" />
+ <h:outputText value="Email" />
+ <h:outputText value="#{identity.openIdPrincipal.attributes.email}" />
+ </h:panelGrid>
+
+ </ui:composition>
+</f:view>
\ No newline at end of file
Added: modules/security/trunk/examples/openid-rp/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia
===================================================================
--- modules/security/trunk/examples/openid-rp/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia (rev 0)
+++ modules/security/trunk/examples/openid-rp/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<PROCESS model-entity="JSFProcess"/>
Added: modules/security/trunk/examples/openid-rp/src/main/webapp/WEB-INF/beans.xml
===================================================================
--- modules/security/trunk/examples/openid-rp/src/main/webapp/WEB-INF/beans.xml (rev 0)
+++ modules/security/trunk/examples/openid-rp/src/main/webapp/WEB-INF/beans.xml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,7 @@
+<?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">
+ <alternatives>
+ <classes>org.jboss.seam.security.external.openid.OpenIdRpInApplicationScopeProducer</classes>
+ </alternatives>
+</beans>
Added: modules/security/trunk/examples/openid-rp/src/main/webapp/WEB-INF/context.xml
===================================================================
--- modules/security/trunk/examples/openid-rp/src/main/webapp/WEB-INF/context.xml (rev 0)
+++ modules/security/trunk/examples/openid-rp/src/main/webapp/WEB-INF/context.xml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context>
+ <!-- log all incoming and outgoing messages. -->
+ <Valve className="org.apache.catalina.valves.RequestDumperValve" />
+</Context>
\ No newline at end of file
Added: modules/security/trunk/examples/openid-rp/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- modules/security/trunk/examples/openid-rp/src/main/webapp/WEB-INF/faces-config.xml (rev 0)
+++ modules/security/trunk/examples/openid-rp/src/main/webapp/WEB-INF/faces-config.xml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faces-config version="2.0" 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-facesconfig_2_0.xsd">
+
+ <name>openidrp</name>
+
+</faces-config>
Added: modules/security/trunk/examples/openid-rp/src/main/webapp/WEB-INF/web.xml
===================================================================
--- modules/security/trunk/examples/openid-rp/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ modules/security/trunk/examples/openid-rp/src/main/webapp/WEB-INF/web.xml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="3.0" 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_3_0.xsd">
+
+ <context-param>
+ <param-name>javax.faces.PROJECT_STAGE</param-name>
+ <param-value>Development</param-value>
+ </context-param>
+
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ </welcome-file-list>
+
+</web-app>
Added: modules/security/trunk/examples/openid-rp/src/main/webapp/index.jsp
===================================================================
--- modules/security/trunk/examples/openid-rp/src/main/webapp/index.jsp (rev 0)
+++ modules/security/trunk/examples/openid-rp/src/main/webapp/index.jsp 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,8 @@
+<html>
+ <head>
+ <title>Initial Redirect Page</title>
+ </head>
+ <body>
+ <% response.sendRedirect("Index.jsf"); %>
+ </body>
+</html>
\ No newline at end of file
Added: modules/security/trunk/examples/openid-rp/src/main/webapp/styles.css
===================================================================
--- modules/security/trunk/examples/openid-rp/src/main/webapp/styles.css (rev 0)
+++ modules/security/trunk/examples/openid-rp/src/main/webapp/styles.css 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,31 @@
+.page {
+ width: 800px;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+.menu {
+ margin-top: 15px;
+ height: 50px;
+ background: #d5a5ac;
+ padding: 5px;
+}
+
+.content {
+ margin-top: 15px;
+ top: 100px;
+ margin-left: auto;
+ margin-right: auto;
+ background: white;
+ padding: 5px;
+}
+
+.propertyName {
+ padding: 5px;
+ background-color: #aaaaaa;
+}
+
+.propertyValue {
+ padding: 5px;
+ background-color: #dddddd;
+}
\ No newline at end of file
Property changes on: modules/security/trunk/examples/saml-idp
___________________________________________________________________
Name: svn:ignore
+ .settings
target
.classpath
.project
Added: modules/security/trunk/examples/saml-idp/pom.xml
===================================================================
--- modules/security/trunk/examples/saml-idp/pom.xml (rev 0)
+++ modules/security/trunk/examples/saml-idp/pom.xml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,75 @@
+<?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>
+ <groupId>org.jboss.seam.security</groupId>
+ <artifactId>saml-idp</artifactId>
+ <packaging>war</packaging>
+ <name>SAML Identity Provider</name>
+
+ <parent>
+ <groupId>org.jboss.seam.security</groupId>
+ <artifactId>seam-security-parent</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <build>
+ <finalName>saml-idp</finalName>
+ </build>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.seam.security</groupId>
+ <artifactId>seam-security-external</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>validation-api</artifactId>
+ <groupId>javax.validation</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.servlet</groupId>
+ <artifactId>seam-servlet</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <!-- This is necessary until a new JSF-API is published to central -->
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!--
+ <dependency> <groupId>org.jboss.seam.faces</groupId>
+ <artifactId>seam-faces</artifactId>
+ <version>${project.version}</version> </dependency>
+ -->
+
+ <dependency>
+ <!-- Required until the Servlet 3.0 API can be resolved in Central -->
+ <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>
+
+ </dependencies>
+
+</project>
Added: modules/security/trunk/examples/saml-idp/readme.txt
===================================================================
--- modules/security/trunk/examples/saml-idp/readme.txt (rev 0)
+++ modules/security/trunk/examples/saml-idp/readme.txt 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,75 @@
+SAML-IDP EXAMPLE
+
+
+What is it?
+===========
+
+This demo web application shows how to turn your application into a SAMLv2
+identity provider (IDP). It makes use of the SAMLv2 submodule of Seam Security.
+
+
+How to deploy it?
+=================
+
+The application is packaged as a war file and should run in any JEE6
+environment. It has been tested on JBoss AS 6. Before deploying the application,
+you need to map this two host name to the localhost:
+
+www.saml-idp.com
+
+On Unix based systems, you do this by putting the following lines in
+'/etc/hosts':
+
+127.0.0.1 www.saml-idp.com
+
+
+Some background info
+====================
+
+The Identity Provider is preconfigured to run at port 8080, to use a test key
+store which is included in the war file, and to use the http protocol for
+communicating with IDPs. These settings are ok for a test setup, but please be
+aware that in production, you'd use http on port 443, and you'd use your own
+well-secured keystore, probably somewhere on the file system. In the test
+application these settings are done programmatically (by the IdpCustomizer).
+
+
+How to use the application
+==========================
+
+Start the application and surf to:
+
+http://www.saml-idp.com:8080/saml-idp
+
+First you need to configure the service provider(s) to trust. You have different
+options:
+- use the seam-sp example application
+- install and use your own SAMLv2 compliant service provider
+- use an existing SAMLv2 service provider where you have access to (e.g. Google
+Applications Premium edition, which can act as a SAMLv2 Service Provider)
+
+You need to create a trust relationship between the chosen service provider(s)
+and the sample application. You do that by exchanging meta data. The menu option
+"Configuration" will help you. Note that in a production system you'd definitely
+restrict such a configuration page to system administrators! On the
+configuration page, you see a link that points out where the meta data of the
+current identity provider resides. You use that link for uploading the meta data
+to your service provider. The other way around, you find out where your service
+provider's meta data is (read your SP manual), and you upload it on the
+Configuration page. Repeat this procedure for all service providers.
+
+Now you are ready to login. Go to the login page by using the menu, and supply
+your user name. A real life app will ask for your password to verify your
+identity, but for this example we just assume it's ok. When logged in, you can
+access the session management page. There you see the name of the current user,
+and the service provider sessions that are active. No service provider session
+is active at this moment. You can now try to login to your service provider, and
+see that you don't have to sign in again, cause you're already logged in at the
+identity provider. You can also login to a service provider from the session
+management page. This option will open the service provider's application in a
+new window, and you'll be logged in there immediately.
+
+After having experienced single sign on, you can play around with logout
+scenarios. A global logout will log you out the session at the IDP and all
+participating sessions at the SPs. A local logout at the IDP will remove the IDP
+session without informing the service providers that participate in the session.
\ No newline at end of file
Added: modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/Configuration.java
===================================================================
--- modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/Configuration.java (rev 0)
+++ modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/Configuration.java 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.security.examples.id_provider;
+
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+
+import javax.enterprise.inject.Model;
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.inject.Inject;
+
+import org.jboss.seam.security.external.api.SamlEntityConfigurationApi;
+import org.jboss.seam.security.external.saml.SamlExternalEntity;
+
+@Model
+public class Configuration
+{
+ private String spMetaDataUrl;
+
+ @Inject
+ private SamlEntityConfigurationApi samlEntityConfig;
+
+ public String getSpMetaDataUrl()
+ {
+ return spMetaDataUrl;
+ }
+
+ public void setSpMetaDataUrl(String spMetaDataUrl)
+ {
+ this.spMetaDataUrl = spMetaDataUrl;
+ }
+
+ public void addSamlServiceProvider()
+ {
+ try
+ {
+ URL url = new URL(spMetaDataUrl);
+ URLConnection urlConnection = url.openConnection();
+ urlConnection.setConnectTimeout(3000);
+ urlConnection.setReadTimeout(3000);
+ Reader reader = new InputStreamReader(urlConnection.getInputStream());
+ SamlExternalEntity samlEntity = samlEntityConfig.addExternalSamlEntity(reader);
+
+ FacesMessage facesMessage = new FacesMessage("SAML entity " + samlEntity.getEntityId() + " has been added.");
+ FacesContext.getCurrentInstance().addMessage(null, facesMessage);
+ }
+ catch (MalformedURLException e)
+ {
+ FacesMessage facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR, "Malformed URL.", "");
+ FacesContext.getCurrentInstance().addMessage(null, facesMessage);
+ }
+ catch (IOException e)
+ {
+ FacesMessage facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR, "Metadata could not be read.", "");
+ FacesContext.getCurrentInstance().addMessage(null, facesMessage);
+ }
+ }
+
+ public String getMetaDataUrl()
+ {
+ return samlEntityConfig.getMetaDataURL();
+ }
+}
Property changes on: modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/Configuration.java
___________________________________________________________________
Name: svn
+ eol-style=native
Name: svn:keywords
+ Revision Author Date
Added: modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/Identity.java
===================================================================
--- modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/Identity.java (rev 0)
+++ modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/Identity.java 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,85 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.security.examples.id_provider;
+
+import java.io.Serializable;
+
+import javax.faces.context.FacesContext;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import org.jboss.seam.security.external.api.SamlIdentityProviderApi;
+import org.jboss.seam.security.external.api.SamlNameId;
+import org.jboss.seam.security.external.saml.idp.SamlIdpSession;
+
+@Named
+public class Identity implements Serializable
+{
+ private static final long serialVersionUID = 3739296115750412807L;
+
+ @Inject
+ private SamlIdentityProviderApi samlIdp;
+
+ public void localLogin(String userName)
+ {
+ samlIdp.localLogin(new SamlNameId(userName, null, null), null);
+ }
+
+ public void remoteLogin(String spEntityId)
+ {
+ samlIdp.remoteLogin(spEntityId, null);
+ }
+
+ public void localLogout()
+ {
+ samlIdp.localLogout();
+ }
+
+ public void globalLogout()
+ {
+ samlIdp.globalLogout();
+ }
+
+ public boolean isLoggedIn()
+ {
+ return samlIdp.getSession() != null;
+ }
+
+ public void redirectToLoginIfNotLoggedIn()
+ {
+ if (!isLoggedIn())
+ {
+ redirectToViewId("/Login.xhtml");
+ }
+ }
+
+ public SamlIdpSession getSamlIdpSession()
+ {
+ return samlIdp.getSession();
+ }
+
+ private void redirectToViewId(String viewId)
+ {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ FacesContext.getCurrentInstance().getApplication().getNavigationHandler().handleNavigation(facesContext, null, viewId + "?faces-redirect=true");
+ }
+}
Property changes on: modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/Identity.java
___________________________________________________________________
Name: svn
+ eol-style=native
Name: svn:keywords
+ Revision Author Date
Added: modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/Login.java
===================================================================
--- modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/Login.java (rev 0)
+++ modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/Login.java 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.security.examples.id_provider;
+
+import javax.enterprise.inject.Model;
+import javax.inject.Inject;
+
+import org.jboss.seam.security.external.api.SamlIdentityProviderApi;
+import org.jboss.seam.security.external.dialogues.DialogueManager;
+
+@Model
+public class Login
+{
+ @Inject
+ private SamlIdentityProviderApi samlIdentityProviderApi;
+
+ private String userName;
+
+ private String samlDialogueId;
+
+ @Inject
+ private DialogueManager dialogueManager;
+
+ @Inject
+ private Identity identity;
+
+ public String getUserName()
+ {
+ return userName;
+ }
+
+ public void setUserName(String userName)
+ {
+ this.userName = userName;
+ }
+
+ public String getSamlDialogueId()
+ {
+ return samlDialogueId;
+ }
+
+ public void setSamlDialogueId(String samlDialogueId)
+ {
+ this.samlDialogueId = samlDialogueId;
+ }
+
+ public String login()
+ {
+ identity.localLogin(userName);
+ if (samlDialogueId != null)
+ {
+ dialogueManager.attachDialogue(samlDialogueId);
+ samlIdentityProviderApi.authenticationSucceeded();
+ dialogueManager.detachDialogue();
+ return "SAML_LOGIN";
+ }
+ else
+ {
+ return "LOCAL_LOGIN";
+ }
+ }
+
+ public void cancel()
+ {
+ if (samlDialogueId != null)
+ {
+ dialogueManager.attachDialogue(samlDialogueId);
+ samlIdentityProviderApi.authenticationFailed();
+ dialogueManager.detachDialogue();
+ }
+ else
+ {
+ throw new IllegalStateException("cancel method can only be called during a SAML login");
+ }
+ }
+}
Property changes on: modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/Login.java
___________________________________________________________________
Name: svn
+ eol-style=native
Name: svn:keywords
+ Revision Author Date
Added: modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/RequestObserver.java
===================================================================
--- modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/RequestObserver.java (rev 0)
+++ modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/RequestObserver.java 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.security.examples.id_provider;
+
+import javax.enterprise.event.Observes;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.inject.Inject;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jboss.seam.security.external.api.ResponseHolder;
+import org.jboss.seam.security.external.dialogues.api.AfterDialogueActivation;
+
+public class RequestObserver
+{
+ @Inject
+ private ResponseHolder responseHolder;
+
+ public void dialogueCreated(@Observes AfterDialogueActivation event)
+ {
+ if (FacesContext.getCurrentInstance() != null)
+ {
+ ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
+ responseHolder.setResponse((HttpServletResponse) externalContext.getResponse());
+ }
+ }
+}
\ No newline at end of file
Property changes on: modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/RequestObserver.java
___________________________________________________________________
Name: svn
+ eol-style=native
Name: svn:keywords
+ Revision Author Date
Added: modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/Saml.java
===================================================================
--- modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/Saml.java (rev 0)
+++ modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/Saml.java 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.security.examples.id_provider;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.enterprise.inject.Model;
+import javax.inject.Inject;
+
+import org.jboss.seam.security.external.api.SamlIdentityProviderApi;
+import org.jboss.seam.security.external.api.SamlIdentityProviderConfigurationApi;
+import org.jboss.seam.security.external.saml.SamlExternalEntity;
+import org.jboss.seam.security.external.saml.idp.SamlIdpSession;
+
+@Model
+public class Saml
+{
+ @Inject
+ private SamlIdentityProviderApi samlIdp;
+
+ @Inject
+ private SamlIdentityProviderConfigurationApi samlIdpConfig;
+
+ public List<String> getSpEntityIds()
+ {
+ List<String> entityIds = new LinkedList<String>();
+ for (SamlExternalEntity entity : samlIdpConfig.getExternalSamlEntities())
+ {
+ entityIds.add(entity.getEntityId());
+ }
+ return entityIds;
+ }
+
+ public SamlIdpSession getSession()
+ {
+ return samlIdp.getSession();
+ }
+}
Property changes on: modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/Saml.java
___________________________________________________________________
Name: svn
+ eol-style=native
Name: svn:keywords
+ Revision Author Date
Added: modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/SamlIdentityProviderSpiImpl.java
===================================================================
--- modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/SamlIdentityProviderSpiImpl.java (rev 0)
+++ modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/SamlIdentityProviderSpiImpl.java 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,103 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.security.examples.id_provider;
+
+import java.io.IOException;
+
+import javax.inject.Inject;
+import javax.servlet.ServletContext;
+
+import org.jboss.seam.security.external.api.ResponseHolder;
+import org.jboss.seam.security.external.api.SamlIdentityProviderApi;
+import org.jboss.seam.security.external.dialogues.api.Dialogue;
+import org.jboss.seam.security.external.saml.idp.SamlIdpSession;
+import org.jboss.seam.security.external.spi.SamlIdentityProviderSpi;
+import org.slf4j.Logger;
+
+public class SamlIdentityProviderSpiImpl implements SamlIdentityProviderSpi
+{
+ @Inject
+ private Logger log;
+
+ @Inject
+ private ResponseHolder responseHolder;
+
+ @Inject
+ private ServletContext servletContext;
+
+ @Inject
+ private Dialogue dialogue;
+
+ @Inject
+ private Identity identity;
+
+ @Inject
+ private SamlIdentityProviderApi idpApi;
+
+ public void authenticate()
+ {
+ if (identity.isLoggedIn())
+ {
+ idpApi.authenticationSucceeded();
+ }
+ else
+ {
+ try
+ {
+ responseHolder.getResponse().sendRedirect(servletContext.getContextPath() + "/Login.jsf?samlDialogueId=" + dialogue.getDialogueId());
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ public void singleLogoutFailed()
+ {
+ try
+ {
+ responseHolder.getResponse().sendRedirect(servletContext.getContextPath() + "/SingleLogoutFailed.jsf");
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void singleLogoutSucceeded()
+ {
+ try
+ {
+ responseHolder.getResponse().sendRedirect(servletContext.getContextPath() + "/Login.jsf");
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void loggedOut(SamlIdpSession session)
+ {
+ log.info("Unsolicited logout for user " + session.getPrincipal().getNameId().getValue() + ".");
+ }
+}
Property changes on: modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/SamlIdentityProviderSpiImpl.java
___________________________________________________________________
Name: svn
+ eol-style=native
Name: svn:keywords
+ Revision Author Date
Added: modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/SamlIdpCustomizer.java
===================================================================
--- modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/SamlIdpCustomizer.java (rev 0)
+++ modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/SamlIdpCustomizer.java 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.security.examples.id_provider;
+
+import javax.enterprise.event.Observes;
+import javax.servlet.ServletContextEvent;
+
+import org.jboss.seam.security.external.api.SamlIdentityProviderConfigurationApi;
+import org.jboss.seam.servlet.event.qualifier.Initialized;
+
+public class SamlIdpCustomizer
+{
+ public void servletInitialized(@Observes @Initialized final ServletContextEvent e, SamlIdentityProviderConfigurationApi idp)
+ {
+ idp.setEntityId("http://www.saml-idp.com");
+ idp.setHostName("www.saml-idp.com");
+ idp.setProtocol("http");
+ idp.setPort(8080);
+ idp.setSigningKey("classpath:/test_keystore.jks", "store456", "servercert", "pass456");
+ idp.setWantSingleLogoutMessagesSigned(false);
+ }
+}
Property changes on: modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/SamlIdpCustomizer.java
___________________________________________________________________
Name: svn
+ eol-style=native
Name: svn:keywords
+ Revision Author Date
Added: modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/SessionManagement.java
===================================================================
--- modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/SessionManagement.java (rev 0)
+++ modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/SessionManagement.java 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.security.examples.id_provider;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.enterprise.inject.Model;
+import javax.inject.Inject;
+
+import org.jboss.seam.security.external.api.SamlIdentityProviderApi;
+import org.jboss.seam.security.external.api.SamlIdentityProviderConfigurationApi;
+import org.jboss.seam.security.external.saml.idp.SamlExternalServiceProvider;
+
+@Model
+public class SessionManagement
+{
+ @Inject
+ private SamlIdentityProviderApi idpApi;
+
+ @Inject
+ private SamlIdentityProviderConfigurationApi idpConfApi;
+
+ public List<String> getNonParticipatingServiceProviders()
+ {
+ List<String> serviceProviders = new LinkedList<String>();
+ for (SamlExternalServiceProvider sp : idpConfApi.getServiceProviders())
+ {
+ if (!isSessionParticipant(sp))
+ {
+ serviceProviders.add(sp.getEntityId());
+ }
+ }
+ return serviceProviders;
+ }
+
+ public List<String> getParticipatingServiceProviders()
+ {
+ List<String> serviceProviders = new LinkedList<String>();
+ for (SamlExternalServiceProvider sp : idpConfApi.getServiceProviders())
+ {
+ if (isSessionParticipant(sp))
+ {
+ serviceProviders.add(sp.getEntityId());
+ }
+ }
+ return serviceProviders;
+ }
+
+ private boolean isSessionParticipant(SamlExternalServiceProvider sp)
+ {
+ return idpApi.getSession().getServiceProviders().contains(sp);
+ }
+
+ public void samlRemoteLogin(String spEntityId)
+ {
+ if (idpApi.getSession() == null)
+ {
+ throw new RuntimeException("No local SAML session.");
+ }
+ idpApi.remoteLogin(spEntityId, null);
+ }
+}
Property changes on: modules/security/trunk/examples/saml-idp/src/main/java/org/jboss/seam/security/examples/id_provider/SessionManagement.java
___________________________________________________________________
Name: svn
+ eol-style=native
Name: svn:keywords
+ Revision Author Date
Added: modules/security/trunk/examples/saml-idp/src/main/resources/test_keystore.jks
===================================================================
(Binary files differ)
Property changes on: modules/security/trunk/examples/saml-idp/src/main/resources/test_keystore.jks
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: modules/security/trunk/examples/saml-idp/src/main/webapp/Configuration.xhtml
===================================================================
--- modules/security/trunk/examples/saml-idp/src/main/webapp/Configuration.xhtml (rev 0)
+++ modules/security/trunk/examples/saml-idp/src/main/webapp/Configuration.xhtml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,24 @@
+<f:view xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+ <ui:composition template="/PageTemplate.xhtml">
+ <h1>Configuration</h1>
+ <h:outputText value="Meta Data URL for this SAML entity: #{configuration.metaDataUrl}" />
+ <h2>Trusted SAML Service Providers</h2>
+ <p><h:dataTable value="#{saml.spEntityIds}" var="spEntityId" columnClasses="dataTableColumn">
+ <h:column>
+ <h:outputText value="#{spEntityId}" />
+ </h:column>
+ </h:dataTable></p>
+ <h2>Add SAML Service Provider</h2>
+ <h:form>
+ <p><h:outputText
+ value="Here you can add a new trusted Service Provider by uploading the corresponding meta data." /></p>
+ <p><h:outputText value="Meta Data URL:" /> <h:inputText
+ value="#{configuration.spMetaDataUrl}" /> <h:commandButton
+ action="#{configuration.addSamlServiceProvider}"
+ value="Add SAML Service Provider" /></p>
+ </h:form>
+ </ui:composition>
+</f:view>
Added: modules/security/trunk/examples/saml-idp/src/main/webapp/Index.xhtml
===================================================================
--- modules/security/trunk/examples/saml-idp/src/main/webapp/Index.xhtml (rev 0)
+++ modules/security/trunk/examples/saml-idp/src/main/webapp/Index.xhtml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,7 @@
+<f:view xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+ <ui:composition template="/PageTemplate.xhtml">
+ </ui:composition>
+</f:view>
\ No newline at end of file
Added: modules/security/trunk/examples/saml-idp/src/main/webapp/Login.xhtml
===================================================================
--- modules/security/trunk/examples/saml-idp/src/main/webapp/Login.xhtml (rev 0)
+++ modules/security/trunk/examples/saml-idp/src/main/webapp/Login.xhtml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,19 @@
+<f:view xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+ <f:metadata>
+ <f:viewParam name="samlDialogueId" value="#{login.samlDialogueId}" />
+ </f:metadata>
+ <ui:composition template="/PageTemplate.xhtml">
+ <h:messages />
+ <h1>Login</h1>
+ <h:form>
+ <h:outputText value="Username:" />
+ <h:inputText value="#{login.userName}" />
+ <h:commandButton action="#{login.login}" value="Login" />
+ <h:commandButton action="#{login.cancel}" value="Cancel"
+ rendered="#{login.samlDialogueId != null}" />
+ </h:form>
+ </ui:composition>
+</f:view>
\ No newline at end of file
Added: modules/security/trunk/examples/saml-idp/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- modules/security/trunk/examples/saml-idp/src/main/webapp/META-INF/MANIFEST.MF (rev 0)
+++ modules/security/trunk/examples/saml-idp/src/main/webapp/META-INF/MANIFEST.MF 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added: modules/security/trunk/examples/saml-idp/src/main/webapp/Menu.xhtml
===================================================================
--- modules/security/trunk/examples/saml-idp/src/main/webapp/Menu.xhtml (rev 0)
+++ modules/security/trunk/examples/saml-idp/src/main/webapp/Menu.xhtml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,19 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+ <h:form>
+ <h:commandLink value="Login" action="/Login.xhtml"
+ disabled="#{identity.loggedIn}" /> |
+ <h:commandLink value="Configuration" action="/Configuration.xhtml" /> |
+ <h:commandLink value="Session Management" action="/SessionManagement.xhtml"
+ disabled="#{!identity.loggedIn}" /> |
+ <h:commandLink value="Local Logout" action="#{identity.localLogout}"
+ disabled="#{!identity.loggedIn}" /> |
+ <h:commandLink value="Global Logout" action="#{identity.globalLogout}"
+ disabled="#{!identity.loggedIn or identity.samlIdpSession == null}" />
+ </h:form>
+
+</ui:composition>
\ No newline at end of file
Added: modules/security/trunk/examples/saml-idp/src/main/webapp/PageTemplate.xhtml
===================================================================
--- modules/security/trunk/examples/saml-idp/src/main/webapp/PageTemplate.xhtml (rev 0)
+++ modules/security/trunk/examples/saml-idp/src/main/webapp/PageTemplate.xhtml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<h:body>
+ <h:panelGroup layout="block" styleClass="page">
+
+ <h:head>
+ <link type="text/css" rel="stylesheet" href="styles.css" />
+ </h:head>
+
+ <h:panelGroup layout="block" styleClass="menu">
+ <ui:include src="/Menu.xhtml" />
+ </h:panelGroup>
+
+ <h:messages />
+
+ <h:panelGroup layout="block" styleClass="content">
+ <ui:insert />
+ </h:panelGroup>
+
+ </h:panelGroup>
+</h:body>
+</html>
\ No newline at end of file
Added: modules/security/trunk/examples/saml-idp/src/main/webapp/SessionManagement.xhtml
===================================================================
--- modules/security/trunk/examples/saml-idp/src/main/webapp/SessionManagement.xhtml (rev 0)
+++ modules/security/trunk/examples/saml-idp/src/main/webapp/SessionManagement.xhtml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,45 @@
+<f:view xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
+ xmlns:f="http://java.sun.com/jsf/core">
+ <f:metadata>
+ <f:event type="preRenderView"
+ listener="#{identity.redirectToLoginIfNotLoggedIn}" />
+ </f:metadata>
+ <ui:composition template="/PageTemplate.xhtml">
+
+ <h1>Session Info</h1>
+
+ <h2>Logged in user</h2>
+
+ <h:outputText
+ value="#{identity.samlIdpSession.principal.nameId.value}" />
+
+ <h2>Session participants</h2>
+
+ <h:dataTable
+ value="#{sessionManagement.participatingServiceProviders}" var="sp"
+ columnClasses="dataTableColumn">
+ <h:column>
+ <h:outputText value="#{sp}" />
+ </h:column>
+ </h:dataTable>
+
+ <h2>Login to Other Service Providers</h2>
+
+ <h:form>
+ <h:dataTable
+ value="#{sessionManagement.nonParticipatingServiceProviders}"
+ var="sp" columnClasses="dataTableColumn">
+ <h:column>
+ <h:outputText value="#{sp}" />
+ </h:column>
+ <h:column>
+ <h:commandLink action="#{identity.remoteLogin(sp)}" value="Login" target="_blank"/>
+ </h:column>
+ </h:dataTable>
+ </h:form>
+
+ </ui:composition>
+</f:view>
\ No newline at end of file
Added: modules/security/trunk/examples/saml-idp/src/main/webapp/SingleLogoutFailed.xhtml
===================================================================
--- modules/security/trunk/examples/saml-idp/src/main/webapp/SingleLogoutFailed.xhtml (rev 0)
+++ modules/security/trunk/examples/saml-idp/src/main/webapp/SingleLogoutFailed.xhtml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,10 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+<body>
+<h1>Single logout failed.</h1>
+</body>
+
+</html>
\ No newline at end of file
Added: modules/security/trunk/examples/saml-idp/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia
===================================================================
--- modules/security/trunk/examples/saml-idp/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia (rev 0)
+++ modules/security/trunk/examples/saml-idp/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<PROCESS model-entity="JSFProcess">
+ <PROCESS-ITEM NAME="rules:#Login.xhtml" PATH="/Login.xhtml"
+ SHAPE="32,17,0,0" model-entity="JSFProcessGroup">
+ <PROCESS-ITEM ID="rules:#Login.xhtml:0" NAME="item"
+ PATH="/Login.xhtml" model-entity="JSFProcessItem">
+ <PROCESS-ITEM-OUTPUT
+ ID="LOCAL_LOGIN:#{login.login}:#SessionManagement.xhtml"
+ NAME="output" PATH="/SessionManagement.xhtml"
+ TARGET="rules:#SessionManagement.xhtml"
+ TITLE="#{login.login}:LOCAL_LOGIN" model-entity="JSFProcessItemOutput"/>
+ </PROCESS-ITEM>
+ </PROCESS-ITEM>
+ <PROCESS-ITEM NAME="rules:#SessionManagement.xhtml"
+ PATH="/SessionManagement.xhtml" SHAPE="240,33,0,0" model-entity="JSFProcessGroup"/>
+</PROCESS>
Added: modules/security/trunk/examples/saml-idp/src/main/webapp/WEB-INF/beans.xml
===================================================================
--- modules/security/trunk/examples/saml-idp/src/main/webapp/WEB-INF/beans.xml (rev 0)
+++ modules/security/trunk/examples/saml-idp/src/main/webapp/WEB-INF/beans.xml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,7 @@
+<?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">
+ <alternatives>
+ <classes>org.jboss.seam.security.external.saml.idp.SamlIdpInApplicationScopeProducer</classes>
+ </alternatives>
+</beans>
Added: modules/security/trunk/examples/saml-idp/src/main/webapp/WEB-INF/context.xml
===================================================================
--- modules/security/trunk/examples/saml-idp/src/main/webapp/WEB-INF/context.xml (rev 0)
+++ modules/security/trunk/examples/saml-idp/src/main/webapp/WEB-INF/context.xml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context>
+ <!-- log all incoming and outgoing messages. -->
+ <Valve className="org.apache.catalina.valves.RequestDumperValve" />
+</Context>
\ No newline at end of file
Added: modules/security/trunk/examples/saml-idp/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- modules/security/trunk/examples/saml-idp/src/main/webapp/WEB-INF/faces-config.xml (rev 0)
+++ modules/security/trunk/examples/saml-idp/src/main/webapp/WEB-INF/faces-config.xml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faces-config version="2.0" 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-facesconfig_2_0.xsd">
+
+ <name>samlidp</name>
+
+ <navigation-rule>
+ <from-view-id>/Login.xhtml</from-view-id>
+ <navigation-case>
+ <from-action>#{login.login}</from-action>
+ <from-outcome>LOCAL_LOGIN</from-outcome>
+ <to-view-id>/SessionManagement.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+</faces-config>
Added: modules/security/trunk/examples/saml-idp/src/main/webapp/WEB-INF/web.xml
===================================================================
--- modules/security/trunk/examples/saml-idp/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ modules/security/trunk/examples/saml-idp/src/main/webapp/WEB-INF/web.xml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="3.0" 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_3_0.xsd">
+
+ <context-param>
+ <param-name>javax.faces.PROJECT_STAGE</param-name>
+ <param-value>Development</param-value>
+ </context-param>
+
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ </welcome-file-list>
+
+</web-app>
Added: modules/security/trunk/examples/saml-idp/src/main/webapp/index.jsp
===================================================================
--- modules/security/trunk/examples/saml-idp/src/main/webapp/index.jsp (rev 0)
+++ modules/security/trunk/examples/saml-idp/src/main/webapp/index.jsp 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,8 @@
+<html>
+ <head>
+ <title>Initial Redirect Page</title>
+ </head>
+ <body>
+ <% response.sendRedirect("Index.jsf"); %>
+ </body>
+</html>
\ No newline at end of file
Added: modules/security/trunk/examples/saml-idp/src/main/webapp/styles.css
===================================================================
--- modules/security/trunk/examples/saml-idp/src/main/webapp/styles.css (rev 0)
+++ modules/security/trunk/examples/saml-idp/src/main/webapp/styles.css 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,36 @@
+.page {
+ width: 800px;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+.menu {
+ margin-top: 15px;
+ height: 50px;
+ background: #a5a5dc;
+ padding: 5px;
+}
+
+.content {
+ margin-top: 15px;
+ top: 100px;
+ margin-left: auto;
+ margin-right: auto;
+ background: white;
+ padding: 5px;
+}
+
+.propertyName {
+ padding: 5px;
+ background-color: #aaaaaa;
+}
+
+.propertyValue {
+ padding: 5px;
+ background-color: #dddddd;
+}
+
+.dataTableColumn {
+ padding: 5px;
+ background-color: #dddddd;
+}
\ No newline at end of file
Property changes on: modules/security/trunk/examples/saml-sp
___________________________________________________________________
Name: svn:ignore
+ .settings
target
.classpath
.project
Added: modules/security/trunk/examples/saml-sp/pom.xml
===================================================================
--- modules/security/trunk/examples/saml-sp/pom.xml (rev 0)
+++ modules/security/trunk/examples/saml-sp/pom.xml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,80 @@
+<?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>
+ <groupId>org.jboss.seam.security</groupId>
+ <artifactId>saml-sp</artifactId>
+ <packaging>war</packaging>
+ <name>SAML Service Provider</name>
+
+ <parent>
+ <groupId>org.jboss.seam.security</groupId>
+ <artifactId>seam-security-parent</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <properties>
+ <seam.faces.version>3.0.0-SNAPSHOT</seam.faces.version>
+ <seam.international.version>3.0.0-SNAPSHOT</seam.international.version>
+ </properties>
+
+ <build>
+ <finalName>saml-sp</finalName>
+ </build>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.seam.security</groupId>
+ <artifactId>seam-security-external</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>validation-api</artifactId>
+ <groupId>javax.validation</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.servlet</groupId>
+ <artifactId>seam-servlet</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <!-- This is necessary until a new JSF-API is published to central -->
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!--
+ <dependency> <groupId>org.jboss.seam.faces</groupId>
+ <artifactId>seam-faces</artifactId>
+ <version>${project.version}</version> </dependency>
+ -->
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <!-- Required until the Servlet 3.0 API can be resolved in Central -->
+ <groupId>org.jboss.spec.javax.servlet</groupId>
+ <artifactId>jboss-servlet-api_3.0_spec</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
Added: modules/security/trunk/examples/saml-sp/readme.txt
===================================================================
--- modules/security/trunk/examples/saml-sp/readme.txt (rev 0)
+++ modules/security/trunk/examples/saml-sp/readme.txt 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,101 @@
+SAML-SP EXAMPLE
+
+
+What is it?
+===========
+
+This demo web application shows how to delegate user authentication and session
+management to trusted SAMLv2 identity providers (IDPs). It makes use of the
+SAMLv2 submodule of Seam Security.
+
+
+How to deploy it?
+=================
+
+The application is packaged as a war file and should run in any JEE6
+environment. It has been tested on JBoss AS 6. Before deploying the application,
+you need to map these two host names to the localhost:
+
+www.saml-sp1.com
+www.saml-sp2.com
+
+On Unix based systems, you do this by putting the following lines in
+'/etc/hosts':
+
+127.0.0.1 www.saml-sp1.com
+127.0.0.1 www.saml-sp2.com
+
+
+Some background info
+====================
+
+The application contains two "virtual applications":
+
+http://www.saml-sp1.com:8080/saml-sp
+http://www.saml-sp2.com:8080/saml-sp
+
+Think of it as two web shops hosted by the same SaaS provider, sharing the same
+war file, but each having their own SAML Service Provider (SP) configuration,
+their own database objects and their own users and user sessions.
+
+The Service Providers are preconfigured to run at port 8080, to use a test key
+store which is included in the war file, and to use the http protocol for
+communicating with IDPs. These settings are ok for a test setup, but please be
+aware that in production, you'd use http on port 443, and you'd use your own
+well-secured keystore, probably somewhere on the file system. In the test
+application these settings are done programmatically (by the SpCustomizer).
+
+
+How to use the application
+==========================
+
+Start the application and surf to:
+
+http://www.saml-sp1.com:8080/saml-sp
+
+First you need to configure the identity provider(s) to trust. You have
+different options:
+- install and use your own third-party identity provider (e.g. OpenSSO,
+Shibboleth, SimpleSAMLphp, CAS or A-Select)
+- use an existing SAMLv2 identity provider where you have an account (you could
+create an account for the www.ssocircle.com identity provider, which is open to
+everyone)
+- use the seam-idp example application
+
+You need to create a trust relationship between the chosen identity provider(s)
+and the sample application. You do that by exchanging meta data. The menu option
+"Configuration" will help you. Note that in a production system you'd definitely
+restrict such a configuration page to system administrators! On the
+configuration page, you see a link that points out where the meta data of the
+current service provider resides. You use that link for uploading the meta data
+to your identity provider. The other way around, you find out where your
+identity provider's meta data is (read your IDP manual), and you upload it on
+the Configuration page. You do that for all identity providers (probably only
+one).
+
+Do the configuration not only for the saml-sp1 virtual application, but also for
+saml-sp2. Remember that you need to see it as two separate service providers.
+
+Now you are ready to login. Go to the login page by using the menu. You need to
+choose which identity provider you want to use, and click the login link next to
+it. By the way, an application that only trusts one identity provider won't have
+such a page, and an application that trusts multiple identity providers might
+save the user's choice in a cookie so that this page will only be shown once.
+You'll be redirected to your identity provider's login page and input your
+credentials to log in. After that, you'll be redirected back to the service
+provider, and you'll see the info of the logged in user, including any
+attributes that have been provided by the identity provider. Normally you'd do
+the things where you needed to login for, but this is a kind of hollow sample
+application, and we'll move on.
+
+Now go to the other virtual application and login there. You'll see that you'll
+be immediately logged in into that other application without entering your
+credentials again. Single sign on in other words.
+
+The identity provider now manages one user session, with two service providers
+participating in the session. You can stop the whole session by choosing "Global
+Logout" from the menu in one of the virtual apps. Check that you are logged out
+at the other virtual app as well, and also at the identity providers side. That
+was a single logout in other words. You can also logout locally. In that case
+you just stop using the IDP-managed session at the service provider side,
+without informing the identity provider about that.
\ No newline at end of file
Added: modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/Configuration.java
===================================================================
--- modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/Configuration.java (rev 0)
+++ modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/Configuration.java 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.security.examples.id_consumer;
+
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.enterprise.inject.Model;
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.inject.Inject;
+
+import org.jboss.seam.security.external.api.SamlEntityConfigurationApi;
+import org.jboss.seam.security.external.saml.SamlExternalEntity;
+
+@Model
+public class Configuration
+{
+ private String idpMetaDataUrl;
+
+ @Inject
+ private SamlEntityConfigurationApi samlEntityConfig;
+
+ public String getIdpMetaDataUrl()
+ {
+ return idpMetaDataUrl;
+ }
+
+ public void setIdpMetaDataUrl(String idpMetaDataUrl)
+ {
+ this.idpMetaDataUrl = idpMetaDataUrl;
+ }
+
+ public void addSamlIdentityProvider()
+ {
+ try
+ {
+ URL url = new URL(idpMetaDataUrl);
+ URLConnection urlConnection = url.openConnection();
+ urlConnection.setConnectTimeout(3000);
+ urlConnection.setReadTimeout(3000);
+ Reader reader = new InputStreamReader(urlConnection.getInputStream());
+ SamlExternalEntity samlEntity = samlEntityConfig.addExternalSamlEntity(reader);
+
+ FacesMessage facesMessage = new FacesMessage("SAML entity " + samlEntity.getEntityId() + " has been added.");
+ FacesContext.getCurrentInstance().addMessage(null, facesMessage);
+ }
+ catch (MalformedURLException e)
+ {
+ FacesMessage facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR, "Malformed URL.", "");
+ FacesContext.getCurrentInstance().addMessage(null, facesMessage);
+ }
+ catch (IOException e)
+ {
+ FacesMessage facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR, "Metadata could not be read.", "");
+ FacesContext.getCurrentInstance().addMessage(null, facesMessage);
+ }
+ }
+
+ public String getMetaDataUrl()
+ {
+ return samlEntityConfig.getMetaDataURL();
+ }
+
+ public List<String> getIdpEntityIds()
+ {
+ List<String> entityIds = new LinkedList<String>();
+ for (SamlExternalEntity entity : samlEntityConfig.getExternalSamlEntities())
+ {
+ entityIds.add(entity.getEntityId());
+ }
+ return entityIds;
+ }
+}
Property changes on: modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/Configuration.java
___________________________________________________________________
Name: svn
+ eol-style=native
Name: svn:keywords
+ Revision Author Date
Added: modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/Identity.java
===================================================================
--- modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/Identity.java (rev 0)
+++ modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/Identity.java 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,108 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.security.examples.id_consumer;
+
+import javax.enterprise.inject.Model;
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.inject.Inject;
+
+import org.jboss.seam.security.external.api.SamlServiceProviderApi;
+import org.jboss.seam.security.external.dialogues.api.Dialogued;
+import org.jboss.seam.security.external.saml.sp.SamlSpSession;
+
+@Model
+public class Identity
+{
+ @Inject
+ private SamlServiceProviderApi samlSpApi;
+
+ @Dialogued
+ public void login(String idpEntityId)
+ {
+ if (!isLoggedIn())
+ {
+ samlSpApi.login(idpEntityId);
+ }
+ else
+ {
+ FacesMessage facesMessage = new FacesMessage("Already logged in.");
+ FacesContext.getCurrentInstance().addMessage(null, facesMessage);
+ }
+ }
+
+ public void localLogout()
+ {
+ if (isLoggedIn())
+ {
+ if (samlSpApi.getSession() != null)
+ {
+ samlSpApi.localLogout();
+ }
+ }
+ else
+ {
+ FacesMessage facesMessage = new FacesMessage("Not logged in.");
+ FacesContext.getCurrentInstance().addMessage(null, facesMessage);
+ }
+ }
+
+ public void globalLogout()
+ {
+ if (isLoggedIn())
+ {
+ if (samlSpApi.getSession() != null)
+ {
+ samlSpApi.globalLogout();
+ }
+ }
+ else
+ {
+ FacesMessage facesMessage = new FacesMessage("Not logged in.");
+ FacesContext.getCurrentInstance().addMessage(null, facesMessage);
+ }
+ }
+
+ public boolean isLoggedIn()
+ {
+ return samlSpApi.getSession() != null;
+ }
+
+ public SamlSpSession getSamlSpSession()
+ {
+ return samlSpApi.getSession();
+ }
+
+ public void redirectToLoginIfNotLoggedIn()
+ {
+ if (!isLoggedIn())
+ {
+ redirectToViewId("/Login.xhtml");
+ }
+ }
+
+ private void redirectToViewId(String viewId)
+ {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ FacesContext.getCurrentInstance().getApplication().getNavigationHandler().handleNavigation(facesContext, null, viewId + "?faces-redirect=true");
+ }
+}
Property changes on: modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/Identity.java
___________________________________________________________________
Name: svn
+ eol-style=native
Name: svn:keywords
+ Revision Author Date
Added: modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/RequestObserver.java
===================================================================
--- modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/RequestObserver.java (rev 0)
+++ modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/RequestObserver.java 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.security.examples.id_consumer;
+
+import javax.enterprise.event.Observes;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.inject.Inject;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jboss.seam.security.external.api.ResponseHolder;
+import org.jboss.seam.security.external.dialogues.api.AfterDialogueActivation;
+
+public class RequestObserver
+{
+ @Inject
+ private ResponseHolder responseHolder;
+
+ public void dialogueCreated(@Observes AfterDialogueActivation event)
+ {
+ if (FacesContext.getCurrentInstance() != null)
+ {
+ ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
+ responseHolder.setResponse((HttpServletResponse) externalContext.getResponse());
+ }
+ }
+
+}
Property changes on: modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/RequestObserver.java
___________________________________________________________________
Name: svn
+ eol-style=native
Name: svn:keywords
+ Revision Author Date
Added: modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/SamlServiceProviderSpiImpl.java
===================================================================
--- modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/SamlServiceProviderSpiImpl.java (rev 0)
+++ modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/SamlServiceProviderSpiImpl.java 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,120 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.security.examples.id_consumer;
+
+import java.io.IOException;
+
+import javax.inject.Inject;
+import javax.servlet.ServletContext;
+
+import org.jboss.seam.security.external.api.ResponseHolder;
+import org.jboss.seam.security.external.api.SamlServiceProviderApi;
+import org.jboss.seam.security.external.saml.sp.SamlSpSession;
+import org.jboss.seam.security.external.spi.SamlServiceProviderSpi;
+import org.slf4j.Logger;
+
+public class SamlServiceProviderSpiImpl implements SamlServiceProviderSpi
+{
+ @Inject
+ SamlServiceProviderApi samlServiceProviderApi;
+
+ @Inject
+ ResponseHolder responseHolder;
+
+ @Inject
+ private Logger log;
+
+ @Inject
+ private ServletContext servletContext;
+
+ public void loginSucceeded(SamlSpSession session)
+ {
+ try
+ {
+ responseHolder.getResponse().sendRedirect(servletContext.getContextPath() + "/UserInfo.jsf");
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void loginFailed()
+ {
+ try
+ {
+ responseHolder.getResponse().sendRedirect(servletContext.getContextPath() + "/AuthenticationFailed.jsf");
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void globalLogoutFailed(String statusCode)
+ {
+ try
+ {
+ responseHolder.getResponse().sendRedirect(servletContext.getContextPath() + "/GlobalLogoutFailed.jsf");
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void globalLogoutSucceeded()
+ {
+ try
+ {
+ responseHolder.getResponse().sendRedirect(servletContext.getContextPath() + "/Login.jsf");
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void loggedIn(SamlSpSession session, String url)
+ {
+ try
+ {
+ if (url != null)
+ {
+ responseHolder.getResponse().sendRedirect(url);
+ }
+ else
+ {
+ responseHolder.getResponse().sendRedirect(servletContext.getContextPath() + "/UserInfo.jsf");
+ }
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void loggedOut(SamlSpSession session)
+ {
+ log.info("User " + session.getPrincipal().getNameId() + " has been logged out.");
+ }
+}
Property changes on: modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/SamlServiceProviderSpiImpl.java
___________________________________________________________________
Name: svn
+ eol-style=native
Name: svn:keywords
+ Revision Author Date
Added: modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/SamlSpCustomizer.java
===================================================================
--- modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/SamlSpCustomizer.java (rev 0)
+++ modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/SamlSpCustomizer.java 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.security.examples.id_consumer;
+
+import javax.enterprise.event.Observes;
+
+import org.jboss.seam.security.external.api.SamlServiceProviderConfigurationApi;
+import org.jboss.seam.security.external.virtualapplications.api.AfterVirtualApplicationCreation;
+import org.jboss.seam.security.external.virtualapplications.api.VirtualApplication;
+
+public class SamlSpCustomizer
+{
+ public void customize(@Observes AfterVirtualApplicationCreation event, SamlServiceProviderConfigurationApi sp, VirtualApplication virtualApplication)
+ {
+ sp.setEntityId("http://" + virtualApplication.getHostName());
+ sp.setProtocol("http");
+ sp.setPort(8080);
+ sp.setSigningKey("classpath:/test_keystore.jks", "store456", "servercert", "pass456");
+ }
+
+}
Property changes on: modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/SamlSpCustomizer.java
___________________________________________________________________
Name: svn
+ eol-style=native
Name: svn:keywords
+ Revision Author Date
Added: modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/VirtualApplicationCreator.java
===================================================================
--- modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/VirtualApplicationCreator.java (rev 0)
+++ modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/VirtualApplicationCreator.java 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,18 @@
+package org.jboss.seam.security.examples.id_consumer;
+
+import javax.enterprise.event.Observes;
+
+import org.jboss.seam.security.external.virtualapplications.api.AfterVirtualApplicationManagerCreation;
+
+/**
+ * @author Marcel Kolsteren
+ *
+ */
+public class VirtualApplicationCreator
+{
+ public void virtualApplicationManagerCreated(@Observes final AfterVirtualApplicationManagerCreation event)
+ {
+ event.addVirtualApplication("www.saml-sp1.com");
+ event.addVirtualApplication("www.saml-sp2.com");
+ }
+}
Property changes on: modules/security/trunk/examples/saml-sp/src/main/java/org/jboss/seam/security/examples/id_consumer/VirtualApplicationCreator.java
___________________________________________________________________
Name: svn
+ eol-style=native
Name: svn:keywords
+ Revision Author Date
Added: modules/security/trunk/examples/saml-sp/src/main/resources/test_keystore.jks
===================================================================
(Binary files differ)
Property changes on: modules/security/trunk/examples/saml-sp/src/main/resources/test_keystore.jks
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: modules/security/trunk/examples/saml-sp/src/main/webapp/AuthenticationFailed.xhtml
===================================================================
--- modules/security/trunk/examples/saml-sp/src/main/webapp/AuthenticationFailed.xhtml (rev 0)
+++ modules/security/trunk/examples/saml-sp/src/main/webapp/AuthenticationFailed.xhtml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,10 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+<body>
+<h1>Authentication failed.</h1>
+</body>
+
+</html>
\ No newline at end of file
Added: modules/security/trunk/examples/saml-sp/src/main/webapp/Configuration.xhtml
===================================================================
--- modules/security/trunk/examples/saml-sp/src/main/webapp/Configuration.xhtml (rev 0)
+++ modules/security/trunk/examples/saml-sp/src/main/webapp/Configuration.xhtml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,24 @@
+<f:view xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+ <ui:composition template="/PageTemplate.xhtml">
+ <h1>Configuration</h1>
+ <h:outputText value="Meta Data URL for this SAML entity: #{configuration.metaDataUrl}" />
+ <h2>Trusted SAML Identity Providers</h2>
+ <p><h:dataTable value="#{configuration.idpEntityIds}" var="idpEntityId" columnClasses="dataTableColumn">
+ <h:column>
+ <h:outputText value="#{idpEntityId}" />
+ </h:column>
+ </h:dataTable></p>
+ <h2>Add SAML Identity Provider</h2>
+ <h:form>
+ <p><h:outputText
+ value="Here you can add a new trusted Identity Provider by uploading the corresponding meta data." /></p>
+ <p><h:outputText value="Meta Data URL:" /> <h:inputText
+ value="#{configuration.idpMetaDataUrl}" /> <h:commandButton
+ action="#{configuration.addSamlIdentityProvider}"
+ value="Add SAML Identity Provider" /></p>
+ </h:form>
+ </ui:composition>
+</f:view>
Added: modules/security/trunk/examples/saml-sp/src/main/webapp/GlobalLogoutFailed.xhtml
===================================================================
--- modules/security/trunk/examples/saml-sp/src/main/webapp/GlobalLogoutFailed.xhtml (rev 0)
+++ modules/security/trunk/examples/saml-sp/src/main/webapp/GlobalLogoutFailed.xhtml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,10 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+<body>
+<h1>Global logout failed.</h1>
+</body>
+
+</html>
\ No newline at end of file
Added: modules/security/trunk/examples/saml-sp/src/main/webapp/Index.xhtml
===================================================================
--- modules/security/trunk/examples/saml-sp/src/main/webapp/Index.xhtml (rev 0)
+++ modules/security/trunk/examples/saml-sp/src/main/webapp/Index.xhtml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,7 @@
+<f:view xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+ <ui:composition template="/PageTemplate.xhtml">
+ </ui:composition>
+</f:view>
\ No newline at end of file
Added: modules/security/trunk/examples/saml-sp/src/main/webapp/Login.xhtml
===================================================================
--- modules/security/trunk/examples/saml-sp/src/main/webapp/Login.xhtml (rev 0)
+++ modules/security/trunk/examples/saml-sp/src/main/webapp/Login.xhtml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,22 @@
+<f:view xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+ <ui:composition template="/PageTemplate.xhtml">
+
+ <h1>Login</h1>
+ <h:form>
+ <h:dataTable value="#{configuration.idpEntityIds}" var="idpEntityId"
+ columnClasses="dataTableColumn">
+ <h:column>
+ <h:outputText value="#{idpEntityId}" />
+ </h:column>
+ <h:column>
+ <h:commandLink action="#{identity.login(idpEntityId)}"
+ value="Login" />
+ </h:column>
+ </h:dataTable>
+ </h:form>
+
+ </ui:composition>
+</f:view>
\ No newline at end of file
Added: modules/security/trunk/examples/saml-sp/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- modules/security/trunk/examples/saml-sp/src/main/webapp/META-INF/MANIFEST.MF (rev 0)
+++ modules/security/trunk/examples/saml-sp/src/main/webapp/META-INF/MANIFEST.MF 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added: modules/security/trunk/examples/saml-sp/src/main/webapp/Menu.xhtml
===================================================================
--- modules/security/trunk/examples/saml-sp/src/main/webapp/Menu.xhtml (rev 0)
+++ modules/security/trunk/examples/saml-sp/src/main/webapp/Menu.xhtml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,19 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+ <h:form>
+ <h:commandLink value="Login" action="/Login.xhtml"
+ disabled="#{identity.loggedIn}" /> |
+ <h:commandLink value="Configuration" action="/Configuration.xhtml" /> |
+ <h:commandLink value="User Info" action="/UserInfo.xhtml"
+ disabled="#{!identity.loggedIn}" /> |
+ <h:commandLink value="Local Logout" action="#{identity.localLogout}"
+ disabled="#{!identity.loggedIn}" /> |
+ <h:commandLink value="Global Logout" action="#{identity.globalLogout}"
+ disabled="#{!identity.loggedIn}" />
+ </h:form>
+
+</ui:composition>
\ No newline at end of file
Added: modules/security/trunk/examples/saml-sp/src/main/webapp/PageTemplate.xhtml
===================================================================
--- modules/security/trunk/examples/saml-sp/src/main/webapp/PageTemplate.xhtml (rev 0)
+++ modules/security/trunk/examples/saml-sp/src/main/webapp/PageTemplate.xhtml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<h:body>
+ <h:panelGroup layout="block" styleClass="page">
+
+ <h:head>
+ <link type="text/css" rel="stylesheet" href="styles.css" />
+ </h:head>
+
+ <h:panelGroup layout="block" styleClass="menu">
+ <ui:include src="/Menu.xhtml" />
+ </h:panelGroup>
+
+ <h:messages />
+
+ <h:panelGroup layout="block" styleClass="content">
+ <ui:insert />
+ </h:panelGroup>
+
+ </h:panelGroup>
+</h:body>
+</html>
\ No newline at end of file
Added: modules/security/trunk/examples/saml-sp/src/main/webapp/UserInfo.xhtml
===================================================================
--- modules/security/trunk/examples/saml-sp/src/main/webapp/UserInfo.xhtml (rev 0)
+++ modules/security/trunk/examples/saml-sp/src/main/webapp/UserInfo.xhtml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,43 @@
+<f:view xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
+ xmlns:f="http://java.sun.com/jsf/core">
+ <f:metadata>
+ <f:event type="preRenderView"
+ listener="#{identity.redirectToLoginIfNotLoggedIn}" />
+ </f:metadata>
+ <ui:composition template="/PageTemplate.xhtml">
+
+ <h1>User info</h1>
+
+ <h:panelGrid columns="2" columnClasses="propertyName, propertyValue">
+ <h:outputText value="NameID" />
+ <h:outputText
+ value="#{identity.samlSpSession.principal.nameId.value}" />
+ <h:outputText value="NameID format" />
+ <h:outputText
+ value="#{identity.samlSpSession.principal.nameId.format}" />
+ <h:outputText value="Identity provider" />
+ <h:outputText
+ value="#{identity.samlSpSession.identityProvider.entityId}" />
+ <h:outputText value="Attributes" />
+ <h:dataTable value="#{identity.samlSpSession.principal.attributes}"
+ var="attribute">
+ <h:column>
+ <f:facet name="header">Name</f:facet>
+ <h:outputText value="#{attribute.name}" />
+ </h:column>
+ <h:column>
+ <f:facet name="header">Friendly name</f:facet>
+ <h:outputText value="#{attribute.friendlyName}" />
+ </h:column>
+ <h:column>
+ <f:facet name="header">Value(s)</f:facet>
+ <h:outputText value="#{attribute.attributeValue}" />
+ </h:column>
+ </h:dataTable>
+ </h:panelGrid>
+
+ </ui:composition>
+</f:view>
\ No newline at end of file
Added: modules/security/trunk/examples/saml-sp/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia
===================================================================
--- modules/security/trunk/examples/saml-sp/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia (rev 0)
+++ modules/security/trunk/examples/saml-sp/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<PROCESS model-entity="JSFProcess"/>
Added: modules/security/trunk/examples/saml-sp/src/main/webapp/WEB-INF/beans.xml
===================================================================
--- modules/security/trunk/examples/saml-sp/src/main/webapp/WEB-INF/beans.xml (rev 0)
+++ modules/security/trunk/examples/saml-sp/src/main/webapp/WEB-INF/beans.xml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,7 @@
+<?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">
+ <alternatives>
+ <classes>org.jboss.seam.security.external.saml.sp.SamlSpInVirtualApplicationScopeProducer</classes>
+ </alternatives>
+</beans>
Added: modules/security/trunk/examples/saml-sp/src/main/webapp/WEB-INF/context.xml
===================================================================
--- modules/security/trunk/examples/saml-sp/src/main/webapp/WEB-INF/context.xml (rev 0)
+++ modules/security/trunk/examples/saml-sp/src/main/webapp/WEB-INF/context.xml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context>
+ <!-- log all incoming and outgoing messages. -->
+ <Valve className="org.apache.catalina.valves.RequestDumperValve" />
+</Context>
\ No newline at end of file
Added: modules/security/trunk/examples/saml-sp/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- modules/security/trunk/examples/saml-sp/src/main/webapp/WEB-INF/faces-config.xml (rev 0)
+++ modules/security/trunk/examples/saml-sp/src/main/webapp/WEB-INF/faces-config.xml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faces-config version="2.0" 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-facesconfig_2_0.xsd">
+
+ <name>samlsp</name>
+
+</faces-config>
Added: modules/security/trunk/examples/saml-sp/src/main/webapp/WEB-INF/web.xml
===================================================================
--- modules/security/trunk/examples/saml-sp/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ modules/security/trunk/examples/saml-sp/src/main/webapp/WEB-INF/web.xml 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="3.0" 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_3_0.xsd">
+
+ <context-param>
+ <param-name>javax.faces.PROJECT_STAGE</param-name>
+ <param-value>Development</param-value>
+ </context-param>
+
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ </welcome-file-list>
+
+</web-app>
Added: modules/security/trunk/examples/saml-sp/src/main/webapp/index.jsp
===================================================================
--- modules/security/trunk/examples/saml-sp/src/main/webapp/index.jsp (rev 0)
+++ modules/security/trunk/examples/saml-sp/src/main/webapp/index.jsp 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,8 @@
+<html>
+ <head>
+ <title>Initial Redirect Page</title>
+ </head>
+ <body>
+ <% response.sendRedirect("Index.jsf"); %>
+ </body>
+</html>
\ No newline at end of file
Added: modules/security/trunk/examples/saml-sp/src/main/webapp/styles.css
===================================================================
--- modules/security/trunk/examples/saml-sp/src/main/webapp/styles.css (rev 0)
+++ modules/security/trunk/examples/saml-sp/src/main/webapp/styles.css 2010-09-01 21:35:41 UTC (rev 13694)
@@ -0,0 +1,36 @@
+.page {
+ width: 800px;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+.menu {
+ margin-top: 15px;
+ height: 50px;
+ background: #d5a5ac;
+ padding: 5px;
+}
+
+.content {
+ margin-top: 15px;
+ top: 100px;
+ margin-left: auto;
+ margin-right: auto;
+ background: white;
+ padding: 5px;
+}
+
+.propertyName {
+ padding: 5px;
+ background-color: #aaaaaa;
+}
+
+.propertyValue {
+ padding: 5px;
+ background-color: #dddddd;
+}
+
+.dataTableColumn {
+ padding: 5px;
+ background-color: #dddddd;
+}
\ No newline at end of file
14 years, 4 months