[Yanel-commits] rev 25129 -
public/yanel/trunk/src/resources/xml/src/java/org/wyona/yanel/impl/resources
michi at wyona.com
michi at wyona.com
Thu Jun 14 11:07:41 CEST 2007
Author: michi
Date: 2007-06-14 11:07:41 +0200 (Thu, 14 Jun 2007)
New Revision: 25129
Modified:
public/yanel/trunk/src/resources/xml/src/java/org/wyona/yanel/impl/resources/XMLResource.java
Log:
addnodes fixed
Modified: public/yanel/trunk/src/resources/xml/src/java/org/wyona/yanel/impl/resources/XMLResource.java
===================================================================
--- public/yanel/trunk/src/resources/xml/src/java/org/wyona/yanel/impl/resources/XMLResource.java 2007-06-14 09:05:09 UTC (rev 25128)
+++ public/yanel/trunk/src/resources/xml/src/java/org/wyona/yanel/impl/resources/XMLResource.java 2007-06-14 09:07:41 UTC (rev 25129)
@@ -469,11 +469,8 @@
try {
// TODO: XHTML template should not be hardcoded!
Repository repo = getRealm().getRepository();
- if (!repo.existsNode(getPath())) {
- // TODO: create node recursively ...
- repo.getRootNode().addNode(new org.wyona.commons.io.Path(getPath().toString()).getName(), org.wyona.yarep.core.NodeType.RESOURCE);
- log.warn("Node has been created: " + getPath());
- }
+
+ org.wyona.yanel.core.util.YarepUtil.addNodes(repo, getPath().toString(), org.wyona.yarep.core.NodeType.RESOURCE);
Writer writer = new java.io.OutputStreamWriter(repo.getNode(getPath()).getOutputStream());
writer.write("<?xml version=\"1.0\"?>");
writer.write("<html xmlns=\"http://www.w3.org/1999/xhtml\">");
@@ -494,11 +491,8 @@
int lastIndex = name.lastIndexOf(".");
if (lastIndex > 0) nameWithoutSuffix = name.substring(0, lastIndex);
String introspectionPath = parent + "/introspection-" + nameWithoutSuffix + ".xml";
- if (!repo.existsNode(introspectionPath)) {
- // TODO: create node recursively ...
- repo.getRootNode().addNode(new org.wyona.commons.io.Path(introspectionPath).getName(), org.wyona.yarep.core.NodeType.RESOURCE);
- log.warn("Introspection node has been created: " + introspectionPath);
- }
+
+ org.wyona.yanel.core.util.YarepUtil.addNodes(repo, introspectionPath, org.wyona.yarep.core.NodeType.RESOURCE);
writer = new java.io.OutputStreamWriter(repo.getNode(introspectionPath).getOutputStream());
writer.write(getIntrospection(name));
writer.close();
More information about the Yanel-commits
mailing list