[Yanel-commits] rev 33917 -
public/yanel/trunk/src/contributions/resources/data-repo-sitetree/src/java/org/wyona/yanel/impl/resources
michi at wyona.com
michi at wyona.com
Mon Mar 24 00:39:17 CET 2008
Author: michi
Date: 2008-03-24 00:39:16 +0100 (Mon, 24 Mar 2008)
New Revision: 33917
Modified:
public/yanel/trunk/src/contributions/resources/data-repo-sitetree/src/java/org/wyona/yanel/impl/resources/DataRepoSitetreeResource.java
Log:
construct child path
Modified: public/yanel/trunk/src/contributions/resources/data-repo-sitetree/src/java/org/wyona/yanel/impl/resources/DataRepoSitetreeResource.java
===================================================================
--- public/yanel/trunk/src/contributions/resources/data-repo-sitetree/src/java/org/wyona/yanel/impl/resources/DataRepoSitetreeResource.java 2008-03-23 23:38:07 UTC (rev 33916)
+++ public/yanel/trunk/src/contributions/resources/data-repo-sitetree/src/java/org/wyona/yanel/impl/resources/DataRepoSitetreeResource.java 2008-03-23 23:39:16 UTC (rev 33917)
@@ -130,15 +130,24 @@
if (node != null) {
if (node.isCollection()) {
- sb.append("<collection path=\"" + path + "\" name=\" " + node.getName() + "\">");
+ sb.append("<collection path=\"" + path + "\" name=\"" + node.getName() + "\">");
Node[] children = node.getChildren();
for (int i = 0; i < children.length; i++) {
+ String childPath = path + "/" + children[i].getName();
+ if (path.equals("/")) {
+ childPath = path + children[i].getName();
+ }
+ //log.debug("Child path: " + childPath);
+
if (children[i].isCollection()) {
- sb.append(getNodeAsXML(children[i].getPath()));
+ sb.append(getNodeAsXML(childPath));
+ //sb.append(getNodeAsXML(children[i].getPath()));
} else if (children[i].isResource()) {
- sb.append("<resource path=\"" + children[i].getPath() + "\" name=\"" + children[i].getName() + "\"/>");
+ sb.append("<resource path=\"" + childPath + "\" name=\"" + children[i].getName() + "\"/>");
+ //sb.append("<resource path=\"" + children[i].getPath() + "\" name=\"" + children[i].getName() + "\"/>");
} else {
- sb.append("<neither-resource-nor-collection path=\"" + children[i].getPath() + "\" name=\"" + children[i].getName() + "\"/>");
+ sb.append("<neither-resource-nor-collection path=\"" + childPath + "\" name=\"" + children[i].getName() + "\"/>");
+ //sb.append("<neither-resource-nor-collection path=\"" + children[i].getPath() + "\" name=\"" + children[i].getName() + "\"/>");
}
}
sb.append("</collection>");
More information about the Yanel-commits
mailing list