Author: thomas.heute(a)jboss.com
Date: 2010-09-23 05:24:46 -0400 (Thu, 23 Sep 2010)
New Revision: 4323
Modified:
epp/portal/branches/EPP_5_1_Branch/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java
epp/portal/branches/EPP_5_1_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestPortalConfig.java
Log:
JBEPP-481: Always show "The page navigation for '/group' already exists"
although it was deleted
Modified:
epp/portal/branches/EPP_5_1_Branch/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java 2010-09-23
09:20:39 UTC (rev 4322)
+++
epp/portal/branches/EPP_5_1_Branch/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java 2010-09-23
09:24:46 UTC (rev 4323)
@@ -154,8 +154,11 @@
{
GroupHandler groupHandler = orgService.getGroupHandler();
Collection<String> descendantGroups = getDescendantGroups(group,
groupHandler);
+ Collection<String> deletedNavigationGroups = new ArrayList<String>();
+ deletedNavigationGroups.addAll(descendantGroups);
+ deletedNavigationGroups.add(group.getId());
PageNavigation navigation = null;
- for (String childGroup : descendantGroups)
+ for (String childGroup : deletedNavigationGroups)
{
navigation = dataService.getPageNavigation(PortalConfig.GROUP_TYPE,
childGroup);
if (navigation != null)
Modified:
epp/portal/branches/EPP_5_1_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestPortalConfig.java
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestPortalConfig.java 2010-09-23
09:20:39 UTC (rev 4322)
+++
epp/portal/branches/EPP_5_1_Branch/component/portal/src/test/java/org/exoplatform/portal/config/TestPortalConfig.java 2010-09-23
09:24:46 UTC (rev 4323)
@@ -127,6 +127,31 @@
group = groupHandler.findGroupById("/groupTest");
assertNull(group);
}
+
+ public void testGroupNavigation() throws Exception
+ {
+ GroupHandler groupHandler = org.getGroupHandler();
+ Group group = groupHandler.createGroupInstance();
+ group.setGroupName("testGroupNavigation");
+ group.setLabel("testGroupNavigation");
+
+ groupHandler.addChild(null, group, true);
+
+ PageNavigation pageNavigation = new PageNavigation();
+ pageNavigation.setOwnerId(group.getId());
+ pageNavigation.setOwnerType(PortalConfig.GROUP_TYPE);
+ storage.create(pageNavigation);
+
+ pageNavigation = storage.getPageNavigation(PortalConfig.GROUP_TYPE,
group.getId());
+ assertNotNull(pageNavigation);
+
+ // Remove group
+ groupHandler.removeGroup(group, true);
+
+ // Group navigations is removed after remove group
+ pageNavigation = storage.getPageNavigation(PortalConfig.GROUP_TYPE,
group.getId());
+ assertNull(pageNavigation);
+ }
public void testUserLayout() throws Exception
{