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

michi at wyona.com michi at wyona.com
Tue Jun 12 12:23:37 CEST 2007


Author: michi
Date: 2007-06-12 12:23:36 +0200 (Tue, 12 Jun 2007)
New Revision: 25047

Modified:
   public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/navigation/NodeResConfigAndDataRepoImpl.java
Log:
repo variable renamed to make it clearer and error message improved

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 09:50:15 UTC (rev 25046)
+++ public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/navigation/NodeResConfigAndDataRepoImpl.java	2007-06-12 10:23:36 UTC (rev 25047)
@@ -32,7 +32,7 @@
     private static Category log = Category.getInstance(NodeResConfigAndDataRepoImpl.class);
 
     Path path;
-    Repository repo; // resource configuration repository
+    Repository resRepo; // resource configuration repository
     Repository dataRepo;
 
     /**
@@ -40,7 +40,7 @@
      */
     public NodeResConfigAndDataRepoImpl(org.wyona.yarep.core.Repository resConfigRepo, org.wyona.yarep.core.Repository dataRepo, String path) {
         this.path = new Path(path);
-        this.repo = resConfigRepo;
+        this.resRepo = resConfigRepo;
         this.dataRepo = dataRepo;
     }
 
@@ -83,14 +83,14 @@
     public boolean isResource() {
         if (isCollection()) return false;
         try {
-            if (repo.getNode(path.toString() + ".yanel-rti").isResource()) return true;
+            if (resRepo.getNode(path.toString() + ".yanel-rti").isResource()) return true;
         } catch (NoSuchNodeException e) {
             log.warn("No such node exception: " + path + ".yanel-rti");
         } catch (Exception e) {
             log.error(e.getMessage(), e);
         }
         try {
-            if (repo.getNode(path.toString() + ".yanel-rc").isResource()) return true;
+            if (resRepo.getNode(path.toString() + ".yanel-rc").isResource()) return true;
         } catch (NoSuchNodeException e) {
             log.warn("No such node exception: " + path + ".yanel-rc");
         } catch (Exception e) {
@@ -105,10 +105,10 @@
     public boolean isCollection() {
         try {
             log.debug("Check if node is a collection: " + path);
-            if (repo.getNode(path.toString()).isCollection()) {
-            //if (repo.isCollection(path)) {
+            if (resRepo.getNode(path.toString()).isCollection()) {
+            //if (resRepo.isCollection(path)) {
                 log.error("DEBUG: Is collection within repo: " + path);
-                Path[] children = repo.getChildren(path);
+                Path[] children = resRepo.getChildren(path);
                 for (int i = 0; i < children.length; i++) {
                     if (children[i].getName().indexOf(".yanel-rti") > 0) {
                         return true;
@@ -116,7 +116,7 @@
                     if (children[i].getName().indexOf(".yanel-rc") > 0) {
                         return true;
                     }
-                    if (repo.isCollection(children[i])) {
+                    if (resRepo.isCollection(children[i])) {
                         return true;
                     }
                 }
@@ -136,20 +136,20 @@
     public Node[] getChildren() {
         java.util.Vector c = new java.util.Vector();
         try {
-            if (repo.isCollection(path)) {
+            if (resRepo.isCollection(path)) {
                 log.debug("Is collection within resource config repo: " + path);
-                Path[] children = repo.getChildren(path);
+                Path[] children = resRepo.getChildren(path);
                 for (int i = 0; i < children.length; i++) {
-                    if (repo.isCollection(children[i])) {
+                    if (resRepo.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"));
-                        if (!repo.isCollection(new Path(cp))) c.add(cp);
+                        if (!resRepo.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"));
-                        if (!repo.isCollection(new Path(cp))) c.add(cp);
+                        if (!resRepo.isCollection(new Path(cp))) c.add(cp);
                     }
                 }
             } else {
@@ -172,11 +172,11 @@
                 log.warn("Is not a collection within data repository: " + path);
             }
         } catch(Exception e) {
-            log.error(e);
+            log.error(e.getMessage(), e);
         }
         Node[] nodes = new Node[c.size()];
         for (int i = 0; i < c.size(); i++) {
-            nodes[i] = new NodeResConfigAndDataRepoImpl(repo, dataRepo, (String) c.elementAt(i));
+            nodes[i] = new NodeResConfigAndDataRepoImpl(resRepo, dataRepo, (String) c.elementAt(i));
         }
         return nodes;
     }
@@ -186,7 +186,7 @@
      */
     public Node getParent() {
         try {
-	    return new NodeResConfigAndDataRepoImpl(repo, dataRepo, (String) repo.getNode(path.toString() + ".yanel-rc").getParent().getPath());
+	    return new NodeResConfigAndDataRepoImpl(resRepo, dataRepo, (String) resRepo.getNode(path.toString() + ".yanel-rc").getParent().getPath());
         } catch (Exception e) {
             log.error(e.getMessage(), e);
         }




More information about the Yanel-commits mailing list