[jboss-cvs] Picketlink SVN: r155 - in idm/trunk: assembly and 21 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Mar 3 11:07:21 EST 2010
Author: bdaw
Date: 2010-03-03 11:07:19 -0500 (Wed, 03 Mar 2010)
New Revision: 155
Modified:
idm/trunk/assembly/pom.xml
idm/trunk/example/auth-simple/pom.xml
idm/trunk/example/auth/pom.xml
idm/trunk/example/simple/pom.xml
idm/trunk/integration/deployer/pom.xml
idm/trunk/integration/jboss5/pom.xml
idm/trunk/integration/pom.xml
idm/trunk/parent/pom.xml
idm/trunk/picketlink-idm-api/pom.xml
idm/trunk/picketlink-idm-auth/pom.xml
idm/trunk/picketlink-idm-cache/pom.xml
idm/trunk/picketlink-idm-common/pom.xml
idm/trunk/picketlink-idm-core/pom.xml
idm/trunk/picketlink-idm-docs/ReferenceGuide/pom.xml
idm/trunk/picketlink-idm-docs/pom.xml
idm/trunk/picketlink-idm-hibernate/pom.xml
idm/trunk/picketlink-idm-hibernate/src/main/java/org/picketlink/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java
idm/trunk/picketlink-idm-ldap/pom.xml
idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/LDAPIdentityStoreImpl.java
idm/trunk/picketlink-idm-spi/pom.xml
idm/trunk/picketlink-idm-testsuite/pom.xml
idm/trunk/picketlink-idm-testsuite/src/test/java/org/picketlink/idm/impl/api/UserQueryTest.java
idm/trunk/pom.xml
Log:
- fix bug related to search by attribute values
- prepare for 1.1.0.Beta6
Modified: idm/trunk/assembly/pom.xml
===================================================================
--- idm/trunk/assembly/pom.xml 2010-03-03 08:05:08 UTC (rev 154)
+++ idm/trunk/assembly/pom.xml 2010-03-03 16:07:19 UTC (rev 155)
@@ -4,14 +4,14 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.picketlink.idm</groupId>
<artifactId>picketlink-idm</artifactId>
- <version>1.1.0.Beta5</version>
+ <version>1.1.0.Beta6</version>
<packaging>pom</packaging>
<name>PicketLink IDM Assembly </name>
<parent>
<groupId>org.picketlink.idm</groupId>
<artifactId>picketlink-idm-parent</artifactId>
- <version>1.1.0.Beta5</version>
+ <version>1.1.0.Beta6</version>
<relativePath>../parent</relativePath>
</parent>
Modified: idm/trunk/example/auth/pom.xml
===================================================================
--- idm/trunk/example/auth/pom.xml 2010-03-03 08:05:08 UTC (rev 154)
+++ idm/trunk/example/auth/pom.xml 2010-03-03 16:07:19 UTC (rev 155)
@@ -1,7 +1,7 @@
<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.picketlink.idm.example</groupId>
- <version>1.1.0.Beta5</version>
+ <version>1.1.0.Beta6</version>
<artifactId>example-auth</artifactId>
<packaging>jar</packaging>
<name>Example - JEE authentication</name>
Modified: idm/trunk/example/auth-simple/pom.xml
===================================================================
--- idm/trunk/example/auth-simple/pom.xml 2010-03-03 08:05:08 UTC (rev 154)
+++ idm/trunk/example/auth-simple/pom.xml 2010-03-03 16:07:19 UTC (rev 155)
@@ -1,7 +1,7 @@
<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.picketlink.idm.example</groupId>
- <version>1.1.0.Beta5</version>
+ <version>1.1.0.Beta6</version>
<artifactId>example-auth-simple</artifactId>
<packaging>jar</packaging>
<name>Example - JEE authentication (using deployer)</name>
Modified: idm/trunk/example/simple/pom.xml
===================================================================
--- idm/trunk/example/simple/pom.xml 2010-03-03 08:05:08 UTC (rev 154)
+++ idm/trunk/example/simple/pom.xml 2010-03-03 16:07:19 UTC (rev 155)
@@ -1,7 +1,7 @@
<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.picketlink.idm.example</groupId>
- <version>1.1.0.Beta5</version>
+ <version>1.1.0.Beta6</version>
<artifactId>example-simple</artifactId>
<packaging>jar</packaging>
<name>Example - Simple PicketLink IDM Maven2 project</name>
Modified: idm/trunk/integration/deployer/pom.xml
===================================================================
--- idm/trunk/integration/deployer/pom.xml 2010-03-03 08:05:08 UTC (rev 154)
+++ idm/trunk/integration/deployer/pom.xml 2010-03-03 16:07:19 UTC (rev 155)
@@ -8,12 +8,12 @@
<groupId>org.picketlink.idm.integration</groupId>
<artifactId>picketlink-idm-jboss5-deployer</artifactId>
<packaging>jar</packaging>
- <version>1.1.0.Beta5</version>
+ <version>1.1.0.Beta6</version>
<parent>
<groupId>org.picketlink.idm</groupId>
<artifactId>picketlink-idm-integration</artifactId>
- <version>1.1.0.Beta5</version>
+ <version>1.1.0.Beta6</version>
</parent>
<properties>
Modified: idm/trunk/integration/jboss5/pom.xml
===================================================================
--- idm/trunk/integration/jboss5/pom.xml 2010-03-03 08:05:08 UTC (rev 154)
+++ idm/trunk/integration/jboss5/pom.xml 2010-03-03 16:07:19 UTC (rev 155)
@@ -8,12 +8,12 @@
<groupId>org.picketlink.idm.integration</groupId>
<artifactId>picketlink-idm-jboss5</artifactId>
<packaging>jar</packaging>
- <version>1.1.0.Beta5</version>
+ <version>1.1.0.Beta6</version>
<parent>
<groupId>org.picketlink.idm</groupId>
<artifactId>picketlink-idm-integration</artifactId>
- <version>1.1.0.Beta5</version>
+ <version>1.1.0.Beta6</version>
</parent>
<dependencies>
Modified: idm/trunk/integration/pom.xml
===================================================================
--- idm/trunk/integration/pom.xml 2010-03-03 08:05:08 UTC (rev 154)
+++ idm/trunk/integration/pom.xml 2010-03-03 16:07:19 UTC (rev 155)
@@ -13,7 +13,7 @@
<parent>
<groupId>org.picketlink.idm</groupId>
<artifactId>picketlink-idm-parent</artifactId>
- <version>1.1.0.Beta5</version>
+ <version>1.1.0.Beta6</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: idm/trunk/parent/pom.xml
===================================================================
--- idm/trunk/parent/pom.xml 2010-03-03 08:05:08 UTC (rev 154)
+++ idm/trunk/parent/pom.xml 2010-03-03 16:07:19 UTC (rev 155)
@@ -8,7 +8,7 @@
<groupId>org.picketlink.idm</groupId>
<artifactId>picketlink-idm-parent</artifactId>
<packaging>pom</packaging>
- <version>1.1.0.Beta5</version>
+ <version>1.1.0.Beta6</version>
<name>PicketLink IDM- Parent</name>
<url>http://labs.jboss.org/portal/jbosssecurity/</url>
<description>PicketLink is a cross-cutting project that handles identity needs for the JEMS projects</description>
Modified: idm/trunk/picketlink-idm-api/pom.xml
===================================================================
--- idm/trunk/picketlink-idm-api/pom.xml 2010-03-03 08:05:08 UTC (rev 154)
+++ idm/trunk/picketlink-idm-api/pom.xml 2010-03-03 16:07:19 UTC (rev 155)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.picketlink.idm</groupId>
<artifactId>picketlink-idm-parent</artifactId>
- <version>1.1.0.Beta5</version>
+ <version>1.1.0.Beta6</version>
<relativePath>../parent</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: idm/trunk/picketlink-idm-auth/pom.xml
===================================================================
--- idm/trunk/picketlink-idm-auth/pom.xml 2010-03-03 08:05:08 UTC (rev 154)
+++ idm/trunk/picketlink-idm-auth/pom.xml 2010-03-03 16:07:19 UTC (rev 155)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.picketlink.idm</groupId>
<artifactId>picketlink-idm-parent</artifactId>
- <version>1.1.0.Beta5</version>
+ <version>1.1.0.Beta6</version>
<relativePath>../parent</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: idm/trunk/picketlink-idm-cache/pom.xml
===================================================================
--- idm/trunk/picketlink-idm-cache/pom.xml 2010-03-03 08:05:08 UTC (rev 154)
+++ idm/trunk/picketlink-idm-cache/pom.xml 2010-03-03 16:07:19 UTC (rev 155)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.picketlink.idm</groupId>
<artifactId>picketlink-idm-parent</artifactId>
- <version>1.1.0.Beta5</version>
+ <version>1.1.0.Beta6</version>
<relativePath>../parent</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: idm/trunk/picketlink-idm-common/pom.xml
===================================================================
--- idm/trunk/picketlink-idm-common/pom.xml 2010-03-03 08:05:08 UTC (rev 154)
+++ idm/trunk/picketlink-idm-common/pom.xml 2010-03-03 16:07:19 UTC (rev 155)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.picketlink.idm</groupId>
<artifactId>picketlink-idm-parent</artifactId>
- <version>1.1.0.Beta5</version>
+ <version>1.1.0.Beta6</version>
<relativePath>../parent</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: idm/trunk/picketlink-idm-core/pom.xml
===================================================================
--- idm/trunk/picketlink-idm-core/pom.xml 2010-03-03 08:05:08 UTC (rev 154)
+++ idm/trunk/picketlink-idm-core/pom.xml 2010-03-03 16:07:19 UTC (rev 155)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.picketlink.idm</groupId>
<artifactId>picketlink-idm-parent</artifactId>
- <version>1.1.0.Beta5</version>
+ <version>1.1.0.Beta6</version>
<relativePath>../parent</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: idm/trunk/picketlink-idm-docs/ReferenceGuide/pom.xml
===================================================================
--- idm/trunk/picketlink-idm-docs/ReferenceGuide/pom.xml 2010-03-03 08:05:08 UTC (rev 154)
+++ idm/trunk/picketlink-idm-docs/ReferenceGuide/pom.xml 2010-03-03 16:07:19 UTC (rev 155)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.picketlink.idm</groupId>
<artifactId>picketlink-idm-parent</artifactId>
- <version>1.1.0.Beta5</version>
+ <version>1.1.0.Beta6</version>
<relativePath>../../parent</relativePath>
</parent>
Modified: idm/trunk/picketlink-idm-docs/pom.xml
===================================================================
--- idm/trunk/picketlink-idm-docs/pom.xml 2010-03-03 08:05:08 UTC (rev 154)
+++ idm/trunk/picketlink-idm-docs/pom.xml 2010-03-03 16:07:19 UTC (rev 155)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.picketlink.idm</groupId>
<artifactId>picketlink-idm-parent</artifactId>
- <version>1.1.0.Beta5</version>
+ <version>1.1.0.Beta6</version>
<relativePath>../parent</relativePath>
</parent>
Modified: idm/trunk/picketlink-idm-hibernate/pom.xml
===================================================================
--- idm/trunk/picketlink-idm-hibernate/pom.xml 2010-03-03 08:05:08 UTC (rev 154)
+++ idm/trunk/picketlink-idm-hibernate/pom.xml 2010-03-03 16:07:19 UTC (rev 155)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.picketlink.idm</groupId>
<artifactId>picketlink-idm-parent</artifactId>
- <version>1.1.0.Beta5</version>
+ <version>1.1.0.Beta6</version>
<relativePath>../parent</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: idm/trunk/picketlink-idm-hibernate/src/main/java/org/picketlink/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java
===================================================================
--- idm/trunk/picketlink-idm-hibernate/src/main/java/org/picketlink/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java 2010-03-03 08:05:08 UTC (rev 154)
+++ idm/trunk/picketlink-idm-hibernate/src/main/java/org/picketlink/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java 2010-03-03 16:07:19 UTC (rev 155)
@@ -23,6 +23,7 @@
package org.picketlink.idm.impl.store.hibernate;
import org.picketlink.idm.common.exception.IdentityException;
+import org.picketlink.idm.impl.helper.Tools;
import org.picketlink.idm.impl.model.hibernate.*;
import org.picketlink.idm.impl.store.FeaturesMetaDataImpl;
import org.picketlink.idm.spi.configuration.IdentityStoreConfigurationContext;
@@ -678,7 +679,7 @@
}
}
- if (criteria != null && criteria.isPaged())
+ if (criteria != null && criteria.isPaged() && !criteria.isFiltered())
{
if (criteria.getMaxResults() > 0)
{
@@ -711,6 +712,10 @@
if (criteria != null && criteria.isFiltered())
{
filterByAttributesValues(results, criteria.getValues());
+ if (criteria.isPaged())
+ {
+ results = (LinkedList)cutPageFromResults(results, criteria);
+ }
}
return results;
@@ -821,7 +826,7 @@
}
- if (criteria != null && criteria.isPaged())
+ if (criteria != null && criteria.isPaged() && !criteria.isFiltered())
{
q.setFirstResult(criteria.getFirstResult());
if (criteria.getMaxResults() > 0)
@@ -845,6 +850,10 @@
if (criteria != null && criteria.isFiltered())
{
filterByAttributesValues(results, criteria.getValues());
+ if (criteria.isPaged())
+ {
+ results = (LinkedList)cutPageFromResults(results, criteria);
+ }
}
return results;
@@ -2696,15 +2705,45 @@
Map<String, Collection> presentAttrs = ((HibernateIdentityObject)object).getAttributesAsMap();
for (Map.Entry<String, String[]> entry : attrs.entrySet())
{
- if (presentAttrs.containsKey(entry.getKey()))
+ // Resolve attribute name from the store attribute mapping
+ String mappedAttributeName = null;
+ try
{
+ mappedAttributeName = resolveAttributeStoreMapping(object.getIdentityType(), entry.getKey());
+ }
+ catch (IdentityException e)
+ {
+ //Nothing
+ }
+
+ if (mappedAttributeName == null)
+ {
+ toRemove.add(object);
+ break;
+ }
+
+ if (presentAttrs.containsKey(mappedAttributeName))
+ {
Set<String> given = new HashSet<String>(Arrays.asList(entry.getValue()));
- Collection present = presentAttrs.get(entry.getKey());
+ Collection present = presentAttrs.get(mappedAttributeName);
+
for (String s : given)
{
- if (!present.contains(s))
+ String regex = Tools.wildcardToRegex(s);
+
+ boolean matches = false;
+
+ for (Object o : present)
{
+ if (o.toString().matches(regex))
+ {
+ matches = true;
+ }
+ }
+
+ if (!matches)
+ {
toRemove.add(object);
break;
}
@@ -2726,6 +2765,35 @@
}
}
+ //TODO: need to be implemented at HQL level
+ private <T> List<T> cutPageFromResults(List<T> objects, IdentityObjectSearchCriteria criteria)
+ {
+
+ List<T> results = new LinkedList<T>();
+
+ if (criteria.getMaxResults() == 0)
+ {
+ for (int i = criteria.getFirstResult(); i < objects.size(); i++)
+ {
+ if (i < objects.size())
+ {
+ results.add(objects.get(i));
+ }
+ }
+ }
+ else
+ {
+ for (int i = criteria.getFirstResult(); i < criteria.getFirstResult() + criteria.getMaxResults(); i++)
+ {
+ if (i < objects.size())
+ {
+ results.add(objects.get(i));
+ }
+ }
+ }
+ return results;
+ }
+
protected boolean isAllowNotDefinedIdentityObjectTypes()
{
return isAllowNotDefinedIdentityObjectTypes;
Modified: idm/trunk/picketlink-idm-ldap/pom.xml
===================================================================
--- idm/trunk/picketlink-idm-ldap/pom.xml 2010-03-03 08:05:08 UTC (rev 154)
+++ idm/trunk/picketlink-idm-ldap/pom.xml 2010-03-03 16:07:19 UTC (rev 155)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.picketlink.idm</groupId>
<artifactId>picketlink-idm-parent</artifactId>
- <version>1.1.0.Beta5</version>
+ <version>1.1.0.Beta6</version>
<relativePath>../parent</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/LDAPIdentityStoreImpl.java
===================================================================
--- idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/LDAPIdentityStoreImpl.java 2010-03-03 08:05:08 UTC (rev 154)
+++ idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/LDAPIdentityStoreImpl.java 2010-03-03 16:07:19 UTC (rev 155)
@@ -678,8 +678,15 @@
{
for (String value : stringEntry.getValue())
{
+ String attributeName = getTypeConfiguration(invocationCtx, type).getAttributeMapping(stringEntry.getKey());
+
+ if (attributeName == null)
+ {
+ attributeName = stringEntry.getKey();
+ }
+
af.append("(")
- .append(stringEntry.getKey())
+ .append(attributeName)
.append("=")
.append(value)
.append(")");
Modified: idm/trunk/picketlink-idm-spi/pom.xml
===================================================================
--- idm/trunk/picketlink-idm-spi/pom.xml 2010-03-03 08:05:08 UTC (rev 154)
+++ idm/trunk/picketlink-idm-spi/pom.xml 2010-03-03 16:07:19 UTC (rev 155)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.picketlink.idm</groupId>
<artifactId>picketlink-idm-parent</artifactId>
- <version>1.1.0.Beta5</version>
+ <version>1.1.0.Beta6</version>
<relativePath>../parent</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: idm/trunk/picketlink-idm-testsuite/pom.xml
===================================================================
--- idm/trunk/picketlink-idm-testsuite/pom.xml 2010-03-03 08:05:08 UTC (rev 154)
+++ idm/trunk/picketlink-idm-testsuite/pom.xml 2010-03-03 16:07:19 UTC (rev 155)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.picketlink.idm</groupId>
<artifactId>picketlink-idm-parent</artifactId>
- <version>1.1.0.Beta5</version>
+ <version>1.1.0.Beta6</version>
<relativePath>../parent</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: idm/trunk/picketlink-idm-testsuite/src/test/java/org/picketlink/idm/impl/api/UserQueryTest.java
===================================================================
--- idm/trunk/picketlink-idm-testsuite/src/test/java/org/picketlink/idm/impl/api/UserQueryTest.java 2010-03-03 08:05:08 UTC (rev 154)
+++ idm/trunk/picketlink-idm-testsuite/src/test/java/org/picketlink/idm/impl/api/UserQueryTest.java 2010-03-03 16:07:19 UTC (rev 155)
@@ -208,8 +208,25 @@
assertEquals(user2, results.get(0));
assertEquals(user3, results.get(1));
+ ids.getAttributesManager().addAttribute(user4, "lastName", "gtn");
+ ids.getAttributesManager().addAttribute(user3, "email", "user3 at localhost");
+ //
+ qb.reset();
+ qb.attributeValuesFilter("lastName", new String[] {"*gtn*"});
+ results = ids.list(qb.createQuery());
+ assertEquals(1, results.size());
+ assertEquals(user4, results.get(0));
+ //
+ qb.reset();
+ qb.attributeValuesFilter("email", new String[] {"*user3*"});
+ results = ids.list(qb.createQuery());
+ assertEquals(1, results.size());
+ assertEquals(user3, results.get(0));
+
+
+
ctx.commit();
}
Modified: idm/trunk/pom.xml
===================================================================
--- idm/trunk/pom.xml 2010-03-03 08:05:08 UTC (rev 154)
+++ idm/trunk/pom.xml 2010-03-03 16:07:19 UTC (rev 155)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.picketlink.idm</groupId>
<artifactId>picketlink-idm-parent</artifactId>
- <version>1.1.0.Beta5</version>
+ <version>1.1.0.Beta6</version>
<relativePath>parent</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
More information about the jboss-cvs-commits
mailing list