Author: mputz
Date: 2015-01-09 05:52:38 -0500 (Fri, 09 Jan 2015)
New Revision: 9332
Modified:
epp/portal/branches/EPP_5_2_2_GA_BZ1180232/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java
Log:
Backport fixes related to GTNPORTAL-3572
Modified:
epp/portal/branches/EPP_5_2_2_GA_BZ1180232/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java
===================================================================
---
epp/portal/branches/EPP_5_2_2_GA_BZ1180232/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java 2015-01-09
10:45:42 UTC (rev 9331)
+++
epp/portal/branches/EPP_5_2_2_GA_BZ1180232/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java 2015-01-09
10:52:38 UTC (rev 9332)
@@ -157,9 +157,14 @@
if (isCreateMembership(mt.getName()))
{
- if (getIdentitySession().getRoleManager().getRoleType(mt.getName()) == null)
- {
- getIdentitySession().getRoleManager().createRoleType(mt.getName());
+ if (getIdentitySession().getRoleManager().getRoleType(mt.getName()) == null) {
+ try {
+ getIdentitySession().getRoleManager().createRoleType(mt.getName());
+ } catch (Exception e) {
+ // TODO:
+ handleException("Identity operation error: ", e);
+
+ }
}
@@ -184,8 +189,14 @@
preSave(membership, true);
}
- getIdentitySession().getRoleManager().createRole(mt.getName(), user.getUserName(),
groupId);
+ try {
+ getIdentitySession().getRoleManager().createRole(mt.getName(),
user.getUserName(), groupId);
+ } catch (Exception e) {
+ // TODO:
+ handleException("Identity operation error: ", e);
+ }
+
if (broadcast)
{
postSave(membership, true);
@@ -421,8 +432,14 @@
preDelete(m);
}
- getIdentitySession().getRoleManager().removeRole(role);
+ try {
+ getIdentitySession().getRoleManager().removeRole(role);
+ } catch (Exception e) {
+ // TODO:
+ handleException("Identity operation error: ", e);
+ }
+
if (broadcast)
{
postDelete(m);
@@ -770,8 +787,16 @@
public ListAccess<Membership> findAllMembershipsByUser(User user) throws
Exception
{
- org.picketlink.idm.api.User gtnUser =
service_.getIdentitySession().getPersistenceManager().findUser(user.getUserName());
-
+ org.picketlink.idm.api.User gtnUser = null;
+ try {
+ gtnUser = service_.getIdentitySession().getPersistenceManager()
+ .findUser(user.getUserName());
+ } catch (Exception e) {
+ // TODO:
+ handleException("Identity operation error: ", e);
+
+ }
+
if (gtnUser == null)
{
log.log(LogLevel.ERROR, "Internal ERROR. Cannot obtain user: " +
user.getUserName());
Show replies by date