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

michi at wyona.com michi at wyona.com
Tue Jun 12 15:04:24 CEST 2007


Author: michi
Date: 2007-06-12 15:04:23 +0200 (Tue, 12 Jun 2007)
New Revision: 25055

Modified:
   public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/navigation/NodeResConfigAndDataRepoImpl.java
Log:
also check data repo re isCollection

Modified: public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/navigation/NodeResConfigAndDataRepoImpl.java
===================================================================
--- public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/navigation/NodeResConfigAndDataRepoImpl.java	2007-06-12 13:00:18 UTC (rev 25054)
+++ public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/navigation/NodeResConfigAndDataRepoImpl.java	2007-06-12 13:04:23 UTC (rev 25055)
@@ -104,9 +104,10 @@
      */
     public boolean isCollection() {
         try {
-            log.debug("Check if node is a collection: " + path);
-            if (resRepo.getNode(path.toString()).isCollection()) {
-            //if (resRepo.isCollection(path)) {
+            log.error("DEBUG: Check if node is a collection: " + path);
+            if (resRepo.existsNode(path.toString()) && resRepo.getNode(path.toString()).isCollection()) {
+                return true;
+/*
                 Path[] children = resRepo.getChildren(path);
                 for (int i = 0; i < children.length; i++) {
                     if (children[i].getName().indexOf(".yanel-rti") > 0) {
@@ -119,9 +120,13 @@
                         return true;
                     }
                 }
+*/
             }
+            if (dataRepo.existsNode(path.toString()) && dataRepo.getNode(path.toString()).isCollection()) {
+                return true;
+            }
         } catch(NoSuchNodeException e) {
-            log.warn("No such node exception: " + path);
+            log.error("No such node exception: " + path, e);
             return false;
         } catch(Exception e) {
             log.error(e.getMessage(), e);
@@ -163,8 +168,8 @@
                 log.debug("Is not a collection within resource config repo: " + path);
             }
 
-            if (dataRepo.isCollection(path)) {
-                log.debug("Is collection within data repository: " + path);
+            if (dataRepo.existsNode(path.toString()) && dataRepo.getNode(path.toString()).isCollection()) {
+                log.error("DEBUG: Is collection within data repository: " + path);
                 Path[] children = dataRepo.getChildren(path);
                 for (int i = 0; i < children.length; i++) {
                     log.error("DEBUG: Child within data repo: " + children[i]);




More information about the Yanel-commits mailing list