Author: hoang_to
Date: 2010-09-23 07:00:27 -0400 (Thu, 23 Sep 2010)
New Revision: 4344
Modified:
portal/branches/branch-GTNPORTAL-1493/component/portal/src/main/java/org/exoplatform/portal/config/model/Page.java
portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java
portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java
portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/util/Util.java
Log:
Clean DesktopPage relevant code from UI framework
Modified:
portal/branches/branch-GTNPORTAL-1493/component/portal/src/main/java/org/exoplatform/portal/config/model/Page.java
===================================================================
---
portal/branches/branch-GTNPORTAL-1493/component/portal/src/main/java/org/exoplatform/portal/config/model/Page.java 2010-09-23
10:45:04 UTC (rev 4343)
+++
portal/branches/branch-GTNPORTAL-1493/component/portal/src/main/java/org/exoplatform/portal/config/model/Page.java 2010-09-23
11:00:27 UTC (rev 4344)
@@ -197,4 +197,18 @@
{
return "Page[ownerType=" + ownerType + ",ownerId=" + ownerId +
",name=" + name + "]";
}
+
+ @Override
+ public final String getFactoryId()
+ {
+ String factoryId = super.getFactoryId();
+ if (factoryId != null)
+ {
+ return factoryId;
+ }
+ else
+ {
+ return "org.exoplatform.portal.webui.page.UIPage";
+ }
+ }
}
\ No newline at end of file
Modified:
portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java
===================================================================
---
portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java 2010-09-23
10:45:04 UTC (rev 4343)
+++
portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java 2010-09-23
11:00:27 UTC (rev 4344)
@@ -146,14 +146,9 @@
return uiPage;
}
- if (Page.DESKTOP_PAGE.equals(page.getFactoryId()))
- {
- uiPage = createUIComponent(context, UIDesktopPage.class, null, null);
- }
- else
- {
- uiPage = createUIComponent(context, UIPage.class, null, null);
- }
+ Class<? extends UIPage> clazz =
Class.forName(page.getFactoryId()).asSubclass(UIPage.class);
+ uiPage = createUIComponent(context, clazz, null, null);
+
PortalDataMapper.toUIPage(uiPage, page);
uiPortal.setUIPage(page.getId(), uiPage);
Modified:
portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java
===================================================================
---
portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java 2010-09-23
10:45:04 UTC (rev 4343)
+++
portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java 2010-09-23
11:00:27 UTC (rev 4344)
@@ -350,16 +350,10 @@
}
UIPagePreview uiPagePreview = uiWizard.getChild(UIPagePreview.class);
- UIPage uiPage;
- if (Page.DESKTOP_PAGE.equals(page.getFactoryId()))
- {
- uiPage = uiWizard.createUIComponent(context, UIDesktopPage.class, null,
null);
- }
- else
- {
- uiPage = uiWizard.createUIComponent(context, UIPage.class, null, null);
- }
-
+
+ Class<? extends UIPage> clazz =
Class.forName(page.getFactoryId()).asSubclass(UIPage.class);
+ UIPage uiPage = uiWizard.createUIComponent(context, clazz, null, null);
+
PortalDataMapper.toUIPage(uiPage, page);
uiPagePreview.setUIComponent(uiPage);
Modified:
portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/util/Util.java
===================================================================
---
portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/util/Util.java 2010-09-23
10:45:04 UTC (rev 4343)
+++
portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/util/Util.java 2010-09-23
11:00:27 UTC (rev 4344)
@@ -19,13 +19,14 @@
package org.exoplatform.portal.webui.util;
+import java.util.List;
+
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PageNode;
import org.exoplatform.portal.webui.application.UIPortlet;
import org.exoplatform.portal.webui.container.UIContainer;
-import org.exoplatform.portal.webui.page.UIDesktopPage;
import org.exoplatform.portal.webui.page.UIPage;
import org.exoplatform.portal.webui.portal.UIPortal;
import org.exoplatform.portal.webui.portal.UIPortalComponent;
@@ -38,8 +39,6 @@
import org.exoplatform.webui.core.UIComponentDecorator;
import org.exoplatform.webui.event.Event;
-import java.util.List;
-
/**
* Jun 5, 2006
*/
@@ -226,14 +225,10 @@
if (uiPage != null && uiPage.getId().equals(page.getId()))
return uiPage;
WebuiRequestContext context = Util.getPortalRequestContext();
- if (Page.DESKTOP_PAGE.equals(page.getFactoryId()))
- {
- uiPage = uiParent.createUIComponent(context, UIDesktopPage.class, null, null);
- }
- else
- {
- uiPage = uiParent.createUIComponent(context, UIPage.class, null, null);
- }
+
+ Class<? extends UIPage> clazz =
Class.forName(page.getFactoryId()).asSubclass(UIPage.class);
+ uiPage = uiParent.createUIComponent(context, clazz, null, null);
+
PortalDataMapper.toUIPage(uiPage, page);
return uiPage;
}