Author: liem_nguyen
Date: 2009-12-25 03:09:27 -0500 (Fri, 25 Dec 2009)
New Revision: 1144
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationManagement.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPageNavigationForm.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
Log:
GTNPORTAL-416 Fix for Site Management, Group Navigation Management
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-24
11:41:15 UTC (rev 1143)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java 2009-12-25
08:09:27 UTC (rev 1144)
@@ -21,6 +21,7 @@
import org.exoplatform.portal.pom.config.Utils;
import org.exoplatform.services.organization.OrganizationService;
+import org.exoplatform.services.organization.Query;
import org.exoplatform.services.organization.User;
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiRequestContext;
@@ -35,6 +36,7 @@
import org.exoplatform.webui.form.validator.PasswordStringLengthValidator;
import org.exoplatform.webui.form.validator.ResourceValidator;
import org.exoplatform.webui.form.validator.StringLengthValidator;
+import org.exoplatform.webui.organization.UIUserProfileInputSet;
/**
* Created by The eXo Platform SARL
@@ -106,8 +108,22 @@
UIApplication uiApp = context.getUIApplication();
String username = getUIStringInput(USERNAME).getValue();
User user = service.getUserHandler().findUserByName(username);
- if (user==null) {
+ if (user == null)
+ {
uiApp.addMessage(new
ApplicationMessage("UIAccountInputSet.msg.user-is-deleted", null));
+ UIUserInfo userInfo = getParent();
+ if (userInfo != null)
+ {
+ UIUserManagement userManagement = userInfo.getParent();
+ UIListUsers listUser = userManagement.getChild(UIListUsers.class);
+ UIAccountEditInputSet accountInput =
userInfo.getChild(UIAccountEditInputSet.class);
+ UIUserProfileInputSet userProfile =
userInfo.getChild(UIUserProfileInputSet.class);
+ userInfo.setRenderSibbling(UIListUsers.class);
+ listUser.search(new Query());
+ accountInput.reset();
+ userProfile.reset();
+ context.setProcessRender(true);
+ }
return false;
}
invokeSetBindingField(user);
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-24
11:41:15 UTC (rev 1143)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2009-12-25
08:09:27 UTC (rev 1144)
@@ -337,6 +337,7 @@
UIPortalForm.action.Save=#{word.save}
UIPortalForm.action.Close=Cancel
UIPortalForm.msg.sameName=This portal name already exists.
+UIPortalForm.msg.notExistAnymore=This portal is not existed or may be deleted.
UIPortalForm.label.name=Portal Name :
UIPortalForm.label.locale=#{word.locale} :
UIPortalForm.label.date=#{word.date} :
@@ -1369,6 +1370,7 @@
############################################################################
UINavigationManagement.action.addNode=Add Node
+UINavigationManagement.msg.NavigationNotExistAnymore=The navigation could be deleted.
############################################################################
# org.exoplatform.navigation.webui.component.UIAddGroupNavigation #
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationManagement.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationManagement.java 2009-12-24
11:41:15 UTC (rev 1143)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationManagement.java 2009-12-25
08:09:27 UTC (rev 1144)
@@ -29,8 +29,10 @@
import org.exoplatform.portal.webui.util.Util;
import org.exoplatform.portal.webui.workspace.UIPortalApplication;
import org.exoplatform.portal.webui.workspace.UIWorkingWorkspace;
+import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
+import org.exoplatform.webui.core.UIApplication;
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.core.UIContainer;
import org.exoplatform.webui.core.UIPopupWindow;
@@ -93,20 +95,41 @@
public void execute(Event<UINavigationManagement> event) throws Exception
{
+ PortalRequestContext prContext = Util.getPortalRequestContext();
UINavigationManagement uiManagement = event.getSource();
UINavigationNodeSelector uiNodeSelector =
uiManagement.getChild(UINavigationNodeSelector.class);
UserPortalConfigService portalConfigService =
uiManagement.getApplicationComponent(UserPortalConfigService.class);
PageNavigation navigation = uiNodeSelector.getSelectedNavigation();
- PortalRequestContext prContext = Util.getPortalRequestContext();
+ // Check existed
+ PageNavigation persistNavigation =
portalConfigService.getPageNavigation(navigation.getOwnerType(),
navigation.getOwnerId());
+ if (persistNavigation == null) {
+ UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
+ uiApp.addMessage(new
ApplicationMessage("UINavigationManagement.msg.NavigationNotExistAnymore",
null));
+ UIPopupWindow uiPopup = uiManagement.getParent();
+ uiPopup.setShow(false);
+ UIPortalApplication uiPortalApp =
(UIPortalApplication)prContext.getUIApplication();
+ UIWorkingWorkspace uiWorkingWS =
uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
+ prContext.addUIComponentToUpdateByAjax(uiWorkingWS);
+ return;
+ }
+
if(navigation.getOwnerType() == PortalConfig.PORTAL_TYPE)
{
UserPortalConfig portalConfig =
portalConfigService.getUserPortalConfig(navigation.getOwnerId(),
prContext.getRemoteUser());
if(portalConfig != null)
{
portalConfigService.update(navigation);
- }
-
+ } else {
+ UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
+ uiApp.addMessage(new
ApplicationMessage("UIPortalForm.msg.notExistAnymore", null));
+ UIPopupWindow uiPopup = uiManagement.getParent();
+ uiPopup.setShow(false);
+ UIPortalApplication uiPortalApp =
(UIPortalApplication)prContext.getUIApplication();
+ UIWorkingWorkspace uiWorkingWS =
uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
+ prContext.addUIComponentToUpdateByAjax(uiWorkingWS);
+ return;
+ }
}
else
{
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPageNavigationForm.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPageNavigationForm.java 2009-12-24
11:41:15 UTC (rev 1143)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPageNavigationForm.java 2009-12-25
08:09:27 UTC (rev 1144)
@@ -19,6 +19,7 @@
package org.exoplatform.portal.webui.navigation;
+import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.PageNavigation;
@@ -29,6 +30,7 @@
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
+import org.exoplatform.webui.core.UIApplication;
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.core.UIPopupWindow;
import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
@@ -156,7 +158,24 @@
{
UIPageNavigationForm uiForm = event.getSource();
PageNavigation pageNav = uiForm.getPageNav();
- //PortalRequestContext pcontext = Util.getPortalRequestContext();
+
+ // Check existed
+ PortalRequestContext prContext = Util.getPortalRequestContext();
+ UserPortalConfigService portalConfigService =
uiForm.getApplicationComponent(UserPortalConfigService.class);
+ PageNavigation persistNavigation =
+ portalConfigService.getPageNavigation(pageNav.getOwnerType(),
pageNav.getOwnerId());
+ if (persistNavigation == null)
+ {
+ UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
+ uiApp.addMessage(new
ApplicationMessage("UINavigationManagement.msg.NavigationNotExistAnymore",
null));
+ UIPortalApplication uiPortalApp =
(UIPortalApplication)prContext.getUIApplication();
+ UIWorkingWorkspace uiWorkingWS =
uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
+ UIPopupWindow uiPopup = uiForm.getParent();
+ uiPopup.setShow(false);
+ prContext.addUIComponentToUpdateByAjax(uiWorkingWS);
+ return;
+ }
+
WebuiRequestContext pcontext = event.getRequestContext();
UserPortalConfigService service =
uiForm.getApplicationComponent(UserPortalConfigService.class);
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2009-12-24
11:41:15 UTC (rev 1143)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2009-12-25
08:09:27 UTC (rev 1144)
@@ -44,11 +44,13 @@
import org.exoplatform.services.organization.UserProfile;
import org.exoplatform.services.resources.LocaleConfig;
import org.exoplatform.services.resources.LocaleConfigService;
+import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.web.application.JavascriptManager;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.ComponentConfigs;
import org.exoplatform.webui.config.annotation.EventConfig;
+import org.exoplatform.webui.core.UIApplication;
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.core.UIContainer;
import org.exoplatform.webui.core.UITabPane;
@@ -177,6 +179,11 @@
if (configService.getUserPortalConfig(portalOwner, remoteUser) != null)
{
configService.update(portalConfig);
+ } else {
+ UIApplication uiApp = prContext.getUIApplication();
+ uiApp.addMessage(new
ApplicationMessage("UIPortalForm.msg.notExistAnymore", null));
+ prContext.addUIComponentToUpdateByAjax(uiWorkingWS);
+ return;
}
uiPortalApp.getUserPortalConfig().setPortal(portalConfig);
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2009-12-24
11:41:15 UTC (rev 1143)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2009-12-25
08:09:27 UTC (rev 1144)
@@ -143,12 +143,12 @@
PortalRequestContext prContext = Util.getPortalRequestContext();
UIPortal editPortal = null;
- UIPortalApplication uiPortalApp = Util.getUIPortalApplication();
- UIEditInlineWorkspace uiEditWS =
uiPortalApp.<UIWorkingWorkspace>getChildById(UIPortalApplication.UI_WORKING_WS_ID).
-
getChild(UIEditInlineWorkspace.class);
- if(uiPortalApp.getModeState() != UIPortalApplication.NORMAL_MODE &&
- uiEditWS != null && uiEditWS.getUIComponent() != null &&
- (uiEditWS.getUIComponent() instanceof UIPortal))
+ UIPortalApplication uiPortalApp = Util.getUIPortalApplication();
+ UIEditInlineWorkspace uiEditWS =
+ uiPortalApp.<UIWorkingWorkspace>
getChildById(UIPortalApplication.UI_WORKING_WS_ID).getChild(
+ UIEditInlineWorkspace.class);
+ if (uiPortalApp.getModeState() != UIPortalApplication.NORMAL_MODE &&
uiEditWS != null
+ && uiEditWS.getUIComponent() != null &&
(uiEditWS.getUIComponent() instanceof UIPortal))
{
editPortal = (UIPortal)uiEditWS.getUIComponent();
}
@@ -160,8 +160,7 @@
}
invokeGetBindingBean(editPortal);
- ((UIFormStringInput)getChild(UIFormInputSet.class).getChildById(FIELD_NAME))
- .setValue(getPortalOwner());
+
((UIFormStringInput)getChild(UIFormInputSet.class).getChildById(FIELD_NAME)).setValue(getPortalOwner());
setActions(new String[]{"Save", "Close"});
}
@@ -265,31 +264,42 @@
public void execute(Event<UIPortalForm> event) throws Exception
{
UIPortalForm uiForm = event.getSource();
-
+
UserPortalConfigService service =
uiForm.getApplicationComponent(UserPortalConfigService.class);
PortalRequestContext prContext = Util.getPortalRequestContext();
UserPortalConfig userConfig =
service.getUserPortalConfig(uiForm.getPortalOwner(), prContext.getRemoteUser());
- UIPortal uiPortal = uiForm.createUIComponent(UIPortal.class, null, null);
- PortalDataMapper.toUIPortal(uiPortal, userConfig);
-
- UIPortalApplication uiPortalApp =
(UIPortalApplication)prContext.getUIApplication();
- uiForm.invokeSetBindingBean(uiPortal);
-
//uiPortal.refreshNavigation(localeConfigService.getLocaleConfig(uiPortal.getLocale()).getLocale())
;
- if (uiPortalApp.getModeState() == UIPortalApplication.NORMAL_MODE)
+ if (userConfig != null)
{
- PortalConfig portalConfig =
(PortalConfig)PortalDataMapper.buildModelObject(uiPortal);
- UserPortalConfigService configService =
uiForm.getApplicationComponent(UserPortalConfigService.class);
- configService.update(portalConfig);
+ UIPortal uiPortal = uiForm.createUIComponent(UIPortal.class, null, null);
+ PortalDataMapper.toUIPortal(uiPortal, userConfig);
+
+ UIPortalApplication uiPortalApp =
(UIPortalApplication)prContext.getUIApplication();
+ uiForm.invokeSetBindingBean(uiPortal);
+
//uiPortal.refreshNavigation(localeConfigService.getLocaleConfig(uiPortal.getLocale()).getLocale())
;
+ if (uiPortalApp.getModeState() == UIPortalApplication.NORMAL_MODE)
+ {
+ PortalConfig portalConfig =
(PortalConfig)PortalDataMapper.buildModelObject(uiPortal);
+ UserPortalConfigService configService =
uiForm.getApplicationComponent(UserPortalConfigService.class);
+ configService.update(portalConfig);
+ }
+ else
+ {
+ UIWorkingWorkspace uiWorkingWS =
uiPortalApp.findFirstComponentOfType(UIWorkingWorkspace.class);
+ UIEditInlineWorkspace uiEditWS =
uiWorkingWS.getChild(UIEditInlineWorkspace.class);
+ UIPortal editPortal = (UIPortal)uiEditWS.getUIComponent();
+ uiForm.invokeSetBindingBean(editPortal);
+ }
}
else
{
- UIWorkingWorkspace uiWorkingWS =
uiPortalApp.findFirstComponentOfType(UIWorkingWorkspace.class);
- UIEditInlineWorkspace uiEditWS =
uiWorkingWS.getChild(UIEditInlineWorkspace.class);
- UIPortal editPortal = (UIPortal)uiEditWS.getUIComponent();
- uiForm.invokeSetBindingBean(editPortal);
+ UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
+ uiApp.addMessage(new
ApplicationMessage("UIPortalForm.msg.notExistAnymore", null));
+ UIPortalApplication uiPortalApp =
(UIPortalApplication)prContext.getUIApplication();
+ UIWorkingWorkspace uiWorkingWS =
uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
+ prContext.addUIComponentToUpdateByAjax(uiWorkingWS);
}
-
+
UIMaskWorkspace uiMaskWorkspace = uiForm.getParent();
uiMaskWorkspace.setUIComponent(null);
event.getRequestContext().addUIComponentToUpdateByAjax(uiMaskWorkspace);