[Yanel-commits] rev 22375 - public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/navigation

michi at wyona.com michi at wyona.com
Fri Feb 2 01:22:55 CET 2007


Author: michi
Date: 2007-02-02 01:22:53 +0100 (Fri, 02 Feb 2007)
New Revision: 22375

Modified:
   public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/navigation/NodeRTIImpl.java
Log:
get children and is collection fixed

Modified: public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/navigation/NodeRTIImpl.java
===================================================================
--- public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/navigation/NodeRTIImpl.java	2007-02-01 23:37:12 UTC (rev 22374)
+++ public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/navigation/NodeRTIImpl.java	2007-02-02 00:22:53 UTC (rev 22375)
@@ -88,7 +88,7 @@
     public boolean isCollection() {
         try {
             if (repo.isCollection(path)) {
-                log.error("DEBUG: Is collection: " + path);
+                log.debug("Is collection within repo: " + path);
                 Path[] children = repo.getChildren(path);
                 for (int i = 0; i < children.length; i++) {
                     if (children[i].getName().indexOf(".yanel-rti") > 0) {
@@ -97,6 +97,9 @@
                     if (children[i].getName().indexOf(".yanel-rc") > 0) {
                         return true;
                     }
+                    if (repo.isCollection(children[i])) {
+                        return true;
+                    }
                 }
             }
         } catch(Exception e) {
@@ -112,23 +115,20 @@
         java.util.Vector c = new java.util.Vector();
         try {
             if (repo.isCollection(path)) {
-                log.error("DEBUG: Is collection: " + path);
+                log.debug("Is collection within repo: " + path);
                 Path[] children = repo.getChildren(path);
                 for (int i = 0; i < children.length; i++) {
+                    if (repo.isCollection(children[i])) {
+                        c.add(children[i].toString());
+                    }
                     if (children[i].getName().indexOf(".yanel-rti") > 0) {
                         String cp = children[i].toString().substring(0, children[i].toString().indexOf(".yanel-rti"));
-                        c.add(cp);
+                        if (!repo.isCollection(new Path(cp))) c.add(cp);
                     }
                     if (children[i].getName().indexOf(".yanel-rc") > 0) {
                         String cp = children[i].toString().substring(0, children[i].toString().indexOf(".yanel-rc"));
-                        c.add(cp);
+                        if (!repo.isCollection(new Path(cp))) c.add(cp);
                     }
-// TODO: Collections are also children ...
-/*
-                    if (repo.isCollection(new Path(path + "/" + children[i]))) {
-                        c.add(children[i].getName());
-                    }
-*/
                 }
             } else {
                 log.warn("Is not a collection: " + path);




More information about the Yanel-commits mailing list