Author: thomas.heute(a)jboss.com
Date: 2009-05-04 07:20:54 -0400 (Mon, 04 May 2009)
New Revision: 13289
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/CustomizationManagerService.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/CustomizationManager.java
Log:
JBPORTAL-2384: Avoid creating dashboard objects if dashboard isn't used
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java 2009-05-04
11:12:39 UTC (rev 13288)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java 2009-05-04
11:20:54 UTC (rev 13289)
@@ -248,9 +248,9 @@
else
{
//
- if (user != null)
+ CustomizationManager cm = controller.getCustomizationManager();
+ if ((user != null) && (cm.hasDashboard(user)))
{
- CustomizationManager cm = controller.getCustomizationManager();
Portal dashboard = cm.getDashboard(user);
if (dashboard.getChild(pageName) == null)
{
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/CustomizationManagerService.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/CustomizationManagerService.java 2009-05-04
11:12:39 UTC (rev 13288)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/CustomizationManagerService.java 2009-05-04
11:20:54 UTC (rev 13289)
@@ -264,6 +264,19 @@
// return false;
}
+ public boolean hasDashboard(User user)
+ {
+ Context dashboardContext = portalObjectContainer.getContext(dashboardContextId);
+
+ //
+ String userId = getUserId(user);
+
+ //
+ Portal dashboardPortal = dashboardContext.getPortal(userId);
+
+ return dashboardPortal != null;
+ }
+
public Portal getDashboard(User user) throws IllegalArgumentException
{
//
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/CustomizationManager.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/CustomizationManager.java 2009-05-04
11:12:39 UTC (rev 13288)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/CustomizationManager.java 2009-05-04
11:20:54 UTC (rev 13289)
@@ -74,6 +74,11 @@
boolean isDashboard(PortalObject object, User user);
/**
+ * Returns true if a dashboard exists for the user
+ */
+ boolean hasDashboard(User user);
+
+ /**
* Destroys the dashboard of a specified user.
*
* @param userId
Show replies by date