Author: liem_nguyen
Date: 2009-12-23 03:21:05 -0500 (Wed, 23 Dec 2009)
New Revision: 1137
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListMembershipType.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIMembershipTypeForm.java
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
Log:
GTNPORTAL-416 Unknown error when edit User/membership in special case
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java 2009-12-23
07:18:51 UTC (rev 1136)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java 2009-12-23
08:21:05 UTC (rev 1137)
@@ -106,6 +106,10 @@
UIApplication uiApp = context.getUIApplication();
String username = getUIStringInput(USERNAME).getValue();
User user = service.getUserHandler().findUserByName(username);
+ if (user==null) {
+ uiApp.addMessage(new
ApplicationMessage("UIAccountInputSet.msg.user-is-deleted", null));
+ return false;
+ }
invokeSetBindingField(user);
if (isChangePassword())
{
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListMembershipType.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListMembershipType.java 2009-12-23
07:18:51 UTC (rev 1136)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListMembershipType.java 2009-12-23
08:21:05 UTC (rev 1137)
@@ -97,6 +97,12 @@
UIMembershipManagement uiMembershipManager = uiMembership.getParent();
UIMembershipTypeForm uiForm =
uiMembershipManager.getChild(UIMembershipTypeForm.class);
uiForm.setMembershipType(mt);
+ if (mt == null)
+ {
+ UIApplication uiApp = event.getRequestContext().getUIApplication();
+ uiApp.addMessage(new
ApplicationMessage("UIMembershipTypeForm.msg.MembershipNotExist", new
String[]{name}));
+ uiMembership.loadData();
+ }
}
}
@@ -116,11 +122,12 @@
uiApp.addMessage(new
ApplicationMessage("UIMembershipList.msg.InUse", null));
return;
}
-
+
// Check to see whether given membershiptype is mandatory or not
UserACL acl = uiMembership.getApplicationComponent(UserACL.class);
List<String> mandatories = acl.getMandatoryMSTypes();
- if(!mandatories.isEmpty() && mandatories.contains(name)){
+ if (!mandatories.isEmpty() && mandatories.contains(name))
+ {
UIApplication uiApp = event.getRequestContext().getUIApplication();
uiApp.addMessage(new
ApplicationMessage("UIMembershipList.msg.DeleteMandatory", null));
return;
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIMembershipTypeForm.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIMembershipTypeForm.java 2009-12-23
07:18:51 UTC (rev 1136)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIMembershipTypeForm.java 2009-12-23
08:21:05 UTC (rev 1137)
@@ -85,8 +85,18 @@
if (mt != null)
{
- uiForm.invokeSetBindingBean(mt);
- service.getMembershipTypeHandler().saveMembershipType(mt, true);
+ MembershipType existMembershipType =
service.getMembershipTypeHandler().findMembershipType(mt.getName());
+ if (existMembershipType == null)
+ {
+ UIApplication uiApp = event.getRequestContext().getUIApplication();
+ uiApp.addMessage(new
ApplicationMessage("UIMembershipTypeForm.msg.MembershipNotExist", new
String[]{mt
+ .getName()}));
+ }
+ else
+ {
+ uiForm.invokeSetBindingBean(mt);
+ service.getMembershipTypeHandler().saveMembershipType(mt, true);
+ }
}
else
{
Modified:
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties 2009-12-23
07:18:51 UTC (rev 1136)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties 2009-12-23
08:21:05 UTC (rev 1137)
@@ -31,6 +31,7 @@
UIMembershipTypeForm.action.Back=#{word.back}
UIMembershipTypeForm.action.Reset=Reset
UIMembershipTypeForm.msg.SameName=This membership already exists, please enter another
one
+UIMembershipTypeForm.msg.MembershipNotExist= Membership [{0}] is not exist or has been
deleted.
##org.exoplatform.organization.webui.component.UIGroupMembershipForm
UIGroupEditMembershipForm.label.username=User Name
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2009-12-23
07:18:51 UTC (rev 1136)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2009-12-23
08:21:05 UTC (rev 1137)
@@ -220,6 +220,7 @@
UIAccountForm.msg.password-is-not-match=Password and Confirm Password must be the same.
UIAccountInputSet.msg.user-exist=This user name already exists, please enter a different
name.
UIAccountInputSet.msg.user-not-exist=This user name is still available.
+UIAccountInputSet.msg.user-is-deleted=This user may be deleted.
UIAccountInputSet.msg.email-exist=This email already exists, please enter a different
address.
UIAccountInputSet.msg.empty-input=The user name cannot be empty.
UIAccountInputSet.msg.successful.create.user=You have registered a new account.