Author: truong.le
Date: 2009-11-05 02:39:52 -0500 (Thu, 05 Nov 2009)
New Revision: 498
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java
portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIAdminToolbarPortlet.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIUserToolBarDashboardPortlet.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIUserToolBarGroupPortlet.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIUserToolBarSitePortlet.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPortalNavigation2.java
Log:
GTNPORTAL-169: Don't display excutive board's page when detele group (
organization)
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java 2009-11-05
06:53:50 UTC (rev 497)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java 2009-11-05
07:39:52 UTC (rev 498)
@@ -19,19 +19,23 @@
package org.exoplatform.portal.config;
+import java.util.ArrayList;
+import java.util.Collection;
+
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.portal.config.model.Container;
+import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.services.jcr.ext.registry.RegistryService;
import org.exoplatform.services.organization.Group;
import org.exoplatform.services.organization.GroupEventListener;
+import org.exoplatform.services.organization.OrganizationService;
/**
- * Created by The eXo Platform SARL
+ * Created by The eXo Platform SARL
* Author : Nhu Dinh Thuan
- * nhudinhthuan(a)exoplatform.com
- * May 29, 2007
+ * nhudinhthuan(a)exoplatform.com May 29, 2007
*/
public class GroupPortalConfigListener extends GroupEventListener
{
@@ -41,8 +45,12 @@
ExoContainer container = ExoContainerContext.getCurrentContainer();
UserPortalConfigService portalConfigService =
(UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class);
+
+ // Remove all descendant navigations
+ removeGroupNavigation(group, portalConfigService);
+
String groupId = group.getId().trim();
- portalConfigService.removeUserPortalConfig("group", groupId);
+ portalConfigService.removeUserPortalConfig(PortalConfig.GROUP_TYPE, groupId);
}
@Override
@@ -50,10 +58,10 @@
{
ExoContainer container = ExoContainerContext.getCurrentContainer();
/*
- * TODO Call start method on RegistryService to allow ecm, ultimate can run
- * with JDK6. This is uncommon behavior. We need find other way to fix it I
- * hope that this issues will be fixed when we use the lastest version of
- * PicoContainer Comment by Hoa Pham.
+ * TODO Call start method on RegistryService to allow ecm, ultimate can
+ * run with JDK6. This is uncommon behavior. We need find other way to fix
+ * it I hope that this issues will be fixed when we use the lastest
+ * version of PicoContainer Comment by Hoa Pham.
*/
RegistryService registryService =
(RegistryService)container.getComponentInstanceOfType(RegistryService.class);
registryService.start();
@@ -131,4 +139,31 @@
dataStorage.create(cfg);
}
}
+
+ private void removeGroupNavigation(Group group, UserPortalConfigService
portalConfigService) throws Exception
+ {
+ Collection<String> descendantGroups = getDescendantGroups(group);
+ PageNavigation navigation = null;
+ for (String childGroup : descendantGroups)
+ {
+ navigation = portalConfigService.getPageNavigation(PortalConfig.GROUP_TYPE,
childGroup);
+ if (navigation != null)
+ portalConfigService.remove(navigation);
+ }
+ }
+
+ private Collection<String> getDescendantGroups(Group group) throws Exception
+ {
+ ExoContainer container = ExoContainerContext.getCurrentContainer();
+ OrganizationService orgService =
+
(OrganizationService)container.getComponentInstanceOfType(OrganizationService.class);
+ Collection<Group> groupCollection =
orgService.getGroupHandler().findGroups(group);
+ Collection<String> col = new ArrayList<String>();
+ for (Group childGroup : groupCollection)
+ {
+ col.add(childGroup.getId());
+ col.addAll(getDescendantGroups(childGroup));
+ }
+ return col;
+ }
}
Modified:
portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java
===================================================================
---
portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java 2009-11-05
06:53:50 UTC (rev 497)
+++
portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java 2009-11-05
07:39:52 UTC (rev 498)
@@ -85,13 +85,13 @@
initPageNavigation();
}
- private void initPageNavigation()
+ private void initPageNavigation() throws Exception
{
String remoteUser = Util.getPortalRequestContext().getRemoteUser();
pageNavigation = getPageNavigation(PortalConfig.USER_TYPE + "::" +
remoteUser);
}
- private PageNavigation getPageNavigation(String owner)
+ private PageNavigation getPageNavigation(String owner) throws Exception
{
List<PageNavigation> allNavigations = uiPortal.getNavigations();
for (PageNavigation nav : allNavigations)
@@ -124,7 +124,7 @@
}
}
- public PageNavigation getPageNavigation()
+ public PageNavigation getPageNavigation() throws Exception
{
if (pageNavigation == null)
{
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIAdminToolbarPortlet.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIAdminToolbarPortlet.java 2009-11-05
06:53:50 UTC (rev 497)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIAdminToolbarPortlet.java 2009-11-05
07:39:52 UTC (rev 498)
@@ -33,7 +33,7 @@
{
}
- public PageNavigation getSelectedNavigation()
+ public PageNavigation getSelectedNavigation() throws Exception
{
PageNavigation nav = Util.getUIPortal().getSelectedNavigation();
if (nav != null)
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIUserToolBarDashboardPortlet.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIUserToolBarDashboardPortlet.java 2009-11-05
06:53:50 UTC (rev 497)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIUserToolBarDashboardPortlet.java 2009-11-05
07:39:52 UTC (rev 498)
@@ -54,13 +54,13 @@
{
}
- public PageNavigation getCurrentUserNavigation()
+ public PageNavigation getCurrentUserNavigation() throws Exception
{
String remoteUser = Util.getPortalRequestContext().getRemoteUser();
return getPageNavigation(PortalConfig.USER_TYPE + "::" + remoteUser);
}
- private PageNavigation getPageNavigation(String owner)
+ private PageNavigation getPageNavigation(String owner) throws Exception
{
List<PageNavigation> allNavigations = Util.getUIPortal().getNavigations();
for (PageNavigation nav : allNavigations)
@@ -71,7 +71,7 @@
return null;
}
- public PageNode getSelectedPageNode()
+ public PageNode getSelectedPageNode() throws Exception
{
return Util.getUIPortal().getSelectedNode();
}
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIUserToolBarGroupPortlet.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIUserToolBarGroupPortlet.java 2009-11-05
06:53:50 UTC (rev 497)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIUserToolBarGroupPortlet.java 2009-11-05
07:39:52 UTC (rev 498)
@@ -60,7 +60,7 @@
return navigations;
}
- public PageNode getSelectedPageNode()
+ public PageNode getSelectedPageNode() throws Exception
{
return Util.getUIPortal().getSelectedNode();
}
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIUserToolBarSitePortlet.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIUserToolBarSitePortlet.java 2009-11-05
06:53:50 UTC (rev 497)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIUserToolBarSitePortlet.java 2009-11-05
07:39:52 UTC (rev 498)
@@ -70,7 +70,7 @@
return PageNavigationUtils.filter(navi, remoteUser);
}
- private PageNavigation getPageNavigation(String owner)
+ private PageNavigation getPageNavigation(String owner) throws Exception
{
List<PageNavigation> allNavigations = Util.getUIPortal().getNavigations();
for (PageNavigation nav : allNavigations)
@@ -81,7 +81,7 @@
return null;
}
- public PageNode getSelectedPageNode()
+ public PageNode getSelectedPageNode() throws Exception
{
return Util.getUIPortal().getSelectedNode();
}
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java 2009-11-05
06:53:50 UTC (rev 497)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java 2009-11-05
07:39:52 UTC (rev 498)
@@ -130,9 +130,9 @@
validator.endComponent();
}
}
- catch (NullPointerException e)
+ catch (Exception e)
{
- log.error("Template: " + template + " not found");
+ log.error("Template: " + template,e);
}
}
}
\ No newline at end of file
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPortalNavigation2.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPortalNavigation2.java 2009-11-05
06:53:50 UTC (rev 497)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPortalNavigation2.java 2009-11-05
07:39:52 UTC (rev 498)
@@ -66,7 +66,7 @@
return result;
}
- public PageNavigation getSelectedNavigation()
+ public PageNavigation getSelectedNavigation() throws Exception
{
PageNavigation nav = Util.getUIPortal().getSelectedNavigation();
if (nav != null)
@@ -81,7 +81,7 @@
return selectedParent_;
}
- public PageNode getSelectedPageNode()
+ public PageNode getSelectedPageNode() throws Exception
{
if (selectedNode_ != null)
return selectedNode_;