[Yanel-commits] rev 37272 - public/yanel/trunk/src/contributions/resources/resource-creator/src/java/org/wyona/yanel/impl/resources

michi at wyona.com michi at wyona.com
Sat Jun 28 00:23:38 CEST 2008


Author: michi
Date: 2008-06-28 00:23:38 +0200 (Sat, 28 Jun 2008)
New Revision: 37272

Modified:
   public/yanel/trunk/src/contributions/resources/resource-creator/src/java/org/wyona/yanel/impl/resources/ResourceCreatorResource.java
Log:
add to sitetree finished

Modified: public/yanel/trunk/src/contributions/resources/resource-creator/src/java/org/wyona/yanel/impl/resources/ResourceCreatorResource.java
===================================================================
--- public/yanel/trunk/src/contributions/resources/resource-creator/src/java/org/wyona/yanel/impl/resources/ResourceCreatorResource.java	2008-06-27 21:15:58 UTC (rev 37271)
+++ public/yanel/trunk/src/contributions/resources/resource-creator/src/java/org/wyona/yanel/impl/resources/ResourceCreatorResource.java	2008-06-27 22:23:38 UTC (rev 37272)
@@ -504,7 +504,16 @@
      * Add to sitetree
      */
     private void addToSitetree(Resource newResource) throws Exception {
-        log.error("Not implemented yet!");
+        org.wyona.yanel.core.navigation.Sitetree sitetree = getRealm().getRepoNavigation();
+        String parentPath = PathUtil.getParent(newResource.getPath());
+        org.wyona.yanel.core.navigation.Node parentNode = sitetree.getNode(getRealm(), parentPath);
+        if (parentNode != null) {
+            String nodeName = PathUtil.getName(newResource.getPath());
+            String label = nodeName;
+            parentNode.appendChild(sitetree.createNode(nodeName, label));
+        } else {
+            log.error("No such node with path: " + parentPath);
+        }
     }
 
     /**



More information about the Yanel-commits mailing list