Author: kien_nguyen
Date: 2010-04-21 03:54:02 -0400 (Wed, 21 Apr 2010)
New Revision: 2717
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java
Log:
GTNPORTAL-818 InvocationTargetException when edit infor of user which was deleted
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java 2010-04-21
07:03:20 UTC (rev 2716)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java 2010-04-21
07:54:02 UTC (rev 2717)
@@ -41,6 +41,8 @@
import org.exoplatform.portal.webui.util.Util;
import org.exoplatform.portal.webui.workspace.UIMaskWorkspace;
import org.exoplatform.portal.webui.workspace.UIPortalApplication;
+import org.exoplatform.services.organization.OrganizationService;
+import org.exoplatform.services.organization.User;
import org.exoplatform.services.resources.ResourceBundleManager;
import org.exoplatform.web.login.InitiateLoginServlet;
import org.exoplatform.web.security.security.AbstractTokenService;
@@ -51,6 +53,7 @@
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
+import org.exoplatform.web.application.JavascriptManager;
import java.net.URLEncoder;
import java.util.ArrayList;
@@ -488,10 +491,28 @@
UIPortalApplication uiApp =
uiPortal.getAncestorOfType(UIPortalApplication.class);
UIMaskWorkspace uiMaskWS =
uiApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
- UIAccountSetting uiAccountForm =
uiMaskWS.createUIComponent(UIAccountSetting.class, null, null);
- uiMaskWS.setUIComponent(uiAccountForm);
- uiMaskWS.setShow(true);
- event.getRequestContext().addUIComponentToUpdateByAjax(uiMaskWS);
+ //Modified by nguyenanhkien2a(a)gmail.com
+ //We should check account for existing
+ String username = Util.getPortalRequestContext().getRemoteUser();
+ OrganizationService service =
uiPortal.getApplicationComponent(OrganizationService.class);
+ User useraccount = service.getUserHandler().findUserByName(username);
+
+ if(useraccount != null)
+ {
+ UIAccountSetting uiAccountForm =
uiMaskWS.createUIComponent(UIAccountSetting.class, null, null);
+ uiMaskWS.setUIComponent(uiAccountForm);
+ uiMaskWS.setShow(true);
+ event.getRequestContext().addUIComponentToUpdateByAjax(uiMaskWS);
+ }
+ else
+ {
+ //Show message detail to user and then logout if user press ok button
+ JavascriptManager jsManager =
Util.getPortalRequestContext().getJavascriptManager();
+ jsManager.importJavascript("eXo");
+ jsManager.addJavascript("if(confirm('" +
+
Util.getPortalRequestContext().getApplicationResourceBundle().getString("UIAccountProfiles.msg.NotExistingAccount")
+
+ "')) {eXo.portal.logout();}");
+ }
}
}
Show replies by date