Author: julien_viet
Date: 2010-02-08 17:49:36 -0500 (Mon, 08 Feb 2010)
New Revision: 1565
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestSavedPOM.java
Log:
converted navigation to use gtn:described mixin instead of label
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java 2010-02-08
22:30:40 UTC (rev 1564)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java 2010-02-08
22:49:36 UTC (rev 1565)
@@ -156,10 +156,15 @@
pageReference = getOwnerType(siteType) + "::" + site.getName() +
"::" + target.getName();
}
}
+
+ //
+ Described described = src.adapt(Described.class);
+
+ //
NavigationNodeData dstNode = new NavigationNodeData(
src.getObjectId(),
attrs.getValue(MappedAttributes.URI),
- attrs.getValue(MappedAttributes.LABEL),
+ described.getName(),
attrs.getValue(MappedAttributes.ICON),
src.getName(),
attrs.getValue(MappedAttributes.START_PUBLICATION_DATE),
@@ -204,9 +209,12 @@
}
//
+ Described described = dst.adapt(Described.class);
+ described.setName(node.getLabel());
+
+ //
Attributes attrs = dst.getAttributes();
attrs.setValue(MappedAttributes.URI, node.getURI());
- attrs.setValue(MappedAttributes.LABEL, node.getLabel());
attrs.setValue(MappedAttributes.ICON, node.getIcon());
attrs.setValue(MappedAttributes.START_PUBLICATION_DATE,
node.getStartPublicationDate());
attrs.setValue(MappedAttributes.END_PUBLICATION_DATE,
node.getEndPublicationDate());
Modified:
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestSavedPOM.java
===================================================================
---
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestSavedPOM.java 2010-02-08
22:30:40 UTC (rev 1564)
+++
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestSavedPOM.java 2010-02-08
22:49:36 UTC (rev 1565)
@@ -108,9 +108,10 @@
assertNotNull(nodeNavigation);
assertEquals(0, nodeNavigation.getChildren().size());
assertEquals("node_name", nodeNavigation.getName());
+ Described nodeDescribed = nodeNavigation.adapt(Described.class);
+ assertEquals("node_label", nodeDescribed.getName());
Attributes nodeAttrs = nodeNavigation.getAttributes();
assertEquals("node_uri", nodeAttrs.getString("uri"));
- assertEquals("node_label", nodeAttrs.getString("label"));
assertEquals("node_icon", nodeAttrs.getString("icon"));
GregorianCalendar start = new GregorianCalendar(2000, 2, 21, 1, 33, 0);
start.setTimeZone(TimeZone.getTimeZone("UTC"));
Show replies by date