Author: liem_nguyen
Date: 2009-12-04 05:30:19 -0500 (Fri, 04 Dec 2009)
New Revision: 927
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.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/workspace/UIMainActionListener.java
Log:
GTNPORTAL-342 Problem when view dashboard page in special case
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java 2009-12-04
09:39:03 UTC (rev 926)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java 2009-12-04
10:30:19 UTC (rev 927)
@@ -49,13 +49,11 @@
import org.exoplatform.webui.core.UIApplication;
import org.exoplatform.webui.core.UIContainer;
import org.exoplatform.webui.core.UIPopupWindow;
-import org.exoplatform.webui.core.UIRightClickPopupMenu;
import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.event.Event.Phase;
-import org.exoplatform.webui.event.EventListener;
-import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Comparator;
@@ -63,6 +61,8 @@
import java.util.List;
import java.util.UUID;
+import javax.servlet.http.HttpServletRequest;
+
@ComponentConfigs({
@ComponentConfig(template =
"app:/groovy/navigation/webui/component/UISiteManagement.gtmpl", events = {
@EventConfig(name = "EditPortalLayout", listeners =
UISiteManagement.EditPortalLayoutActionListener.class),
@@ -209,14 +209,13 @@
else if (config != null)
{
uiPortalApp.addMessage(new
ApplicationMessage("UISiteManagement.msg.Invalid-deletePermission",
- new String[]{config.getPortalConfig().getName()}));
- ;
+ new String[]{config.getPortalConfig().getName()}));;
return;
}
else
{
uiPortalApp.addMessage(new
ApplicationMessage("UISiteManagement.msg.portal-not-exist",
- new String[]{portalName}));
+ new String[]{portalName}));
return;
}
@@ -253,11 +252,11 @@
UIPortalApplication portalApp =
(UIPortalApplication)prContext.getUIApplication();
UserPortalConfig userConfig = service.getUserPortalConfig(portalName,
prContext.getRemoteUser());
-
- if(userConfig == null)
+
+ if (userConfig == null)
{
portalApp.addMessage(new
ApplicationMessage("UISiteManagement.msg.portal-not-exist",
- new String[]{portalName}));
+ new String[]{portalName}));
return;
}
PortalConfig portalConfig = userConfig.getPortalConfig();
@@ -280,17 +279,20 @@
uiComposer.setComponentConfig(UIPortalComposer.class, null);
UIPortal uiPortal = Util.getUIPortal();
- if (portalName.equals(uiPortal.getName()))
+ uiWorkingWS.setBackupUIPortal(uiPortal);
+
+ UIPortal editPortal = uiWorkingWS.createUIComponent(UIPortal.class, null,
null);
+ PortalDataMapper.toUIPortal(editPortal, userConfig);
+ uiEditWS.setUIComponent(editPortal);
+
+ if (uiPortal.getName().equals(editPortal.getName()))
{
- uiEditWS.setUIComponent(uiPortal);
- uiWorkingWS.findFirstComponentOfType(UISiteBody.class).setUIComponent(null);
+ editPortal.setSelectedNode(uiPortal.getSelectedNode());
+ editPortal.setSelectedNavigation(uiPortal.getSelectedNavigation());
+ editPortal.setSelectedPaths(uiPortal.getSelectedPaths());
+ UISiteBody siteBody =
uiWorkingWS.findFirstComponentOfType(UISiteBody.class);
+ siteBody.setUIComponent(null);
}
- else
- {
- UIPortal editPortal = uiWorkingWS.createUIComponent(UIPortal.class, null,
null);
- PortalDataMapper.toUIPortal(editPortal, userConfig);
- uiEditWS.setUIComponent(editPortal);
- }
portalApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
uiWorkingWS.setRenderedChild(UIPortalApplication.UI_EDITTING_WS_ID);
@@ -312,7 +314,7 @@
UIApplication uiApplication = context.getUIApplication();
UserPortalConfig userConfig = service.getUserPortalConfig(portalName,
prContext.getRemoteUser());
- if(userConfig == null)
+ if (userConfig == null)
{
uiApplication.addMessage(new
ApplicationMessage("UISiteManagement.msg.portal-not-exist",
new String[]{portalName}));
@@ -323,10 +325,9 @@
UserACL userACL = uicomp.getApplicationComponent(UserACL.class);
if (!userACL.hasEditPermission(portalConfig))
{
- uiApplication.addMessage(new
ApplicationMessage("UISiteManagement.msg.Invalid-editPermission", null));
- ;
+ uiApplication.addMessage(new
ApplicationMessage("UISiteManagement.msg.Invalid-editPermission", null));;
return;
- }
+ }
UIPopupWindow popUp = uicomp.getChild(UIPopupWindow.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-04
09:39:03 UTC (rev 926)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2009-12-04
10:30:19 UTC (rev 927)
@@ -22,10 +22,11 @@
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.config.UserPortalConfig;
import org.exoplatform.portal.config.UserPortalConfigService;
-import org.exoplatform.portal.pom.data.ModelChange;
import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PageNode;
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.config.model.PortalProperties;
+import org.exoplatform.portal.pom.data.ModelChange;
import org.exoplatform.portal.resource.SkinService;
import org.exoplatform.portal.webui.application.UIApplicationList;
import org.exoplatform.portal.webui.application.UIPortlet;
@@ -325,33 +326,14 @@
UIWorkingWorkspace uiWorkingWS =
uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
UIEditInlineWorkspace uiEditWS =
uiWorkingWS.getChild(UIEditInlineWorkspace.class);
uiEditWS.getComposer().setEditted(false);
-
- UISiteBody siteBody = uiWorkingWS.findFirstComponentOfType(UISiteBody.class);
- UIPortal uiEditPortal = (UIPortal)uiEditWS.getUIComponent();
- UIPortal uiPortal = (UIPortal)siteBody.getUIComponent();
-
- String uri = null;
- String remoteUser = prContext.getRemoteUser();
- String ownerUser = prContext.getPortalOwner();
- if(uiEditPortal != null && uiEditPortal.getOwner().equals(ownerUser))
- uri = (uiEditPortal.getSelectedNode() != null) ?
uiEditPortal.getSelectedNode().getUri() : null;
- else if(uiPortal != null)
- uri = (uiPortal.getSelectedNode() != null) ?
uiPortal.getSelectedNode().getUri() : null;
-
- UserPortalConfigService configService =
uiPortalApp.getApplicationComponent(UserPortalConfigService.class);
- UserPortalConfig userPortalConfig = configService.getUserPortalConfig(ownerUser,
remoteUser);
- UIPortal newPortal = uiWorkingWS.createUIComponent(UIPortal.class, null, null);
- PortalDataMapper.toUIPortal(newPortal, userPortalConfig);
- siteBody.setUIComponent(newPortal);
- uiWorkingWS.getChild(UIEditInlineWorkspace.class).setRendered(false);
-
- uiPortal = (UIPortal)siteBody.getUIComponent();
+ uiEditWS.setRendered(false);
uiWorkingWS.setRenderedChild(UIPortalApplication.UI_VIEWING_WS_ID);
-
- if (uri == null)
- {
- uri = (uiPortal.getSelectedNode() != null) ?
uiPortal.getSelectedNode().getUri() : null;
- }
+
+ UISiteBody siteBody = uiWorkingWS.findFirstComponentOfType(UISiteBody.class);
+ UIPortal uiPortal = uiWorkingWS.getBackupUIPortal();
+ siteBody.setUIComponent(uiPortal);
+
+ String uri = uiPortal.getSelectedNode() != null ?
uiPortal.getSelectedNode().getUri() : null;
PageNodeEvent<UIPortal> pnevent = new
PageNodeEvent<UIPortal>(uiPortal, PageNodeEvent.CHANGE_PAGE_NODE, uri);
uiPortal.broadcast(pnevent, Event.Phase.PROCESS);
prContext.addUIComponentToUpdateByAjax(uiWorkingWS);
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java 2009-12-04
09:39:03 UTC (rev 926)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java 2009-12-04
10:30:19 UTC (rev 927)
@@ -21,6 +21,7 @@
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.config.UserACL;
+import org.exoplatform.portal.config.UserPortalConfig;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.webui.page.UIPage;
@@ -34,7 +35,6 @@
import org.exoplatform.portal.webui.util.PortalDataMapper;
import org.exoplatform.portal.webui.util.Util;
import org.exoplatform.web.application.ApplicationMessage;
-import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
@@ -57,7 +57,8 @@
// check edit permission for page
UIPageBody pageBody = uiWorkingWS.findFirstComponentOfType(UIPageBody.class);
UIPage uiPage = (UIPage)pageBody.getUIComponent();
- if (uiPage == null) {
+ if (uiPage == null)
+ {
uiApp.addMessage(new
ApplicationMessage("UIPageBrowser.msg.PageNotExist", null));
return;
}
@@ -133,23 +134,20 @@
}
PortalRequestContext pcontext =
(PortalRequestContext)event.getRequestContext();
UIWorkingWorkspace uiWorkingWS =
uiApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
- uiWorkingWS.setBackupUIPortal(null);
+ uiWorkingWS.setBackupUIPortal(uiPortal);
uiApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
- // uiWorkingWS.addChild(UIPortalComposer.class, null, null);
- // UserPortalConfig portalConfig = uiApp.getUserPortalConfig();
- // UIPortal newPortal = uiWorkingWS.createUIComponent(UIPortal.class,
- // null, null);
- // PortalDataMapper.toUIPortal(newPortal, portalConfig);
- // UIEditInlineWorkspace uiEditWS =
- // uiWorkingWS.addChild(UIEditInlineWorkspace.class, null,
- // UIPortalApplication.UI_EDITTING_WS_ID);
- UIEditInlineWorkspace uiEditWS =
uiWorkingWS.getChild(UIEditInlineWorkspace.class);
- // uiEditWS.setUIComponent(newPortal);
- UISiteBody uiSiteBody = uiWorkingWS.findFirstComponentOfType(UISiteBody.class);
- uiEditWS.setUIComponent(uiPortal);
- uiSiteBody.setUIComponent(null);
+ UIPortal newPortal = uiWorkingWS.createUIComponent(UIPortal.class, null, null);
+ PortalDataMapper.toUIPortal(newPortal, uiApp.getUserPortalConfig());
+ newPortal.setSelectedNode(uiPortal.getSelectedNode());
+ newPortal.setSelectedNavigation(uiPortal.getSelectedNavigation());
+ newPortal.setSelectedPaths(uiPortal.getSelectedPaths());
+ UIEditInlineWorkspace uiEditWS =
uiWorkingWS.getChild(UIEditInlineWorkspace.class);
+ uiEditWS.setUIComponent(newPortal);
+ UISiteBody siteBody = uiWorkingWS.findFirstComponentOfType(UISiteBody.class);
+ siteBody.setUIComponent(null);
+
UIPortalComposer uiComposer = uiEditWS.getComposer().setRendered(true);
uiComposer.setComponentConfig(UIPortalComposer.class, null);
uiComposer.setShowControl(true);