summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-12-28 02:46:54 (EST)
committerStephan Born2013-01-25 12:39:53 (EST)
commit56acdc3d23f5fd2ab60789fd0052ffcdd5b4db3b (patch)
treed414d1961ec7c3e30ae480adfb2be0c7840375f7
parent40e371537d145ef50a93798aecc5c170af5b24a0 (diff)
downloadorg.eclipse.stardust.ui.web-56acdc3d23f5fd2ab60789fd0052ffcdd5b4db3b.zip
org.eclipse.stardust.ui.web-56acdc3d23f5fd2ab60789fd0052ffcdd5b4db3b.tar.gz
org.eclipse.stardust.ui.web-56acdc3d23f5fd2ab60789fd0052ffcdd5b4db3b.tar.bz2
Jira-ID: CRNT-27256
Added a try/catch while assigning user to UserGroup in ParticipantUserObject createUser() git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@61713 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/participantManagement/ParticipantUserObject.java66
1 files changed, 40 insertions, 26 deletions
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/participantManagement/ParticipantUserObject.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/participantManagement/ParticipantUserObject.java
index c738f84..1f78848 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/participantManagement/ParticipantUserObject.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/participantManagement/ParticipantUserObject.java
@@ -25,11 +25,13 @@ import org.eclipse.stardust.engine.api.model.QualifiedModelParticipantInfo;
import org.eclipse.stardust.engine.api.model.QualifiedOrganizationInfo;
import org.eclipse.stardust.engine.api.model.RoleInfo;
import org.eclipse.stardust.engine.api.runtime.Department;
+import org.eclipse.stardust.engine.api.runtime.IllegalOperationException;
import org.eclipse.stardust.engine.api.runtime.User;
import org.eclipse.stardust.engine.api.runtime.UserGroup;
import org.eclipse.stardust.ui.web.viewscommon.dialogs.ICallbackHandler;
import org.eclipse.stardust.ui.web.viewscommon.messages.MessagesViewsCommonBean;
import org.eclipse.stardust.ui.web.viewscommon.user.UserProfileBean;
+import org.eclipse.stardust.ui.web.viewscommon.utils.ExceptionHandler;
import org.eclipse.stardust.ui.web.viewscommon.utils.I18nUtils;
import org.eclipse.stardust.ui.web.viewscommon.utils.ParticipantItem;
import org.eclipse.stardust.ui.web.viewscommon.utils.ParticipantUtils;
@@ -190,38 +192,50 @@ public class ParticipantUserObject extends IceUserObject
User newUser = userProfileBean.getUser();
if (null != newUser)
{
- switch (nodeType)
+ try
{
- case ORGANIZATION_UNSCOPED:
- case ORGANIZATON_SCOPED_IMPLICIT:
- case DEPARTMENT_DEFAULT:
- case ROLE_UNSCOPED:
- case ROLE_SCOPED:
- {
- newUser.addGrant(getQualifiedModelParticipantInfo());
- break;
- }
- case USERGROUP:
- {
- newUser.joinGroup(getDynamicParticipantInfo().getId());
- break;
+ switch (nodeType)
+ {
+ case ORGANIZATION_UNSCOPED:
+ case ORGANIZATON_SCOPED_IMPLICIT:
+ case DEPARTMENT_DEFAULT:
+ case ROLE_UNSCOPED:
+ case ROLE_SCOPED:
+ {
+ newUser.addGrant(getQualifiedModelParticipantInfo());
+ break;
+ }
+ case USERGROUP:
+ {
+ newUser.joinGroup(getDynamicParticipantInfo().getId());
+ break;
+
+ }
+ case DEPARTMENT:
+ {
+ Department department = getDepartment();
+ QualifiedModelParticipantInfo qualifiedParticipantInfo = department
+ .getScopedParticipant(department.getOrganization());
+ newUser.addGrant(qualifiedParticipantInfo);
+ break;
+ }
+ }
+ ServiceFactoryUtils.getUserService().modifyUser(newUser);
+
+ if (null != refreshUserTableCallback)
+ {
+ refreshUserTableCallback.handleEvent(ICallbackHandler.EventType.APPLY);
+ }
+ refreshParticipantTree();
}
- case DEPARTMENT:
+ catch (IllegalOperationException e)
{
- Department department = getDepartment();
- QualifiedModelParticipantInfo qualifiedParticipantInfo = department.getScopedParticipant(department
- .getOrganization());
- newUser.addGrant(qualifiedParticipantInfo);
- break;
+ ExceptionHandler.handleException(e);
}
- }
- ServiceFactoryUtils.getUserService().modifyUser(newUser);
-
- if (null != refreshUserTableCallback)
+ catch (Exception e)
{
- refreshUserTableCallback.handleEvent(ICallbackHandler.EventType.APPLY);
+ ExceptionHandler.handleException(e);
}
- refreshParticipantTree();
}
}
});