Seam SVN: r13044 - modules/drools/trunk/impl/src/main/resources/META-INF.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-06-04 13:12:18 -0400 (Fri, 04 Jun 2010)
New Revision: 13044
Modified:
modules/drools/trunk/impl/src/main/resources/META-INF/beans.xml
Log:
ws, give beans.xml root elements
Modified: modules/drools/trunk/impl/src/main/resources/META-INF/beans.xml
===================================================================
--- modules/drools/trunk/impl/src/main/resources/META-INF/beans.xml 2010-06-04 17:12:01 UTC (rev 13043)
+++ modules/drools/trunk/impl/src/main/resources/META-INF/beans.xml 2010-06-04 17:12:18 UTC (rev 13044)
@@ -397,4 +397,4 @@
</d:DroolsConfig>
-</beans>
\ No newline at end of file
+</beans>
14 years
Seam SVN: r13043 - in modules/faces/trunk: impl/src/main/resources/META-INF and 1 other directory.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-06-04 13:12:01 -0400 (Fri, 04 Jun 2010)
New Revision: 13043
Modified:
modules/faces/trunk/api/src/main/resources/META-INF/beans.xml
modules/faces/trunk/impl/src/main/resources/META-INF/beans.xml
Log:
ws, give beans.xml root elements
Modified: modules/faces/trunk/api/src/main/resources/META-INF/beans.xml
===================================================================
--- modules/faces/trunk/api/src/main/resources/META-INF/beans.xml 2010-06-04 17:10:06 UTC (rev 13042)
+++ modules/faces/trunk/api/src/main/resources/META-INF/beans.xml 2010-06-04 17:12:01 UTC (rev 13043)
@@ -24,4 +24,4 @@
http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
-</beans>
\ No newline at end of file
+</beans>
Modified: modules/faces/trunk/impl/src/main/resources/META-INF/beans.xml
===================================================================
--- modules/faces/trunk/impl/src/main/resources/META-INF/beans.xml 2010-06-04 17:10:06 UTC (rev 13042)
+++ modules/faces/trunk/impl/src/main/resources/META-INF/beans.xml 2010-06-04 17:12:01 UTC (rev 13043)
@@ -24,4 +24,4 @@
http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
-</beans>
\ No newline at end of file
+</beans>
14 years
Seam SVN: r13042 - in build/trunk: tools and 8 other directories.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-06-04 13:10:06 -0400 (Fri, 04 Jun 2010)
New Revision: 13042
Added:
build/trunk/tools/
build/trunk/tools/pom.xml
build/trunk/tools/src/
build/trunk/tools/src/main/
build/trunk/tools/src/main/java/
build/trunk/tools/src/main/java/org/
build/trunk/tools/src/main/java/org/jboss/
build/trunk/tools/src/main/java/org/jboss/seam/
build/trunk/tools/src/main/java/org/jboss/seam/build/
build/trunk/tools/src/main/java/org/jboss/seam/build/tools/
build/trunk/tools/src/main/java/org/jboss/seam/build/tools/XmlAppendingTransformer.java
Log:
add build tools
Added: build/trunk/tools/pom.xml
===================================================================
--- build/trunk/tools/pom.xml (rev 0)
+++ build/trunk/tools/pom.xml 2010-06-04 17:10:06 UTC (rev 13042)
@@ -0,0 +1,66 @@
+<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.build</groupId>
+ <artifactId>seam-maven-tools</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0.0-SNAPSHOT</version>
+ <name>Seam Build Tools</name>
+
+ <parent>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-parent</artifactId>
+ <version>11</version>
+ </parent>
+
+ <description>
+ Seam build tools
+ </description>
+
+ <url>http://www.seamframework.org</url>
+
+ <licenses>
+ <license>
+ <name>GNU Lesser General Public License, Version 2.1</name>
+ <distribution>repo</distribution>
+ <url>http://www.gnu.org/licenses/lgpl-2.1.txt</url>
+ </license>
+ </licenses>
+
+ <developers>
+ <developer>
+ <name>Seam committers</name>
+ </developer>
+ </developers>
+
+ <properties>
+ <maven.shade.version>1.3.3</maven.shade.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>${maven.shade.version}</version>
+ </dependency>
+
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ </dependency>
+ </dependencies>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/seam/build/trunk/parent</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/seam/build/trunk/parent</developerConnection>
+ <url>http://fisheye.jboss.org/browse/Seam/seam/build/trunk/parent</url>
+ </scm>
+
+</project>
Added: build/trunk/tools/src/main/java/org/jboss/seam/build/tools/XmlAppendingTransformer.java
===================================================================
--- build/trunk/tools/src/main/java/org/jboss/seam/build/tools/XmlAppendingTransformer.java (rev 0)
+++ build/trunk/tools/src/main/java/org/jboss/seam/build/tools/XmlAppendingTransformer.java 2010-06-04 17:10:06 UTC (rev 13042)
@@ -0,0 +1,112 @@
+package org.jboss.seam.build.tools;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringReader;
+import java.util.Iterator;
+import java.util.List;
+import java.util.jar.JarEntry;
+import java.util.jar.JarOutputStream;
+
+import org.apache.maven.plugins.shade.resource.ResourceTransformer;
+import org.jdom.Attribute;
+import org.jdom.Content;
+import org.jdom.Document;
+import org.jdom.Element;
+import org.jdom.JDOMException;
+import org.jdom.input.SAXBuilder;
+import org.jdom.output.Format;
+import org.jdom.output.XMLOutputter;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+public class XmlAppendingTransformer implements ResourceTransformer
+{
+
+ String resource;
+
+ private Document doc;
+
+ public boolean canTransformResource(String resource)
+ {
+ if ( this.resource != null && this.resource.equalsIgnoreCase( resource ) )
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public boolean hasTransformedResource()
+ {
+ return doc != null;
+ }
+
+ public void modifyOutputStream(JarOutputStream os) throws IOException
+ {
+ os.putNextEntry(new JarEntry(resource));
+
+ new XMLOutputter(Format.getPrettyFormat()).output(doc, os);
+
+ doc = null;
+ }
+
+ public void processResource(String resource, InputStream is, List relocators) throws IOException
+ {
+ Document r;
+ try
+ {
+ SAXBuilder builder = new SAXBuilder(false);
+ builder.setExpandEntities(false);
+ builder.setEntityResolver(new EntityResolver()
+ {
+ public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException
+ {
+ return new InputSource(new StringReader(""));
+ }
+ });
+ // Allow empty files
+ if (is.available() == 0)
+ {
+ return;
+ }
+ r = builder.build(is);
+ }
+ catch (JDOMException e)
+ {
+ throw new RuntimeException(e);
+ }
+
+ if (doc == null)
+ {
+ doc = r;
+ }
+ else
+ {
+ Element root = r.getRootElement();
+
+ for (Iterator itr = root.getAttributes().iterator(); itr.hasNext();)
+ {
+ Attribute a = (Attribute) itr.next();
+ itr.remove();
+
+ Element mergedEl = doc.getRootElement();
+ Attribute mergedAtt = mergedEl.getAttribute(a.getName(), a.getNamespace());
+ if (mergedAtt == null)
+ {
+ mergedEl.setAttribute(a);
+ }
+ }
+
+ for (Iterator itr = root.getChildren().iterator(); itr.hasNext();)
+ {
+ Content n = (Content) itr.next();
+ itr.remove();
+
+ doc.getRootElement().addContent(n);
+ }
+ }
+ }
+
+}
Property changes on: build/trunk/tools/src/main/java/org/jboss/seam/build/tools/XmlAppendingTransformer.java
___________________________________________________________________
Name: svn:eol-style
+ native
14 years
Seam SVN: r13041 - dist/trunk.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-06-04 12:57:50 -0400 (Fri, 04 Jun 2010)
New Revision: 13041
Modified:
dist/trunk/pom.xml
Log:
add javadoc (not working)
Modified: dist/trunk/pom.xml
===================================================================
--- dist/trunk/pom.xml 2010-06-04 15:14:06 UTC (rev 13040)
+++ dist/trunk/pom.xml 2010-06-04 16:57:50 UTC (rev 13041)
@@ -302,6 +302,25 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>uber-javadoc-jar</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ <configuration>
+ <includeDependencySources>true</includeDependencySources>
+ <dependencySourceIncludes>
+ <dependencySourceInclude>org.jboss.seam.*</dependencySourceInclude>
+ </dependencySourceIncludes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<dependencies>
<dependency>
@@ -318,7 +337,7 @@
<goal>shade</goal>
</goals>
<configuration>
- <createSourcesJar />
+ <createSourcesJar>true</createSourcesJar>
<artifactSet>
<includes>
<include>org.jboss.seam.*:*</include>
14 years
Seam SVN: r13040 - dist/trunk.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-06-04 11:14:06 -0400 (Fri, 04 Jun 2010)
New Revision: 13040
Modified:
dist/trunk/pom.xml
Log:
add a transformer for beans.xml
Modified: dist/trunk/pom.xml
===================================================================
--- dist/trunk/pom.xml 2010-06-04 14:09:17 UTC (rev 13039)
+++ dist/trunk/pom.xml 2010-06-04 15:14:06 UTC (rev 13040)
@@ -303,6 +303,13 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam.build</groupId>
+ <artifactId>seam-maven-tools</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
<executions>
<execution>
<id>uber-jar</id>
@@ -320,11 +327,7 @@
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
- <!-- XmlAppendingTransformer isn't that useful, it has annoying design and bugs -->
-<!-- <transformer-->
-<!-- implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">-->
-<!-- <resource>META-INF/beans.xml</resource>-->
-<!-- </transformer>-->
+ <transformer implementation="org.jboss.seam.build.tools.BeansXmlAppendingTransformer" />
</transformers>
</configuration>
</execution>
14 years
Seam SVN: r13039 - in dist/trunk: dist and 1 other directory.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-06-04 10:09:17 -0400 (Fri, 04 Jun 2010)
New Revision: 13039
Modified:
dist/trunk/dist/pom.xml
dist/trunk/pom.xml
Log:
first steps towards uber jar
Modified: dist/trunk/dist/pom.xml
===================================================================
--- dist/trunk/dist/pom.xml 2010-06-04 10:24:09 UTC (rev 13038)
+++ dist/trunk/dist/pom.xml 2010-06-04 14:09:17 UTC (rev 13039)
@@ -4,7 +4,7 @@
<groupId>org.jboss.seam</groupId>
<artifactId>seam-distribution</artifactId>
- <packaging>pom</packaging>
+ <packaging>jar</packaging>
<version>3.0.0-SNAPSHOT</version>
<name>Seam Distribution</name>
@@ -158,7 +158,6 @@
<dependency>
<groupId>org.jboss.seam.jms</groupId>
<artifactId>seam-jms</artifactId>
- <version>${seam.jms.version}</version>
<optional>true</optional>
</dependency>
@@ -186,7 +185,7 @@
<dependency>
<groupId>org.jboss.seam.jms</groupId>
- <artifactId>seam-jms</artifactId>
+ <artifactId>seam-jms-api</artifactId>
<classifier>javadoc</classifier>
<version>${seam.jms.version}</version>
<optional>true</optional>
@@ -194,7 +193,7 @@
<dependency>
<groupId>org.jboss.seam.jms</groupId>
- <artifactId>seam-jms</artifactId>
+ <artifactId>seam-jms-api</artifactId>
<classifier>sources</classifier>
<version>${seam.jms.version}</version>
<optional>true</optional>
@@ -245,7 +244,6 @@
<optional>true</optional>
</dependency>
-
</dependencies>
<build>
@@ -255,6 +253,25 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>javadoc-jar</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ <configuration>
+ <includeDependencySources>true</includeDependencySources>
+ <dependencySourceIncludes>
+ <dependencySourceIncludes>org.jboss.seam:*</dependencySourceIncludes>
+ </dependencySourceIncludes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
Modified: dist/trunk/pom.xml
===================================================================
--- dist/trunk/pom.xml 2010-06-04 10:24:09 UTC (rev 13038)
+++ dist/trunk/pom.xml 2010-06-04 14:09:17 UTC (rev 13039)
@@ -1,9 +1,10 @@
-<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">
+<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</groupId>
<artifactId>seam</artifactId>
- <packaging>pom</packaging>
+ <packaging>jar</packaging>
<version>3.0.0-SNAPSHOT</version>
<name>Seam BOM</name>
@@ -182,43 +183,43 @@
<artifactId>seam-xml-config</artifactId>
<version>${seam.xml.config.version}</version>
</dependency>
-
+
<dependency>
<groupId>org.jboss.seam.remoting</groupId>
<artifactId>seam-remoting-core</artifactId>
<version>${seam.remoting.version}</version>
</dependency>
-
+
<dependency>
<groupId>org.jboss.seam.faces</groupId>
<artifactId>seam-faces</artifactId>
<version>${seam.faces.version}</version>
</dependency>
-
+
<dependency>
<groupId>org.jboss.seam.faces</groupId>
<artifactId>seam-faces-api</artifactId>
<version>${seam.faces.version}</version>
</dependency>
-
+
<dependency>
<groupId>org.jboss.seam.jms</groupId>
<artifactId>seam-jms</artifactId>
<version>${seam.jms.version}</version>
</dependency>
-
+
<dependency>
<groupId>org.jboss.seam.jms</groupId>
<artifactId>seam-jms-api</artifactId>
<version>${seam.jms.version}</version>
</dependency>
-
+
<dependency>
<groupId>org.jboss.seam.international</groupId>
<artifactId>seam-international</artifactId>
<version>${seam.international.version}</version>
</dependency>
-
+
<dependency>
<groupId>org.jboss.seam.international</groupId>
<artifactId>seam-international-api</artifactId>
@@ -227,19 +228,111 @@
</dependencies>
</dependencyManagement>
-
+
+ <!-- Dependecies for shaded jar -->
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam.xml</groupId>
+ <artifactId>seam-xml-config</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.remoting</groupId>
+ <artifactId>seam-remoting-core</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.faces</groupId>
+ <artifactId>seam-faces</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.faces</groupId>
+ <artifactId>seam-faces-api</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.jms</groupId>
+ <artifactId>seam-jms</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.jms</groupId>
+ <artifactId>seam-jms-api</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.international</groupId>
+ <artifactId>seam-international</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.international</groupId>
+ <artifactId>seam-international-api</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ </dependencies>
+
<profiles>
<profile>
- <id>distribution</id>
- <activation>
- <property>
- <name>dist</name>
- </property>
- </activation>
- <modules>
- <module>dist</module>
- </modules>
- </profile>
+ <id>distribution</id>
+ <activation>
+ <property>
+ <name>dist</name>
+ </property>
+ </activation>
+ <modules>
+ <module>dist</module>
+ </modules>
+ </profile>
+ <profile>
+ <id>uber-jar</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>uber-jar</id>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+ <createSourcesJar />
+ <artifactSet>
+ <includes>
+ <include>org.jboss.seam.*:*</include>
+ </includes>
+ </artifactSet>
+ <transformers>
+ <transformer
+ implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
+ <!-- XmlAppendingTransformer isn't that useful, it has annoying design and bugs -->
+<!-- <transformer-->
+<!-- implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">-->
+<!-- <resource>META-INF/beans.xml</resource>-->
+<!-- </transformer>-->
+ </transformers>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
<scm>
14 years
Seam SVN: r13038 - modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-06-04 06:24:09 -0400 (Fri, 04 Jun 2010)
New Revision: 13038
Modified:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
Log:
credential configuration, fix remaining compiler errors
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2010-06-04 03:41:11 UTC (rev 13037)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2010-06-04 10:24:09 UTC (rev 13038)
@@ -55,14 +55,15 @@
private static final String PROPERTY_IDENTITY_NAME = "IDENTITY_NAME";
private static final String PROPERTY_IDENTITY_TYPE = "IDENTITY_TYPE";
private static final String PROPERTY_IDENTITY_TYPE_NAME = "IDENTITY_TYPE_NAME";
+ private static final String PROPERTY_CREDENTIAL_VALUE = "CREDENTIAL_VALUE";
+ private static final String PROPERTY_CREDENTIAL_TYPE = "CREDENTIAL_TYPE";
+ private static final String PROPERTY_CREDENTIAL_TYPE_NAME = "CREDENTIAL_TYPE_NAME";
// Entity classes
private Class<?> identityClass;
private Class<?> relationshipClass;
- private Class<?> relationshipTypeClass;
private Class<?> credentialClass;
- private Class<?> credentialTypeClass;
private Class<?> attributeClass;
private Class<?> roleTypeClass;
@@ -76,7 +77,7 @@
/**
* Model properties
*/
- private Map<String,Property<?>> modelProperties = new HashMap<String,Property<?>>();
+ private Map<String,Property<Object>> modelProperties = new HashMap<String,Property<Object>>();
private class PropertyTypeCriteria implements PropertyCriteria
{
@@ -122,7 +123,7 @@
"Error initializing JpaIdentityStore - identityClass not set");
}
- List<Property<String>> props = PropertyQueries.<String>createQuery(identityClass)
+ List<Property<Object>> props = PropertyQueries.createQuery(identityClass)
.addCriteria(new PropertyTypeCriteria(PropertyType.NAME))
.getResultList();
@@ -138,9 +139,10 @@
else
{
// No name property explicitly configured, let's query by property name
- String[] possibleNames = new String[] { "username", "userName", "name" };
- props = PropertyQueries.<String>createQuery(identityClass)
- .addCriteria(new NamedPropertyCriteria(possibleNames))
+ String[] allowedNames = new String[] { "username", "userName", "name" };
+ props = PropertyQueries.createQuery(identityClass)
+ .addCriteria(new TypedPropertyCriteria(String.class))
+ .addCriteria(new NamedPropertyCriteria(allowedNames))
.getResultList();
if (props.size() == 1)
@@ -151,9 +153,9 @@
else if (props.size() > 1)
{
// multiple "name" properties found
- search: for (String name : possibleNames)
+ search: for (String name : allowedNames)
{
- for (Property<String> p : props)
+ for (Property<Object> p : props)
{
if (name.equals(p.getName()))
{
@@ -163,11 +165,11 @@
}
}
}
- else if (props.isEmpty())
+ else
{
// Last resort - check whether the entity class exposes a single String property
// if so, let's assume it's the identity name
- props = PropertyQueries.<String>createQuery(identityClass)
+ props = PropertyQueries.createQuery(identityClass)
.addCriteria(new TypedPropertyCriteria(String.class))
.getResultList();
if (props.size() == 1)
@@ -201,11 +203,11 @@
else
{
// No type property explicitly configured, query by property name
- String[] possibleNames = new String[] { "identityObjectType",
+ String[] allowedNames = new String[] { "identityObjectType",
"identityType", "identityObjectTypeName", "identityTypeName",
"typeName", "discriminator", "accountType", "userType", "type" };
props = PropertyQueries.createQuery(identityClass)
- .addCriteria(new NamedPropertyCriteria(possibleNames))
+ .addCriteria(new NamedPropertyCriteria(allowedNames))
.getResultList();
if (props.size() == 1)
@@ -214,7 +216,7 @@
}
else if (props.size() > 1)
{
- search: for (String name : possibleNames)
+ search: for (String name : allowedNames)
{
for (Property<Object> p : props)
{
@@ -239,7 +241,7 @@
typeProp.getJavaClass().getSimpleName().contains("Type")))
{
// we have a potential match, let's check if this entity has a name property
- Property<String> nameProp = findIdentityTypeNameProperty(typeProp.getJavaClass());
+ Property<Object> nameProp = findIdentityTypeNameProperty(typeProp.getJavaClass());
if (nameProp != null)
{
modelProperties.put(PROPERTY_IDENTITY_TYPE, typeProp);
@@ -262,7 +264,7 @@
!modelProperties.containsKey(PROPERTY_IDENTITY_TYPE_NAME))
{
// We're not dealing with a simple type name - validate the lookup type
- Property<String> nameProp = findIdentityTypeNameProperty(typeProp.getJavaClass());
+ Property<Object> nameProp = findIdentityTypeNameProperty(typeProp.getJavaClass());
if (nameProp != null)
{
modelProperties.put(PROPERTY_IDENTITY_TYPE_NAME, nameProp);
@@ -274,9 +276,9 @@
}
}
- protected Property<String> findIdentityTypeNameProperty(Class<?> identityTypeClass)
+ protected Property<Object> findIdentityTypeNameProperty(Class<?> identityTypeClass)
{
- List<Property<String>> props = PropertyQueries.<String>createQuery(identityTypeClass)
+ List<Property<Object>> props = PropertyQueries.createQuery(identityTypeClass)
.addCriteria(new TypedPropertyCriteria(String.class))
.addCriteria(new PropertyTypeCriteria(PropertyType.NAME))
.getResultList();
@@ -287,15 +289,15 @@
}
else
{
- String[] possibleNames = new String[] { "identityObjectTypeName", "identityTypeName", "typeName", "name" };
- props = PropertyQueries.<String>createQuery(identityTypeClass)
+ String[] allowedNames = new String[] { "identityObjectTypeName", "identityTypeName", "typeName", "name" };
+ props = PropertyQueries.createQuery(identityTypeClass)
.addCriteria(new TypedPropertyCriteria(String.class))
- .addCriteria(new NamedPropertyCriteria(possibleNames))
+ .addCriteria(new NamedPropertyCriteria(allowedNames))
.getResultList();
- for (String name : possibleNames)
+ for (String name : allowedNames)
{
- for (Property<String> prop : props)
+ for (Property<Object> prop : props)
{
if (name.equals(prop.getName())) return prop;
}
@@ -305,59 +307,146 @@
return null;
}
+ protected Property<Object> findCredentialTypeNameProperty(Class<?> credentialTypeClass)
+ {
+ List<Property<Object>> props = PropertyQueries.createQuery(credentialTypeClass)
+ .addCriteria(new TypedPropertyCriteria(String.class))
+ .addCriteria(new PropertyTypeCriteria(PropertyType.NAME))
+ .getResultList();
+
+ if (props.size() == 1)
+ {
+ return props.get(0);
+ }
+ else
+ {
+ String[] allowedNames = new String[] { "credentialObjectTypeName", "credentialTypeName", "typeName", "name" };
+ props = PropertyQueries.createQuery(credentialTypeClass)
+ .addCriteria(new TypedPropertyCriteria(String.class))
+ .addCriteria(new NamedPropertyCriteria(allowedNames))
+ .getResultList();
+
+ for (String name : allowedNames)
+ {
+ for (Property<Object> prop : props)
+ {
+ if (name.equals(prop.getName())) return prop;
+ }
+ }
+ }
+
+ return null;
+ }
+
protected void configureCredentials()
{
- // If a credential entity has been configured, scan it
- if (credentialEntity != null)
+ // If a credential entity has been explicitly configured, scan it
+ if (credentialClass != null)
{
- credentialTypeProperty = new EntityProperty(credentialEntity, PropertyType.TYPE);
+ List<Property<Object>> props = PropertyQueries.createQuery(credentialClass)
+ .addCriteria(new PropertyTypeCriteria(PropertyType.VALUE))
+ .getResultList();
- // If the credential type property isn't a string, assume the credential type
- // is in another table
- if (!String.class.equals(credentialTypeProperty.getPropertyType()))
+ if (props.size() == 1)
{
- credentialTypeEntity = (Class<?>) credentialTypeProperty.getPropertyType();
- credentialTypeNameProperty = new EntityProperty(credentialTypeEntity, PropertyType.NAME);
+ modelProperties.put(PROPERTY_CREDENTIAL_VALUE, props.get(0));
+ }
+ else if (props.size() > 1)
+ {
+ throw new IdentityManagementException(
+ "Ambiguous credential value property in credential class " +
+ credentialClass.getName());
+ }
+ else
+ {
+ // Search for the value property by name
+ String[] allowedNames = new String[] { "credentialValue", "password",
+ "passwordHash", "credential", "value"};
+ props = PropertyQueries.createQuery(credentialClass)
+ .addCriteria(new NamedPropertyCriteria(allowedNames))
+ .getResultList();
- credentialIdentityProperty = new TypedBeanProperty(credentialTypeEntity, identityObjectEntity);
- }
-
- credentialValueProperty = new EntityProperty(credentialEntity, PropertyType.VALUE);
-
-
+ search: for (String name : allowedNames)
+ {
+ for (Property<Object> prop : props)
+ {
+ if (name.equals(prop.getName()))
+ {
+ modelProperties.put(PROPERTY_CREDENTIAL_VALUE, prop);
+ break search;
+ }
+ }
+ }
+ }
}
else
{
- // otherwise assume that the credential value is stored in the identityObjectEntity
- credentialTypeProperty = new EntityProperty(identityObjectEntity, PropertyType.CREDENTIAL_TYPE);
- credentialValueProperty = new EntityProperty(identityObjectEntity, PropertyType.CREDENTIAL);
+ // TODO the credentials are stored somewhere else...
}
+
+ if (!modelProperties.containsKey(PROPERTY_CREDENTIAL_VALUE))
+ {
+ throw new IdentityManagementException("Error initializing JpaIdentityStore - no credential value property found.");
+ }
+
+ // Scan for a credential type property
+ List<Property<Object>> props = PropertyQueries.createQuery(credentialClass)
+ .addCriteria(new PropertyTypeCriteria(PropertyType.TYPE))
+ .getResultList();
-
- }
-
- protected void configureRelationships()
- {
- if (relationshipEntity == null)
+ if (props.size() == 1)
{
+ modelProperties.put(PROPERTY_CREDENTIAL_TYPE, props.get(0));
+ }
+ else if (props.size() > 1)
+ {
throw new IdentityManagementException(
- "Error initializing JpaIdentityStore - identityObjectRelationshipEntity not set");
+ "Ambiguous credential type property in credential class " +
+ credentialClass.getName());
}
+ else
+ {
+ // Search for the type property by name
+ String[] allowedNames = new String[] { "credentialType",
+ "identityObjectCredentialType", "type"};
+ props = PropertyQueries.createQuery(credentialClass)
+ .addCriteria(new NamedPropertyCriteria(allowedNames))
+ .getResultList();
+
+ search: for (String name : allowedNames)
+ {
+ for (Property<Object> prop : props)
+ {
+ if (name.equals(prop.getName()))
+ {
+ modelProperties.put(PROPERTY_CREDENTIAL_TYPE, prop);
+ break search;
+ }
+ }
+ }
+ }
+
+ Property<?> typeProp = modelProperties.get(PROPERTY_CREDENTIAL_TYPE);
- relationshipNameProperty = new EntityProperty(relationshipEntity, PropertyType.NAME);
-
- relationshipFromProperty = new EntityProperty(relationshipEntity, PropertyType.RELATIONSHIP_FROM);
-
- relationshipToProperty = new EntityProperty(relationshipEntity, PropertyType.RELATIONSHIP_TO);
-
- relationshipTypeProperty = new EntityProperty(relationshipEntity, PropertyType.TYPE);
-
- if (!String.class.equals(relationshipTypeProperty.getPropertyType()))
+ // If the credential type property isn't a String, then validate the lookup type
+ if (!String.class.equals(typeProp.getJavaClass()))
{
- relationshipTypeEntity = (Class<?>) relationshipTypeProperty.getPropertyType();
- relationshipTypeNameProperty = new EntityProperty(relationshipTypeEntity, PropertyType.NAME);
- }
+ Property<Object> nameProp = findCredentialTypeNameProperty(typeProp.getJavaClass());
+ if (nameProp != null)
+ {
+ modelProperties.put(PROPERTY_CREDENTIAL_TYPE_NAME, nameProp);
+ }
+ else
+ {
+ throw new IdentityManagementException("Error initializing JpaIdentityStore - no valid credential type name property found.");
+ }
+ }
+ }
+
+ protected void configureRelationships()
+ {
+
}
@@ -366,57 +455,6 @@
}
-
- public Class<?> getIdentityObjectEntity()
- {
- return identityObjectEntity;
- }
-
- public void setIdentityObjectEntity(Class<?> identityObjectEntity)
- {
- this.identityObjectEntity = identityObjectEntity;
- }
-
- public Class<?> getRelationshipEntity()
- {
- return relationshipEntity;
- }
-
- public void setRelationshipEntity(Class<?> relationshipEntity)
- {
- this.relationshipEntity = relationshipEntity;
- }
-
- public Class<?> getCredentialEntity()
- {
- return credentialEntity;
- }
-
- public void setCredentialEntity(Class<?> credentialEntity)
- {
- this.credentialEntity = credentialEntity;
- }
-
- public Class<?> getAttributeEntity()
- {
- return attributeEntity;
- }
-
- public void setAttributeEntity(Class<?> attributeEntity)
- {
- this.attributeEntity = attributeEntity;
- }
-
- public Class<?> getRoleTypeEntity()
- {
- return roleTypeEntity;
- }
-
- public void setRoleTypeEntity(Class<?> roleTypeEntity)
- {
- this.roleTypeEntity = roleTypeEntity;
- }
-
public String getUserIdentityType()
{
return userIdentityType;
@@ -482,7 +520,7 @@
{
try
{
- if (getIdentityObjectEntity() == null)
+ if (identityClass == null)
{
throw new IdentityManagementException("Could not create user, identityObjectEntity not set.");
}
@@ -492,38 +530,34 @@
log.warn("Could not create user, already exists.");
}
- Object userInstance = getIdentityObjectEntity().newInstance();
+ Object userInstance = identityClass.newInstance();
Object credentialInstance = null;
- identityNameProperty.setValue(userInstance, username);
+ modelProperties.get(PROPERTY_IDENTITY_NAME).setValue(userInstance, username);
- if (String.class.equals(identityTypeProperty.getPropertyType()))
+ Property<Object> identityType = modelProperties.get(PROPERTY_IDENTITY_TYPE);
+ if (String.class.equals(identityType.getJavaClass()))
{
- identityTypeProperty.setValue(userInstance, userIdentityType);
+ identityType.setValue(userInstance, userIdentityType);
}
else
{
- identityTypeProperty.setValue(userInstance, lookupIdentityType(userIdentityType));
+ identityType.setValue(userInstance, lookupIdentityType(userIdentityType));
}
- if (getCredentialEntity() == null)
+ if (credentialClass == null)
{
- // The credential must be stored in the identity object
- if (credentialValueProperty.isValid())
- {
- // TODO need to abstract this out
- credentialValueProperty.setValue(userInstance, credential);
- }
-
+ modelProperties.get(PROPERTY_CREDENTIAL_VALUE).setValue(userInstance, credential);
}
else
{
- credentialInstance = getCredentialEntity().newInstance();
- credentialIdentityProperty.setValue(credentialInstance, userInstance);
+ credentialInstance = credentialClass.newInstance();
+ // TODO implement this
+ //credentialIdentityProperty.setValue(credentialInstance, userInstance);
// TODO need to abstract this out
- credentialValueProperty.setValue(credentialInstance, credential);
- if (credentialTypeProperty.isValid())
+ modelProperties.get(PROPERTY_CREDENTIAL_VALUE).setValue(credentialInstance, credential);
+ if (modelProperties.containsKey(PROPERTY_CREDENTIAL_TYPE))
{
// TODO set the credential type - need some kind of mapper?
//credentialTypeProperty.setValue(credentialInstance, lookupCredentialType)
@@ -560,8 +594,9 @@
try
{
Object val = entityManagerInstance.get().createQuery(
- "select t from " + identityTypeEntity.getName() + " t where t." +
- identityTypeNameProperty.getName() + " = :identityType")
+ "select t from " + identityClass.getName() + " t where t." +
+ modelProperties.get(PROPERTY_IDENTITY_TYPE_NAME).getName() +
+ " = :identityType")
.setParameter("identityType", identityType)
.getSingleResult();
return val;
14 years
Seam SVN: r13037 - modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-06-03 23:41:11 -0400 (Thu, 03 Jun 2010)
New Revision: 13037
Modified:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
Log:
identity type configuration
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2010-06-04 02:29:58 UTC (rev 13036)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2010-06-04 03:41:11 UTC (rev 13037)
@@ -1,8 +1,6 @@
package org.jboss.seam.security.management;
import java.io.Serializable;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.HashMap;
@@ -12,13 +10,13 @@
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Instance;
import javax.inject.Inject;
+import javax.persistence.Entity;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import org.jboss.seam.security.annotations.management.IdentityProperty;
import org.jboss.seam.security.annotations.management.PropertyType;
import org.jboss.weld.extensions.util.properties.Property;
-import org.jboss.weld.extensions.util.properties.query.AnnotatedPropertyCriteria;
import org.jboss.weld.extensions.util.properties.query.NamedPropertyCriteria;
import org.jboss.weld.extensions.util.properties.query.PropertyCriteria;
import org.jboss.weld.extensions.util.properties.query.PropertyQueries;
@@ -55,11 +53,12 @@
// Property keys
private static final String PROPERTY_IDENTITY_NAME = "IDENTITY_NAME";
+ private static final String PROPERTY_IDENTITY_TYPE = "IDENTITY_TYPE";
+ private static final String PROPERTY_IDENTITY_TYPE_NAME = "IDENTITY_TYPE_NAME";
// Entity classes
private Class<?> identityClass;
- private Class<?> identityTypeClass;
private Class<?> relationshipClass;
private Class<?> relationshipTypeClass;
private Class<?> credentialClass;
@@ -123,7 +122,7 @@
"Error initializing JpaIdentityStore - identityClass not set");
}
- List<Property<String>> props = PropertyQueries.<String>createPropertyQuery(identityClass)
+ List<Property<String>> props = PropertyQueries.<String>createQuery(identityClass)
.addCriteria(new PropertyTypeCriteria(PropertyType.NAME))
.getResultList();
@@ -139,8 +138,8 @@
else
{
// No name property explicitly configured, let's query by property name
- String[] possibleNames = new String[] { "name", "username", "userName" };
- props = PropertyQueries.<String>createPropertyQuery(identityClass)
+ String[] possibleNames = new String[] { "username", "userName", "name" };
+ props = PropertyQueries.<String>createQuery(identityClass)
.addCriteria(new NamedPropertyCriteria(possibleNames))
.getResultList();
@@ -151,7 +150,7 @@
}
else if (props.size() > 1)
{
- // order of precedence -> username, userName, name
+ // multiple "name" properties found
search: for (String name : possibleNames)
{
for (Property<String> p : props)
@@ -168,7 +167,7 @@
{
// Last resort - check whether the entity class exposes a single String property
// if so, let's assume it's the identity name
- props = PropertyQueries.<String>createPropertyQuery(identityClass)
+ props = PropertyQueries.<String>createQuery(identityClass)
.addCriteria(new TypedPropertyCriteria(String.class))
.getResultList();
if (props.size() == 1)
@@ -186,19 +185,126 @@
protected void configureIdentityType()
{
- identityTypeProperty = new EntityProperty(identityObjectEntity, PropertyType.TYPE);
+ List<Property<Object>> props = PropertyQueries.createQuery(identityClass)
+ .addCriteria(new PropertyTypeCriteria(PropertyType.TYPE))
+ .getResultList();
- if (!String.class.equals(identityTypeProperty.getPropertyType()))
+ if (props.size() == 1)
{
- // If the identity type property isn't a String, it must be a related entity
- identityTypeEntity = (Class<?>) identityTypeProperty.getPropertyType();
+ modelProperties.put(PROPERTY_IDENTITY_TYPE, props.get(0));
+ }
+ else if (props.size() > 1)
+ {
+ throw new IdentityManagementException(
+ "Ambiguous identity type property in identity class " + identityClass.getName());
+ }
+ else
+ {
+ // No type property explicitly configured, query by property name
+ String[] possibleNames = new String[] { "identityObjectType",
+ "identityType", "identityObjectTypeName", "identityTypeName",
+ "typeName", "discriminator", "accountType", "userType", "type" };
+ props = PropertyQueries.createQuery(identityClass)
+ .addCriteria(new NamedPropertyCriteria(possibleNames))
+ .getResultList();
- identityTypeNameProperty = new EntityProperty(identityTypeEntity, PropertyType.NAME);
+ if (props.size() == 1)
+ {
+ modelProperties.put(PROPERTY_IDENTITY_TYPE, props.get(0));
+ }
+ else if (props.size() > 1)
+ {
+ search: for (String name : possibleNames)
+ {
+ for (Property<Object> p : props)
+ {
+ if (name.equals(p.getName()))
+ {
+ modelProperties.put(PROPERTY_IDENTITY_TYPE, p);
+ break search;
+ }
+ }
+ }
+
+ }
+ else if (props.isEmpty())
+ {
+ // Last resort - let's check all properties, and try to find one
+ // with an entity type that has "type" in its name
+ props = PropertyQueries.createQuery(identityClass).getResultList();
+ search: for (Property<Object> typeProp : props)
+ {
+ if (typeProp.getJavaClass().isAnnotationPresent(Entity.class) &&
+ (typeProp.getJavaClass().getSimpleName().contains("type") ||
+ typeProp.getJavaClass().getSimpleName().contains("Type")))
+ {
+ // we have a potential match, let's check if this entity has a name property
+ Property<String> nameProp = findIdentityTypeNameProperty(typeProp.getJavaClass());
+ if (nameProp != null)
+ {
+ modelProperties.put(PROPERTY_IDENTITY_TYPE, typeProp);
+ modelProperties.put(PROPERTY_IDENTITY_TYPE_NAME, nameProp);
+ break search;
+ }
+ }
+ }
+ }
+ }
+
+ Property<?> typeProp = modelProperties.get(PROPERTY_IDENTITY_TYPE);
+
+ if (typeProp == null)
+ {
+ throw new IdentityManagementException("Error initializing JpaIdentityStore - no valid identity type property found.");
}
-
+ if (!String.class.equals(typeProp.getJavaClass()) &&
+ !modelProperties.containsKey(PROPERTY_IDENTITY_TYPE_NAME))
+ {
+ // We're not dealing with a simple type name - validate the lookup type
+ Property<String> nameProp = findIdentityTypeNameProperty(typeProp.getJavaClass());
+ if (nameProp != null)
+ {
+ modelProperties.put(PROPERTY_IDENTITY_TYPE_NAME, nameProp);
+ }
+ else
+ {
+ throw new IdentityManagementException("Error initializing JpaIdentityStore - no valid identity type name property found.");
+ }
+ }
}
+ protected Property<String> findIdentityTypeNameProperty(Class<?> identityTypeClass)
+ {
+ List<Property<String>> props = PropertyQueries.<String>createQuery(identityTypeClass)
+ .addCriteria(new TypedPropertyCriteria(String.class))
+ .addCriteria(new PropertyTypeCriteria(PropertyType.NAME))
+ .getResultList();
+
+ if (props.size() == 1)
+ {
+ return props.get(0);
+ }
+ else
+ {
+ String[] possibleNames = new String[] { "identityObjectTypeName", "identityTypeName", "typeName", "name" };
+ props = PropertyQueries.<String>createQuery(identityTypeClass)
+ .addCriteria(new TypedPropertyCriteria(String.class))
+ .addCriteria(new NamedPropertyCriteria(possibleNames))
+ .getResultList();
+
+ for (String name : possibleNames)
+ {
+ for (Property<String> prop : props)
+ {
+ if (name.equals(prop.getName())) return prop;
+ }
+ }
+ }
+
+ return null;
+ }
+
protected void configureCredentials()
{
// If a credential entity has been configured, scan it
14 years
Seam SVN: r13036 - in modules/security/trunk/impl/src/main/java/org/jboss/seam/security: jaas and 4 other directories.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-06-03 22:29:58 -0400 (Thu, 03 Jun 2010)
New Revision: 13036
Modified:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/CredentialsImpl.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/JpaTokenStore.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/PasswordCredential.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/jaas/SeamLoginModule.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagerImpl.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/RoleAction.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/UserAction.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/UserSearch.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/PicketLinkIdentityStore.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/permission/JpaPermissionStore.java
Log:
fix compiler errors, JpaIdentityStore config
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/CredentialsImpl.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/CredentialsImpl.java 2010-06-03 17:43:51 UTC (rev 13035)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/CredentialsImpl.java 2010-06-04 02:29:58 UTC (rev 13036)
@@ -86,15 +86,14 @@
{
if (this.credential == null)
{
- this.credential = new PasswordCredential();
- ((PasswordCredential) this.credential).setPassword(password);
+ this.credential = new PasswordCredential(password);
}
else if (this.credential != null && this.credential instanceof PasswordCredential &&
((PasswordCredential) this.credential).getPassword() != password &&
((PasswordCredential) this.credential).getPassword() == null ||
!((PasswordCredential) this.credential).getPassword().equals(password))
{
- ((PasswordCredential) this.credential).setPassword(password);
+ this.credential = new PasswordCredential(password);
invalid = false;
manager.fireEvent(new CredentialsUpdatedEvent());
}
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/JpaTokenStore.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/JpaTokenStore.java 2010-06-03 17:43:51 UTC (rev 13035)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/JpaTokenStore.java 2010-06-04 02:29:58 UTC (rev 13036)
@@ -13,7 +13,7 @@
import org.jboss.seam.security.annotations.TokenUsername;
import org.jboss.seam.security.annotations.TokenValue;
import org.jboss.seam.security.management.IdentityManagementException;
-import org.jboss.weld.extensions.util.properties.AnnotatedBeanProperty;
+import org.jboss.weld.extensions.util.properties.Property;
/**
* A TokenStore implementation, stores tokens inside a database table.
@@ -27,8 +27,8 @@
private Class<?> tokenEntityClass;
- private AnnotatedBeanProperty<TokenUsername> tokenUsernameProperty;
- private AnnotatedBeanProperty<TokenValue> tokenValueProperty;
+ private Property<String> tokenUsernameProperty;
+ private Property<String> tokenValueProperty;
@Inject BeanManager manager;
@@ -37,9 +37,9 @@
@Inject
public void create()
{
- tokenUsernameProperty = new AnnotatedBeanProperty<TokenUsername>(tokenEntityClass, TokenUsername.class);
- tokenValueProperty = new AnnotatedBeanProperty<TokenValue>(tokenEntityClass, TokenValue.class);
-
+ //tokenUsernameProperty = new AnnotatedBeanProperty<TokenUsername>(tokenEntityClass, TokenUsername.class);
+ //tokenValueProperty = new AnnotatedBeanProperty<TokenValue>(tokenEntityClass, TokenValue.class);
+ /*
if (!tokenUsernameProperty.isSet())
{
throw new IllegalStateException("Invalid tokenClass " + tokenEntityClass.getName() +
@@ -50,7 +50,7 @@
{
throw new IllegalStateException("Invalid tokenClass " + tokenEntityClass.getName() +
" - required annotation @TokenValue not found on any Field or Method.");
- }
+ }*/
}
public void createToken(String username, String value)
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/PasswordCredential.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/PasswordCredential.java 2010-06-03 17:43:51 UTC (rev 13035)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/PasswordCredential.java 2010-06-04 02:29:58 UTC (rev 13036)
@@ -15,6 +15,11 @@
private String password;
+ public PasswordCredential(String password)
+ {
+ this.password = password;
+ }
+
public org.picketlink.idm.api.CredentialType getType()
{
return CREDENTIAL_TYPE;
@@ -24,9 +29,4 @@
{
return password;
}
-
- public void setPassword(String password)
- {
- this.password = password;
- }
}
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/jaas/SeamLoginModule.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/jaas/SeamLoginModule.java 2010-06-03 17:43:51 UTC (rev 13035)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/jaas/SeamLoginModule.java 2010-06-04 02:29:58 UTC (rev 13036)
@@ -12,6 +12,7 @@
import javax.security.auth.login.LoginException;
import javax.security.auth.spi.LoginModule;
+import org.jboss.seam.security.PasswordCredential;
import org.jboss.seam.security.SimplePrincipal;
import org.jboss.seam.security.callbacks.AuthenticatorCallback;
import org.jboss.seam.security.callbacks.IdentityCallback;
@@ -83,10 +84,10 @@
// Otherwise if identity management is enabled, use it.
IdentityManager identityManager = idmCallback.getIdentityManager();
- if (identityManager != null && identityManager.isEnabled())
+ if (identityManager != null)
{
boolean success = identityManager.authenticate(username,
- new String(cbPassword.getPassword()));
+ new PasswordCredential(new String(cbPassword.getPassword())));
if (success)
{
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagerImpl.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagerImpl.java 2010-06-03 17:43:51 UTC (rev 13035)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagerImpl.java 2010-06-04 02:29:58 UTC (rev 13036)
@@ -174,12 +174,7 @@
identity.checkPermission(GROUP_PERMISSION_NAME, PERMISSION_DELETE);
return groupIdentityStore.deleteGroup(groupName, groupType);
}
-
- public boolean removeFromGroup(String username, Group group)
- {
- return groupIdentityStore.removeUserFromGroup(username, group);
- }
-
+
public boolean userExists(String name)
{
identity.checkPermission(USER_PERMISSION_NAME, PERMISSION_READ);
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2010-06-03 17:43:51 UTC (rev 13035)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2010-06-04 02:29:58 UTC (rev 13036)
@@ -1,6 +1,10 @@
package org.jboss.seam.security.management;
import java.io.Serializable;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -13,8 +17,12 @@
import org.jboss.seam.security.annotations.management.IdentityProperty;
import org.jboss.seam.security.annotations.management.PropertyType;
-import org.jboss.weld.extensions.util.properties.AnnotatedBeanProperty;
-import org.jboss.weld.extensions.util.properties.TypedBeanProperty;
+import org.jboss.weld.extensions.util.properties.Property;
+import org.jboss.weld.extensions.util.properties.query.AnnotatedPropertyCriteria;
+import org.jboss.weld.extensions.util.properties.query.NamedPropertyCriteria;
+import org.jboss.weld.extensions.util.properties.query.PropertyCriteria;
+import org.jboss.weld.extensions.util.properties.query.PropertyQueries;
+import org.jboss.weld.extensions.util.properties.query.TypedPropertyCriteria;
import org.picketlink.idm.api.Credential;
import org.picketlink.idm.api.Group;
import org.picketlink.idm.api.IdentityType;
@@ -32,6 +40,8 @@
{
private static final long serialVersionUID = 7729139146633529501L;
+ private Logger log = LoggerFactory.getLogger(JpaIdentityStore.class);
+
private static final String DEFAULT_USER_IDENTITY_TYPE = "USER";
private static final String DEFAULT_ROLE_IDENTITY_TYPE = "ROLE";
private static final String DEFAULT_GROUP_IDENTITY_TYPE = "GROUP";
@@ -41,44 +51,22 @@
private static final String DEFAULT_ATTRIBUTE_USER_ENABLED = "ENABLED";
private static final String DEFAULT_ATTRIBUTE_PASSWORD_SALT = "PASSWORD_SALT";
+
+ // Property keys
+
+ private static final String PROPERTY_IDENTITY_NAME = "IDENTITY_NAME";
- private Logger log = LoggerFactory.getLogger(JpaIdentityStore.class);
+ // Entity classes
- // The following entity classes are configurable
- private Class<?> identityObjectEntity;
- private Class<?> relationshipEntity;
- private Class<?> credentialEntity;
- private Class<?> attributeEntity;
- private Class<?> roleTypeEntity;
+ private Class<?> identityClass;
+ private Class<?> identityTypeClass;
+ private Class<?> relationshipClass;
+ private Class<?> relationshipTypeClass;
+ private Class<?> credentialClass;
+ private Class<?> credentialTypeClass;
+ private Class<?> attributeClass;
+ private Class<?> roleTypeClass;
- // The following entity classes may be determined automatically
- private Class<?> identityTypeEntity;
- private Class<?> relationshipTypeEntity;
- private Class<?> credentialTypeEntity;
-
- private AnnotatedBeanProperty<IdentityProperty> identityNameProperty;
- private AnnotatedBeanProperty<IdentityProperty> identityTypeProperty;
- private AnnotatedBeanProperty<IdentityProperty> identityTypeNameProperty;
-
- private AnnotatedBeanProperty<IdentityProperty> relationshipNameProperty;
- private AnnotatedBeanProperty<IdentityProperty> relationshipTypeProperty;
- private AnnotatedBeanProperty<IdentityProperty> relationshipFromProperty;
- private AnnotatedBeanProperty<IdentityProperty> relationshipToProperty;
- private AnnotatedBeanProperty<IdentityProperty> relationshipTypeNameProperty;
-
- private AnnotatedBeanProperty<IdentityProperty> credentialTypeProperty;
- private AnnotatedBeanProperty<IdentityProperty> credentialValueProperty;
- private AnnotatedBeanProperty<IdentityProperty> credentialTypeNameProperty;
- private TypedBeanProperty credentialIdentityProperty;
-
- private AnnotatedBeanProperty<IdentityProperty> attributeNameProperty;
- private AnnotatedBeanProperty<IdentityProperty> attributeValueProperty;
-
- private AnnotatedBeanProperty<IdentityProperty> roleTypeNameProperty;
-
- private Map<String,AnnotatedBeanProperty<IdentityProperty>> annotatedProperties =
- new HashMap<String,AnnotatedBeanProperty<IdentityProperty>>();
-
private String userIdentityType = DEFAULT_USER_IDENTITY_TYPE;
private String roleIdentityType = DEFAULT_ROLE_IDENTITY_TYPE;
private String groupIdentityType = DEFAULT_GROUP_IDENTITY_TYPE;
@@ -86,39 +74,118 @@
private String relationshipTypeMembership = DEFAULT_RELATIONSHIP_TYPE_MEMBERSHIP;
private String relationshipTypeRole = DEFAULT_RELATIONSHIP_TYPE_ROLE;
- private class EntityProperty extends AnnotatedBeanProperty<IdentityProperty>
+ /**
+ * Model properties
+ */
+ private Map<String,Property<?>> modelProperties = new HashMap<String,Property<?>>();
+
+ private class PropertyTypeCriteria implements PropertyCriteria
{
- private PropertyType pt;
+ private PropertyType pt;
- public EntityProperty(Class<?> cls, PropertyType pt)
+ public PropertyTypeCriteria(PropertyType pt)
{
- super(cls, IdentityProperty.class);
- this.pt = pt;
+ this.pt = pt;
}
-
- public boolean annotationMatches(IdentityProperty p)
+
+ public boolean fieldMatches(Field f)
{
- return p.value().equals(pt);
- }
+ return f.isAnnotationPresent(IdentityProperty.class) &&
+ f.getAnnotation(IdentityProperty.class).value().equals(pt);
+ }
+
+ public boolean methodMatches(Method m)
+ {
+ return m.isAnnotationPresent(IdentityProperty.class) &&
+ m.getAnnotation(IdentityProperty.class).value().equals(pt);
+ }
+
}
-
+
@Inject
public void init()
{
- if (identityObjectEntity == null)
+ configureIdentityName();
+ configureIdentityType();
+
+ //configureCredentials();
+ //configureRelationships();
+ //configureAttributes();
+
+ //roleTypeNameProperty = new EntityProperty(roleTypeEntity, PropertyType.NAME);
+ }
+
+ protected void configureIdentityName()
+ {
+ if (identityClass == null)
{
throw new IdentityManagementException(
- "Error initializing JpaIdentityStore - identityObjectEntity not set");
+ "Error initializing JpaIdentityStore - identityClass not set");
}
- if (relationshipEntity == null)
+ List<Property<String>> props = PropertyQueries.<String>createPropertyQuery(identityClass)
+ .addCriteria(new PropertyTypeCriteria(PropertyType.NAME))
+ .getResultList();
+
+ if (props.size() == 1)
{
+ modelProperties.put(PROPERTY_IDENTITY_NAME, props.get(0));
+ }
+ else if (props.size() > 1)
+ {
throw new IdentityManagementException(
- "Error initializing JpaIdentityStore - identityObjectRelationshipEntity not set");
+ "Ambiguous identity name property in identity class " + identityClass.getName());
}
-
- identityNameProperty = new EntityProperty(identityObjectEntity, PropertyType.NAME);
-
+ else
+ {
+ // No name property explicitly configured, let's query by property name
+ String[] possibleNames = new String[] { "name", "username", "userName" };
+ props = PropertyQueries.<String>createPropertyQuery(identityClass)
+ .addCriteria(new NamedPropertyCriteria(possibleNames))
+ .getResultList();
+
+ if (props.size() == 1)
+ {
+ // Bingo, use the name property
+ modelProperties.put(PROPERTY_IDENTITY_NAME, props.get(0));
+ }
+ else if (props.size() > 1)
+ {
+ // order of precedence -> username, userName, name
+ search: for (String name : possibleNames)
+ {
+ for (Property<String> p : props)
+ {
+ if (name.equals(p.getName()))
+ {
+ modelProperties.put(PROPERTY_IDENTITY_NAME, p);
+ break search;
+ }
+ }
+ }
+ }
+ else if (props.isEmpty())
+ {
+ // Last resort - check whether the entity class exposes a single String property
+ // if so, let's assume it's the identity name
+ props = PropertyQueries.<String>createPropertyQuery(identityClass)
+ .addCriteria(new TypedPropertyCriteria(String.class))
+ .getResultList();
+ if (props.size() == 1)
+ {
+ modelProperties.put(PROPERTY_IDENTITY_NAME, props.get(0));
+ }
+ }
+ }
+
+ if (!modelProperties.containsKey(PROPERTY_IDENTITY_NAME))
+ {
+ throw new IdentityManagementException("Error initializing JpaIdentityStore - no valid identity name property found.");
+ }
+ }
+
+ protected void configureIdentityType()
+ {
identityTypeProperty = new EntityProperty(identityObjectEntity, PropertyType.TYPE);
if (!String.class.equals(identityTypeProperty.getPropertyType()))
@@ -129,20 +196,11 @@
identityTypeNameProperty = new EntityProperty(identityTypeEntity, PropertyType.NAME);
}
- relationshipNameProperty = new EntityProperty(relationshipEntity, PropertyType.NAME);
-
- relationshipFromProperty = new EntityProperty(relationshipEntity, PropertyType.RELATIONSHIP_FROM);
-
- relationshipToProperty = new EntityProperty(relationshipEntity, PropertyType.RELATIONSHIP_TO);
-
- relationshipTypeProperty = new EntityProperty(relationshipEntity, PropertyType.TYPE);
-
- if (!String.class.equals(relationshipTypeProperty.getPropertyType()))
- {
- relationshipTypeEntity = (Class<?>) relationshipTypeProperty.getPropertyType();
- relationshipTypeNameProperty = new EntityProperty(relationshipTypeEntity, PropertyType.NAME);
- }
-
+
+ }
+
+ protected void configureCredentials()
+ {
// If a credential entity has been configured, scan it
if (credentialEntity != null)
{
@@ -169,9 +227,40 @@
credentialValueProperty = new EntityProperty(identityObjectEntity, PropertyType.CREDENTIAL);
}
- roleTypeNameProperty = new EntityProperty(roleTypeEntity, PropertyType.NAME);
+
}
+ protected void configureRelationships()
+ {
+ if (relationshipEntity == null)
+ {
+ throw new IdentityManagementException(
+ "Error initializing JpaIdentityStore - identityObjectRelationshipEntity not set");
+ }
+
+ relationshipNameProperty = new EntityProperty(relationshipEntity, PropertyType.NAME);
+
+ relationshipFromProperty = new EntityProperty(relationshipEntity, PropertyType.RELATIONSHIP_FROM);
+
+ relationshipToProperty = new EntityProperty(relationshipEntity, PropertyType.RELATIONSHIP_TO);
+
+ relationshipTypeProperty = new EntityProperty(relationshipEntity, PropertyType.TYPE);
+
+ if (!String.class.equals(relationshipTypeProperty.getPropertyType()))
+ {
+ relationshipTypeEntity = (Class<?>) relationshipTypeProperty.getPropertyType();
+ relationshipTypeNameProperty = new EntityProperty(relationshipTypeEntity, PropertyType.NAME);
+ }
+
+
+ }
+
+ protected void configureAttributes()
+ {
+
+ }
+
+
public Class<?> getIdentityObjectEntity()
{
return identityObjectEntity;
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/RoleAction.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/RoleAction.java 2010-06-03 17:43:51 UTC (rev 13035)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/RoleAction.java 2010-06-04 02:29:58 UTC (rev 13036)
@@ -43,14 +43,16 @@
//identityManager.deleteRole(originalRole);
}
- if (identityManager.roleTypeExists(role))
+ /*if (identityManager.roleTypeExists(role))
{
return saveExistingRole();
}
else
{
return saveNewRole();
- }
+ }*/
+
+ return null;
}
private String saveNewRole()
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/UserAction.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/UserAction.java 2010-06-03 17:43:51 UTC (rev 13035)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/UserAction.java 2010-06-04 02:29:58 UTC (rev 13036)
@@ -9,6 +9,7 @@
import javax.inject.Inject;
import javax.inject.Named;
+import org.jboss.seam.security.PasswordCredential;
import org.jboss.seam.security.management.IdentityManager;
import org.picketlink.idm.api.Role;
@@ -73,7 +74,7 @@
return "failure";
}
- boolean success = identityManager.createUser(username, password);
+ boolean success = identityManager.createUser(username, new PasswordCredential(password));
if (success)
{
@@ -108,7 +109,7 @@
}
else
{
- identityManager.changePassword(username, password);
+ identityManager.updateCredential(username, new PasswordCredential(password));
}
}
@@ -119,7 +120,8 @@
for (Role role : grantedRoles)
{
if (!roles.contains(role)) identityManager.revokeRole(username,
- role.getRoleType().getName(), role.getGroup());
+ role.getRoleType().getName(), role.getGroup().getName(),
+ role.getGroup().getGroupType());
}
}
@@ -127,7 +129,8 @@
{
if (grantedRoles == null || !grantedRoles.contains(role))
{
- identityManager.grantRole(username, role.getRoleType().getName(), role.getGroup());
+ identityManager.grantRole(username, role.getRoleType().getName(),
+ role.getGroup().getName(), role.getGroup().getGroupType());
}
}
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/UserSearch.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/UserSearch.java 2010-06-03 17:43:51 UTC (rev 13035)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/UserSearch.java 2010-06-04 02:29:58 UTC (rev 13036)
@@ -24,7 +24,7 @@
public void loadUsers()
{
- users = identityManager.getUsers();
+ users = identityManager.findUsers(null);
}
public String getUserRoles(String username)
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/PicketLinkIdentityStore.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/PicketLinkIdentityStore.java 2010-06-03 17:43:51 UTC (rev 13035)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/PicketLinkIdentityStore.java 2010-06-04 02:29:58 UTC (rev 13036)
@@ -1,15 +1,16 @@
package org.jboss.seam.security.management.picketlink;
import java.util.List;
+import java.util.Map;
import javax.enterprise.context.Dependent;
import javax.inject.Inject;
import org.jboss.seam.security.management.IdentityStore;
+import org.picketlink.idm.api.Credential;
import org.picketlink.idm.api.Group;
import org.picketlink.idm.api.IdentitySession;
import org.picketlink.idm.api.IdentityType;
-import org.picketlink.idm.api.PersistenceManager;
import org.picketlink.idm.api.Role;
@Dependent
@@ -17,233 +18,189 @@
{
@Inject IdentitySession identitySession;
- public boolean createGroup(String name)
+ public boolean associateGroup(String groupName, String groupType,
+ String memberGroupName, String memberGroupType)
{
// TODO Auto-generated method stub
- PersistenceManager pm = identitySession.getPersistenceManager();
-
return false;
}
-
-
- public boolean addUserToGroup(String username, Group group)
+ public boolean associateUser(String groupName, String groupType,
+ String username)
{
// TODO Auto-generated method stub
return false;
}
-
-
- public boolean authenticate(String username, String password)
+ public boolean authenticate(String username, Credential credential)
{
// TODO Auto-generated method stub
return false;
}
-
-
- public boolean changePassword(String username, String password)
+ public boolean createGroup(String name, String groupType)
{
// TODO Auto-generated method stub
return false;
}
-
-
- public boolean createGroup(String name, String groupType)
+ public boolean createRoleType(String roleType)
{
// TODO Auto-generated method stub
return false;
}
-
-
- public boolean createRoleType(String roleType)
+ public boolean createUser(String username, Credential credential,
+ Map<String, ?> attributes)
{
// TODO Auto-generated method stub
return false;
}
-
-
- public boolean createUser(String username, String password)
+ public boolean deleteGroup(String name, String groupType)
{
// TODO Auto-generated method stub
return false;
}
-
-
- public boolean createUser(String username, String password,
- String firstname, String lastname)
+ public boolean deleteRoleType(String roleType)
{
// TODO Auto-generated method stub
return false;
}
-
-
- public boolean deleteGroup(String name, String groupType)
+ public boolean deleteUser(String username)
{
// TODO Auto-generated method stub
return false;
}
-
-
- public boolean deleteRoleType(String roleType)
+ public boolean deleteUserAttribute(String username, String attribute)
{
// TODO Auto-generated method stub
return false;
}
-
-
- public boolean deleteUser(String username)
+ public boolean disableUser(String username)
{
// TODO Auto-generated method stub
return false;
}
-
-
- public boolean disableUser(String username)
+ public boolean disassociateGroup(String groupName, String groupType,
+ String memberGroupName, String memberGroupType)
{
// TODO Auto-generated method stub
return false;
}
-
-
- public boolean enableUser(String username)
+ public boolean disassociateUser(String groupName, String groupType,
+ String username)
{
// TODO Auto-generated method stub
return false;
}
-
-
- public Group findGroup(String name, String groupType)
+ public boolean enableUser(String username)
{
// TODO Auto-generated method stub
- return null;
+ return false;
}
-
-
- public List<String> findUsers()
+ public Group findGroup(String name, String groupType)
{
// TODO Auto-generated method stub
return null;
}
-
-
public List<String> findUsers(String filter)
{
// TODO Auto-generated method stub
return null;
}
-
-
- public boolean grantRole(String username, String roleType, Group group)
+ public boolean grantRole(String username, String roleType, String groupName,
+ String groupType)
{
// TODO Auto-generated method stub
return false;
}
-
-
public boolean isUserEnabled(String username)
{
// TODO Auto-generated method stub
return false;
}
-
-
public List<String> listGrantableRoleTypes()
{
// TODO Auto-generated method stub
return null;
}
-
-
public List<Role> listGrantedRoles(String username)
{
// TODO Auto-generated method stub
return null;
}
-
-
public List<IdentityType> listGroupMembers(Group group)
{
// TODO Auto-generated method stub
return null;
}
-
-
public List<Role> listImpliedRoles(String username)
{
// TODO Auto-generated method stub
return null;
}
-
-
- public List<IdentityType> listRoleMembers(String roleType, Group group)
+ public List<IdentityType> listRoleMembers(String roleType, String groupName,
+ String groupType)
{
// TODO Auto-generated method stub
return null;
}
-
-
public List<String> listRoleTypes()
{
// TODO Auto-generated method stub
return null;
}
-
-
- public boolean removeUserFromGroup(String username, Group group)
+ public boolean revokeRole(String username, String roleType,
+ String groupName, String groupType)
{
// TODO Auto-generated method stub
return false;
}
-
-
- public boolean revokeRole(String username, String roleType, Group group)
+ public boolean roleTypeExists(String roleType)
{
// TODO Auto-generated method stub
return false;
}
-
-
- public boolean roleTypeExists(String roleType)
+ public boolean setUserAttribute(String username, String attribute,
+ Object value)
{
// TODO Auto-generated method stub
return false;
}
-
-
public boolean supportsFeature(Feature feature)
{
// TODO Auto-generated method stub
return false;
}
+ public boolean updateCredential(String username, Credential credential)
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
-
public boolean userExists(String username)
{
// TODO Auto-generated method stub
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/permission/JpaPermissionStore.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/permission/JpaPermissionStore.java 2010-06-03 17:43:51 UTC (rev 13035)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/permission/JpaPermissionStore.java 2010-06-04 02:29:58 UTC (rev 13036)
@@ -24,7 +24,7 @@
import org.jboss.seam.security.annotations.permission.PermissionTarget;
import org.jboss.seam.security.management.IdentityManager;
import org.jboss.seam.security.permission.PermissionMetadata.ActionSet;
-import org.jboss.weld.extensions.util.properties.AnnotatedBeanProperty;
+import org.jboss.weld.extensions.util.properties.Property;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -45,15 +45,15 @@
private Class<?> userPermissionClass;
private Class<?> rolePermissionClass;
- private AnnotatedBeanProperty<PermissionRecipient> recipientProperty;
- private AnnotatedBeanProperty<PermissionRole> roleProperty;
+ private Property recipientProperty;
+ private Property roleProperty;
- private AnnotatedBeanProperty<PermissionTarget> targetProperty;
- private AnnotatedBeanProperty<PermissionAction> actionProperty;
- private AnnotatedBeanProperty<PermissionRecipientType> recipientTypeProperty;
+ private Property<String> targetProperty;
+ private Property<String> actionProperty;
+ private Property<String> recipientTypeProperty;
- private AnnotatedBeanProperty<PermissionTarget> roleTargetProperty;
- private AnnotatedBeanProperty<PermissionAction> roleActionProperty;
+ private Property<String> roleTargetProperty;
+ private Property<String> roleActionProperty;
private Map<Integer,String> queryCache = new HashMap<Integer,String>();
@@ -107,7 +107,7 @@
PermissionRecipientType.class);
}
}
- */
+
if (!recipientProperty.isSet())
{
throw new RuntimeException("Invalid userPermissionClass " + userPermissionClass.getName() +
@@ -139,7 +139,7 @@
throw new RuntimeException("Invalid userPermissionClass " + userPermissionClass.getName() +
" - no rolePermissionClass set and @PermissionDiscriminator annotation not found on " +
"any Field or Method");
- }
+ }*/
}
/**
@@ -338,7 +338,7 @@
return true;
}
- if (!recipientTypeProperty.isSet())
+ if (recipientTypeProperty == null)
{
throw new RuntimeException("Could not grant permission, rolePermissionClass not set");
}
@@ -375,9 +375,10 @@
recipientProperty.setValue(instance, resolvePrincipalEntity(recipient));
}
- if (recipientTypeProperty.isSet())
+ if (recipientTypeProperty != null)
{
- PermissionRecipientType discriminator = recipientTypeProperty.getAnnotation();
+ PermissionRecipientType discriminator = recipientTypeProperty
+ .getAnnotatedElement().getAnnotation(PermissionRecipientType.class);
// TODO need to populate the correct recipient type
//recipientTypeProperty.setValue(instance, recipientIsRole ? discriminator.roleValue() :
// discriminator.userValue());
@@ -514,7 +515,8 @@
private String getDiscriminatorValue(boolean isRole)
{
- PermissionRecipientType discriminator = recipientTypeProperty.getAnnotation();
+ PermissionRecipientType discriminator = recipientTypeProperty
+ .getAnnotatedElement().getAnnotation(PermissionRecipientType.class);
// TODO fix
//return isRole ? discriminator.roleValue() : discriminator.userValue();
return null;
@@ -532,13 +534,13 @@
{
boolean recipientIsRole = recipient instanceof RoleImpl;
- if (identityManager.getIdentityStore() != null //&&
+ //if (identityManager.getIdentityStore() != null //&&
//identityManager.getIdentityStore() instanceof JpaIdentityStore)
- )
+ // )
{
// TODO review this code
- if (recipientIsRole && roleProperty.isSet() //&&
+ if (recipientIsRole && roleProperty != null //&&
//roleProperty.getPropertyType().equals(config.getRoleEntityClass()))
)
{
@@ -556,9 +558,7 @@
}
protected Principal resolvePrincipal(Object principal, boolean isUser)
- {
- identityManager.getRoleIdentityStore();
-
+ {
// TODO review this
/*
@@ -622,7 +622,7 @@
Map<String,Principal> principalCache = new HashMap<String,Principal>();
- boolean useDiscriminator = rolePermissionClass == null && recipientTypeProperty.isSet();
+ boolean useDiscriminator = rolePermissionClass == null && recipientTypeProperty != null;
Map<String,Object> identifierCache = null;
14 years
Seam SVN: r13035 - dist/trunk/dist.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-06-03 13:43:51 -0400 (Thu, 03 Jun 2010)
New Revision: 13035
Added:
dist/trunk/dist/pom.xml
Modified:
dist/trunk/dist/
Log:
oops, ignores
Property changes on: dist/trunk/dist
___________________________________________________________________
Name: svn:ignore
+ target
.project
.settings
Added: dist/trunk/dist/pom.xml
===================================================================
--- dist/trunk/dist/pom.xml (rev 0)
+++ dist/trunk/dist/pom.xml 2010-06-03 17:43:51 UTC (rev 13035)
@@ -0,0 +1,269 @@
+<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</groupId>
+ <artifactId>seam-distribution</artifactId>
+ <packaging>pom</packaging>
+ <version>3.0.0-SNAPSHOT</version>
+ <name>Seam Distribution</name>
+
+ <parent>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>seam</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ </parent>
+
+ <description>
+ The Seam distribution
+ </description>
+
+ <url>http://www.seamframework.org</url>
+
+ <dependencies>
+ <!-- Seam Modules -->
+
+ <!-- Seam XML Config -->
+ <dependency>
+ <groupId>org.jboss.seam.xml</groupId>
+ <artifactId>seam-xml-config</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.xml</groupId>
+ <artifactId>seam-xml-config</artifactId>
+ <classifier>javadoc</classifier>
+ <version>${seam.xml.config.version}</version>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.xml</groupId>
+ <artifactId>seam-xml-config</artifactId>
+ <classifier>sources</classifier>
+ <version>${seam.xml.config.version}</version>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.xml</groupId>
+ <artifactId>seam-xml-examples-princess-rescue</artifactId>
+ <!-- <version>${seam.xml.config.version}</version>-->
+ <!-- Need example releases -->
+ <version>3.0.0-SNAPSHOT</version>
+ <type>zip</type>
+ <optional>true</optional>
+ </dependency>
+
+ <!-- Seam Remoting -->
+ <dependency>
+ <groupId>org.jboss.seam.remoting</groupId>
+ <artifactId>seam-remoting-core</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.remoting</groupId>
+ <artifactId>seam-remoting-core</artifactId>
+ <classifier>javadoc</classifier>
+ <version>${seam.remoting.version}</version>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.remoting</groupId>
+ <artifactId>seam-remoting-core</artifactId>
+ <classifier>sources</classifier>
+ <version>${seam.remoting.version}</version>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.remoting</groupId>
+ <artifactId>seam-remoting-helloworld-example</artifactId>
+ <!-- <version>${seam.remoting.version}</version>-->
+ <!-- Need example releases -->
+ <version>3.0.0-SNAPSHOT</version>
+ <type>zip</type>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.remoting</groupId>
+ <artifactId>seam-remoting-model-example</artifactId>
+ <!-- <version>${seam.remoting.version}</version>-->
+ <!-- Need example releases -->
+ <version>3.0.0-SNAPSHOT</version>
+ <type>zip</type>
+ <optional>true</optional>
+ </dependency>
+
+ <!-- Seam Faces -->
+ <dependency>
+ <groupId>org.jboss.seam.faces</groupId>
+ <artifactId>seam-faces</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.faces</groupId>
+ <artifactId>seam-faces</artifactId>
+ <classifier>javadoc</classifier>
+ <version>${seam.faces.version}</version>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.faces</groupId>
+ <artifactId>seam-faces</artifactId>
+ <classifier>sources</classifier>
+ <version>${seam.faces.version}</version>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.faces</groupId>
+ <artifactId>seam-faces-api</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.faces</groupId>
+ <artifactId>seam-faces-api</artifactId>
+ <classifier>javadoc</classifier>
+ <version>${seam.faces.version}</version>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.faces</groupId>
+ <artifactId>seam-faces-api</artifactId>
+ <classifier>sources</classifier>
+ <version>${seam.faces.version}</version>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.faces</groupId>
+ <artifactId>seam-faces-examples-short-ly</artifactId>
+ <!-- <version>${seam.faces.version}</version>-->
+ <!-- Need example releases -->
+ <version>3.0.0-SNAPSHOT</version>
+ <type>zip</type>
+ <optional>true</optional>
+ </dependency>
+
+ <!-- Seam JMS -->
+ <dependency>
+ <groupId>org.jboss.seam.jms</groupId>
+ <artifactId>seam-jms</artifactId>
+ <version>${seam.jms.version}</version>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.jms</groupId>
+ <artifactId>seam-jms</artifactId>
+ <classifier>javadoc</classifier>
+ <version>${seam.jms.version}</version>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.jms</groupId>
+ <artifactId>seam-jms</artifactId>
+ <classifier>sources</classifier>
+ <version>${seam.jms.version}</version>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.jms</groupId>
+ <artifactId>seam-jms-api</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.jms</groupId>
+ <artifactId>seam-jms</artifactId>
+ <classifier>javadoc</classifier>
+ <version>${seam.jms.version}</version>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.jms</groupId>
+ <artifactId>seam-jms</artifactId>
+ <classifier>sources</classifier>
+ <version>${seam.jms.version}</version>
+ <optional>true</optional>
+ </dependency>
+
+ <!-- Seam International -->
+ <dependency>
+ <groupId>org.jboss.seam.international</groupId>
+ <artifactId>seam-international</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.international</groupId>
+ <artifactId>seam-international</artifactId>
+ <classifier>javadoc</classifier>
+ <version>${seam.international.version}</version>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.international</groupId>
+ <artifactId>seam-international</artifactId>
+ <classifier>sources</classifier>
+ <version>${seam.international.version}</version>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.international</groupId>
+ <artifactId>seam-international-api</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.international</groupId>
+ <artifactId>seam-international-api</artifactId>
+ <classifier>javadoc</classifier>
+ <version>${seam.international.version}</version>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.international</groupId>
+ <artifactId>seam-international-api</artifactId>
+ <classifier>sources</classifier>
+ <version>${seam.international.version}</version>
+ <optional>true</optional>
+ </dependency>
+
+
+ </dependencies>
+
+ <build>
+ <finalName>seam</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/seam/dist/trunk
+ </connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/seam/dist/trunk
+ </developerConnection>
+ <url>http://fisheye.jboss.org/browse/Seam</url>
+ </scm>
+
+</project>
Property changes on: dist/trunk/dist/pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years