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

michi at wyona.com michi at wyona.com
Thu Feb 1 23:36:23 CET 2007


Author: michi
Date: 2007-02-01 23:36:22 +0100 (Thu, 01 Feb 2007)
New Revision: 22372

Modified:
   public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/navigation/NodeRTIImpl.java
Log:
rc implemented and check for collection added

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 22:23:56 UTC (rev 22371)
+++ public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/navigation/NodeRTIImpl.java	2007-02-01 22:36:22 UTC (rev 22372)
@@ -83,14 +83,19 @@
     }
 
     /**
-     *
+     * Check if node is a collection
      */
     public boolean isCollection() {
         try {
-            Path[] children = repo.getChildren(path);
-            for (int i = 0; i < children.length; i++) {
-                if (children[i].getName().indexOf(".yanel-rti") > 0) {
-                    return true;
+            if (repo.isCollection(path)) {
+                Path[] children = repo.getChildren(path);
+                for (int i = 0; i < children.length; i++) {
+                    if (children[i].getName().indexOf(".yanel-rti") > 0) {
+                        return true;
+                    }
+                    if (children[i].getName().indexOf(".yanel-rc") > 0) {
+                        return true;
+                    }
                 }
             }
         } catch(Exception e) {
@@ -100,16 +105,22 @@
     }
 
     /**
-     *
+     * Get children
      */
     public Node[] getChildren() {
         java.util.Vector c = new java.util.Vector();
         try {
-            Path[] children = repo.getChildren(path);
-            for (int i = 0; i < children.length; i++) {
-                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(path)) {
+                Path[] children = repo.getChildren(path);
+                for (int i = 0; i < children.length; i++) {
+                    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 (children[i].getName().indexOf(".yanel-rc") > 0) {
+                        String cp = children[i].toString().substring(0, children[i].toString().indexOf(".yanel-rc"));
+                        c.add(cp);
+                    }
                 }
             }
         } catch(Exception e) {




More information about the Yanel-commits mailing list