Author: nscavell
Date: 2011-07-28 15:09:49 -0400 (Thu, 28 Jul 2011)
New Revision: 6943
Modified:
portal/branches/gatein-management/component/portal/src/main/java/org/exoplatform/portal/mop/management/binding/xml/NavigationMarshaller.java
portal/branches/gatein-management/component/portal/src/main/java/org/exoplatform/portal/mop/management/operations/navigation/NavigationUtils.java
Log:
Change scope to all when loading fragment navigation. Fix parent-uri for xml.
Modified:
portal/branches/gatein-management/component/portal/src/main/java/org/exoplatform/portal/mop/management/binding/xml/NavigationMarshaller.java
===================================================================
---
portal/branches/gatein-management/component/portal/src/main/java/org/exoplatform/portal/mop/management/binding/xml/NavigationMarshaller.java 2011-07-28
18:34:15 UTC (rev 6942)
+++
portal/branches/gatein-management/component/portal/src/main/java/org/exoplatform/portal/mop/management/binding/xml/NavigationMarshaller.java 2011-07-28
19:09:49 UTC (rev 6943)
@@ -105,11 +105,8 @@
{
if (fragment.getParentURI() != null)
{
- String parentUri = fragment.getParentURI().trim();
- if (parentUri.length() > 0)
- {
- writer.writeElement(Element.PARENT_URI, parentUri);
- }
+ String parentUri = fragment.getParentURI();
+ writeOptionalElement(writer, Element.PARENT_URI, parentUri);
}
Collection<PageNode> nodes = fragment.getNodes();
@@ -201,7 +198,17 @@
next = fork.child();
if (next == Element.PARENT_URI)
{
- fragment.setParentURI(fork.getContent());
+ String parentUri = fork.getContent();
+ if (parentUri == null)
+ {
+ parentUri = "";
+ }
+ else if (parentUri.charAt(0) == '/')
+ {
+ parentUri = parentUri.substring(1, parentUri.length());
+ }
+ fragment.setParentURI(parentUri);
+
next = fork.sibling();
}
Modified:
portal/branches/gatein-management/component/portal/src/main/java/org/exoplatform/portal/mop/management/operations/navigation/NavigationUtils.java
===================================================================
---
portal/branches/gatein-management/component/portal/src/main/java/org/exoplatform/portal/mop/management/operations/navigation/NavigationUtils.java 2011-07-28
18:34:15 UTC (rev 6942)
+++
portal/branches/gatein-management/component/portal/src/main/java/org/exoplatform/portal/mop/management/operations/navigation/NavigationUtils.java 2011-07-28
19:09:49 UTC (rev 6943)
@@ -28,7 +28,6 @@
import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.config.model.PageNode;
import org.exoplatform.portal.mop.Described;
-import org.exoplatform.portal.mop.SiteKey;
import org.exoplatform.portal.mop.description.DescriptionService;
import org.exoplatform.portal.mop.navigation.GenericScope;
import org.exoplatform.portal.mop.navigation.NavigationContext;
@@ -36,7 +35,6 @@
import org.exoplatform.portal.mop.navigation.NodeContext;
import org.exoplatform.portal.mop.navigation.NodeModel;
import org.exoplatform.portal.mop.navigation.Scope;
-import org.gatein.mop.api.workspace.Navigation;
import java.util.ArrayList;
import java.util.Date;
@@ -77,7 +75,7 @@
if (navUri != null)
{
String[] path = trim(navUri.split("/"));
- NodeContext<NodeContext<?>> node =
navigationService.loadNode(NodeModel.SELF_MODEL, navigation,
GenericScope.branchShape(path), null);
+ NodeContext<NodeContext<?>> node =
navigationService.loadNode(NodeModel.SELF_MODEL, navigation,
GenericScope.branchShape(path, Scope.ALL), null);
for (String name : path)
{
node = node.get(name);