Author: bdaw
Date: 2011-09-12 07:57:34 -0400 (Mon, 12 Sep 2011)
New Revision: 7356
Modified:
portal/trunk/component/identity/pom.xml
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserProfileDAOImpl.java
portal/trunk/pom.xml
Log:
GTNPORTAL-2089 - Align Impl with the new Organization Service API improvements
GTNPORTAL-2092 - Upgrade to JCR 1.14.0-GA
GTNPORTAL-1824 - We should implement all Unsupported method in UserHandler interface
Modified: portal/trunk/component/identity/pom.xml
===================================================================
--- portal/trunk/component/identity/pom.xml 2011-09-12 10:54:34 UTC (rev 7355)
+++ portal/trunk/component/identity/pom.xml 2011-09-12 11:57:34 UTC (rev 7356)
@@ -53,6 +53,11 @@
</dependency>
<dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.common</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.gatein.common</groupId>
<artifactId>common-logging</artifactId>
</dependency>
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java
===================================================================
---
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java 2011-09-12
10:54:34 UTC (rev 7355)
+++
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java 2011-09-12
11:57:34 UTC (rev 7356)
@@ -74,6 +74,11 @@
listeners_.add(listener);
}
+ public void removeGroupEventListener(GroupEventListener listener)
+ {
+ listeners_.remove(listener);
+ }
+
final public Group createGroupInstance()
{
if (log.isTraceEnabled())
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java
===================================================================
---
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java 2011-09-12
10:54:34 UTC (rev 7355)
+++
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java 2011-09-12
11:57:34 UTC (rev 7356)
@@ -19,7 +19,9 @@
package org.exoplatform.services.organization.idm;
+import org.exoplatform.commons.utils.ListAccess;
import org.exoplatform.commons.utils.ListenerStack;
+import org.exoplatform.commons.utils.ListAccessImpl;
import org.exoplatform.services.organization.Group;
import org.exoplatform.services.organization.Membership;
import org.exoplatform.services.organization.MembershipEventListener;
@@ -68,6 +70,11 @@
listeners_.add(listener);
}
+ public void removeMembershipEventListener(MembershipEventListener listener)
+ {
+ listeners_.remove(listener);
+ }
+
final public Membership createMembershipInstance()
{
return new MembershipImpl();
@@ -749,11 +756,17 @@
return result;
}
+
public Collection findMembershipsByGroup(Group group) throws Exception
{
return findMembershipsByGroupId(group.getId());
}
+ public ListAccess<Membership> findAllMembershipsByGroup(Group group) throws
Exception
+ {
+ return new ListAccessImpl(Membership.class, (List)findMembershipsByGroup(group));
+ }
+
public Collection findMembershipsByGroupId(String groupId) throws Exception
{
if (log.isTraceEnabled())
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
===================================================================
---
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java 2011-09-12
10:54:34 UTC (rev 7355)
+++
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java 2011-09-12
11:57:34 UTC (rev 7356)
@@ -110,6 +110,11 @@
listeners_.add(listener);
}
+ public void removeUserEventListener(UserEventListener listener)
+ {
+ listeners_.remove(listener);
+ }
+
public User createUserInstance()
{
return new UserImpl();
@@ -329,7 +334,19 @@
public ListAccess<User> findAllUsers() throws Exception
{
- throw new UnsupportedOperationException();
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "findAllUsers",
+ null
+ );
+ }
+
+ UserQueryBuilder qb = service_.getIdentitySession().createUserQueryBuilder();
+
+ return new IDMUserListAccess(this, service_, qb, 20, true);
}
//
@@ -422,6 +439,27 @@
);
}
+ ListAccess list = findUsersByQuery(q);
+
+ return new LazyPageList(list, 20);
+ }
+
+ //
+
+ public ListAccess<User> findUsersByQuery(Query q) throws Exception
+ {
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "findUsersByQuery",
+ new Object[]{
+ "q", q
+ }
+ );
+ }
+
// if only condition is email which is unique then delegate to other method as it
will be more efficient
if (q.getUserName() == null &&
q.getEmail() != null &&
@@ -432,7 +470,7 @@
if (uniqueUser != null)
{
- return new LazyPageList<User>( new ListAccess<User>()
+ return new ListAccess<User>()
{
public User[] load(int index, int length) throws Exception,
IllegalArgumentException
{
@@ -443,7 +481,7 @@
{
return 1;
}
- }, 1);
+ };
}
}
@@ -459,7 +497,7 @@
list = cache.getGtnUserLazyPageList(getCacheNS(), q);
if (list != null)
{
- return new LazyPageList(list, 20);
+ return list;
}
}
@@ -506,16 +544,9 @@
cache.putGtnUserLazyPageList(getCacheNS(), q, list);
}
- return new LazyPageList(list, 20);
+ return list;
}
- //
-
- public ListAccess<User> findUsersByQuery(Query query) throws Exception
- {
- throw new UnsupportedOperationException();
- }
-
public LazyPageList findUsersByGroup(String groupId) throws Exception
{
if (log.isTraceEnabled())
@@ -530,23 +561,7 @@
);
}
-
- UserQueryBuilder qb = service_.getIdentitySession().createUserQueryBuilder();
-
- org.picketlink.idm.api.Group jbidGroup = null;
- try
- {
- jbidGroup = orgService.getJBIDMGroup(groupId);
- }
- catch (Exception e)
- {
- log.info("Cannot obtain group: " + groupId + "; ", e);
-
- }
-
- qb.addRelatedGroup(jbidGroup);
-
- return new LazyPageList(new IDMUserListAccess(this, service_, qb, 20, false), 20);
+ return new LazyPageList(findUsersByGroupId(groupId), 20);
}
public User findUserByEmail(String email) throws Exception
@@ -604,7 +619,35 @@
public ListAccess<User> findUsersByGroupId(String groupId) throws Exception
{
- throw new UnsupportedOperationException();
+ if (log.isTraceEnabled())
+ {
+ Tools.logMethodIn(
+ log,
+ LogLevel.TRACE,
+ "findUsersByGroupId",
+ new Object[]{
+ "groupId", groupId
+ }
+ );
+ }
+
+
+ UserQueryBuilder qb = service_.getIdentitySession().createUserQueryBuilder();
+
+ org.picketlink.idm.api.Group jbidGroup = null;
+ try
+ {
+ jbidGroup = orgService.getJBIDMGroup(groupId);
+ }
+ catch (Exception e)
+ {
+ log.info("Cannot obtain group: " + groupId + "; ", e);
+
+ }
+
+ qb.addRelatedGroup(jbidGroup);
+
+ return new IDMUserListAccess(this, service_, qb, 20, false);
}
//
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserProfileDAOImpl.java
===================================================================
---
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserProfileDAOImpl.java 2011-09-12
10:54:34 UTC (rev 7355)
+++
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserProfileDAOImpl.java 2011-09-12
11:57:34 UTC (rev 7356)
@@ -69,6 +69,11 @@
listeners_.add(listener);
}
+ public void removeUserProfileEventListener(UserProfileEventListener listener)
+ {
+ listeners_.remove(listener);
+ }
+
final public UserProfile createUserProfileInstance()
{
return new UserProfileImpl();
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2011-09-12 10:54:34 UTC (rev 7355)
+++ portal/trunk/pom.xml 2011-09-12 11:57:34 UTC (rev 7356)
@@ -37,10 +37,10 @@
<name>GateIn - Portal</name>
<properties>
-
<org.exoplatform.kernel.version>2.3.0-CR4-CP01</org.exoplatform.kernel.version>
- <org.exoplatform.core.version>2.4.0-CR4</org.exoplatform.core.version>
- <org.exoplatform.ws.version>2.2.0-CR4</org.exoplatform.ws.version>
-
<org.exoplatform.jcr.version>1.14.0-CR4-CP01</org.exoplatform.jcr.version>
+
<org.exoplatform.kernel.version>2.3.0-GA</org.exoplatform.kernel.version>
+ <org.exoplatform.core.version>2.4.0-GA</org.exoplatform.core.version>
+ <org.exoplatform.ws.version>2.2.0-GA</org.exoplatform.ws.version>
+ <org.exoplatform.jcr.version>1.14.0-GA</org.exoplatform.jcr.version>
<org.shindig.version>2.0.2-Beta02</org.shindig.version>
<nl.captcha.simplecaptcha.version>1.1.1-GA-Patch01</nl.captcha.simplecaptcha.version>
<org.gatein.common.version>2.0.4-Beta03</org.gatein.common.version>