Author: hoang_to
Date: 2010-09-01 00:30:25 -0400 (Wed, 01 Sep 2010)
New Revision: 3996
Modified:
portal/branches/branched-r3845/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java
portal/branches/branched-r3845/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java
Log:
GTNPORTAL-1313:Rename a tab in dashboard, always redirect to home page
Modified:
portal/branches/branched-r3845/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java
===================================================================
---
portal/branches/branched-r3845/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java 2010-09-01
04:13:32 UTC (rev 3995)
+++
portal/branches/branched-r3845/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java 2010-09-01
04:30:25 UTC (rev 3996)
@@ -204,7 +204,10 @@
//
Described described = dst.adapt(Described.class);
described.setName(node.getLabel());
-
+ if(!dst.getName().equals(((NavigationNodeData) src).getName()))
+ {
+ dst.setName(((NavigationNodeData) src).getName());
+ }
//
Visible visible = dst.adapt(Visible.class);
visible.setVisibility(node.getVisibility());
Modified:
portal/branches/branched-r3845/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java
===================================================================
---
portal/branches/branched-r3845/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java 2010-09-01
04:13:32 UTC (rev 3995)
+++
portal/branches/branched-r3845/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java 2010-09-01
04:30:25 UTC (rev 3996)
@@ -704,71 +704,6 @@
}
}.execute(null);
}
-
- public void testNodeNameImmutability()
- {
- new UnitTest()
- {
- @Override
- protected void execute() throws Exception
- {
- String ownerType = "group";
- String ownerId = "/platform/administrators";
- String formerName = "testtest";
- String updatedName = "updatedupdated";
-
- PageNavigation pageNav = new PageNavigation();
- pageNav.setOwnerType(ownerType);
- pageNav.setOwnerId(ownerId);
-
- storage_.remove(pageNav);
- storage_.create(pageNav);
-
- pageNav = storage_.getPageNavigation(ownerType, ownerId);
- assertNotNull("Could not create navigation!", pageNav);
- PageNode pageNode = new PageNode();
- pageNode.setName(formerName);
- pageNode.setUri(formerName + "_uri");
- pageNode.setLabel(formerName + "_label");
- pageNav.addNode(pageNode);
-
- storage_.save(pageNav);
-
- pageNav = storage_.getPageNavigation(ownerType, ownerId);
- pageNode = pageNav.getNode(formerName);
- //Check if the node with name containing '_' has been created
- assertNotNull("Could not create page node!", pageNode);
- assertEquals(formerName, pageNode.getName());
- assertEquals(formerName + "_uri", pageNode.getUri());
- assertEquals(formerName + "_label", pageNode.getLabel());
-
- pageNode.setName(updatedName);
- pageNode.setUri(updatedName + "_uri");
- pageNode.setLabel(updatedName + "_label");
-
- storage_.save(pageNav);
-
- pageNav = storage_.getPageNavigation(ownerType, ownerId);
- pageNode = pageNav.getNode(updatedName);
- assertNull("Node name has been updated", pageNode);
-
- pageNode = pageNav.getNode(formerName);
- assertNotNull("Could not find node " + formerName, pageNode);
- assertEquals(formerName, pageNode.getName());
- assertEquals(updatedName + "_uri", pageNode.getUri());
- assertEquals(updatedName + "_label", pageNode.getLabel());
-
- for(PageNode node : pageNav.getNodes())
- {
- StringBuffer message = new StringBuffer("Current node metadata:
\n");
- message.append("Name: " + node.getName() + "\n");
- message.append("Label: " + node.getLabel() + "\n");
- message.append("Uri: " + node.getUri() + "\n");
- System.out.println(message.toString());
- }
- }
- }.execute(null);
- }
public void testRenewPage()
{