Author: hoang_to
Date: 2009-12-02 02:16:28 -0500 (Wed, 02 Dec 2009)
New Revision: 897
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java
Log:
GTNPORTAL-251: Update the code to fix the error while unmaximize the page
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java 2009-12-02
02:24:04 UTC (rev 896)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java 2009-12-02
07:16:28 UTC (rev 897)
@@ -273,21 +273,9 @@
Container container = pConfig.getPortalLayout();
if (container != null)
{
- /** Keep track of show max window property * */
- boolean showMaxWindow = false;
- try
- {
- PageNode selectedNode = uiPortal.getSelectedNode();
- Page displayedPage = storage.getPage(selectedNode.getPageReference());
- showMaxWindow = displayedPage.isShowMaxWindow();
- }
- catch (Exception ex)
- {
-
- }
UserPortalConfig portalConfig = uiPortalApp.getUserPortalConfig();
portalConfig.setPortal(pConfig);
- rebuildUIPortal(uiPortal, portalConfig, showMaxWindow);
+ rebuildUIPortal(uiPortal, portalConfig);
}
}
@@ -298,8 +286,7 @@
* @param portalConfig
* @throws Exception
*/
- private void rebuildUIPortal(UIPortal uiPortal, UserPortalConfig portalConfig,
boolean showMaxWindow)
- throws Exception
+ private void rebuildUIPortal(UIPortal uiPortal, UserPortalConfig portalConfig)
throws Exception
{
PageNode backupSelectedNode = uiPortal.getSelectedNode();
PageNavigation backupSelectedNavigation = uiPortal.getSelectedNavigation();
@@ -309,26 +296,6 @@
uiPortal.setSelectedNode(backupSelectedNode);
uiPortal.setSelectedNavigation(backupSelectedNavigation);
uiPortal.setSelectedPaths(backupSelectedPaths);
-
- /** Update the show-max-window property on UIPage * */
- UIPageBody uiPageBody = uiPortal.findFirstComponentOfType(UIPageBody.class);
- UIPage uiPage = (UIPage)uiPageBody.getUIComponent();
- uiPage.setShowMaxWindow(showMaxWindow);
-
- if(showMaxWindow){
- //To maximized the UIPage
- uiPortal.setMaximizedUIComponent(uiPage);
- }else{
- //To un-maximized the UIPage
- UIComponent uiPortalMaxComponent = uiPortal.getMaximizedUIComponent();
- if(uiPortalMaxComponent instanceof UIPage){
- uiPortal.setMaximizedUIComponent(null);
- }
- UIComponent pageBodyMaxComponent = uiPageBody.getMaximizedUIComponent();
- if(pageBodyMaxComponent instanceof UIPage){
- uiPageBody.setMaximizedUIComponent(null);
- }
- }
}
}
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java 2009-12-02
02:24:04 UTC (rev 896)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java 2009-12-02
07:16:28 UTC (rev 897)
@@ -32,6 +32,7 @@
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.core.UIComponentDecorator;
/**
@@ -109,7 +110,22 @@
}
PortalDataMapper.toUIPage(uiPage, page);
if (uiPage.isShowMaxWindow())
+ {
uiPortal.setMaximizedUIComponent(uiPage);
+ }
+ else
+ {
+ UIComponent maximizedComponent = uiPortal.getMaximizedUIComponent();
+ if (maximizedComponent != null && maximizedComponent instanceof
UIPage)
+ {
+ uiPortal.setMaximizedUIComponent(null);
+ }
+ UIComponent maximizedComponentInPageBody = this.getMaximizedUIComponent();
+ if(maximizedComponentInPageBody !=null &&
maximizedComponentInPageBody instanceof UIPage){
+ this.setMaximizedUIComponent(null);
+ }
+ }
+
}
setUIComponent(uiPage);
}
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 2009-12-02
02:24:04 UTC (rev 896)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java 2009-12-02
07:16:28 UTC (rev 897)
@@ -227,8 +227,10 @@
if (pNav == null)
return;
// ----------------------------------------------------------
- selectedNode_ = pNav.getNodes().get(0);
- selectedPaths_.add(selectedNode_);
+ if(selectedNode_ == null){
+ selectedNode_ = pNav.getNodes().get(0);
+ selectedPaths_.add(selectedNode_);
+ }
UIPageBody uiPageBody = findFirstComponentOfType(UIPageBody.class);
if (uiPageBody == null)
return;
Show replies by date