]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - server/plugins/org.argeo.jcr.ui.explorer/src/main/java/org/argeo/jcr/ui/explorer/model/SingleJcrNode.java
Refactor JCR utils and home usage
[lgpl/argeo-commons.git] / server / plugins / org.argeo.jcr.ui.explorer / src / main / java / org / argeo / jcr / ui / explorer / model / SingleJcrNode.java
index 03ac5222661cd4771d2435d6702f52ed5377a3ea..1da156a9ba2477f690cf4604fd5517f7ae9f8495 100644 (file)
@@ -1,3 +1,18 @@
+/*
+ * Copyright (C) 2007-2012 Mathieu Baudier
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.argeo.jcr.ui.explorer.model;
 
 import javax.jcr.Node;
@@ -65,7 +80,7 @@ public class SingleJcrNode extends TreeParent implements UiNode {
        }
 
        /**
-        * Override normal behaviour to initialize children only when first
+        * Override normal behavior to initialize children only when first
         * requested
         */
        @Override
@@ -92,7 +107,10 @@ public class SingleJcrNode extends TreeParent implements UiNode {
        @Override
        public boolean hasChildren() {
                try {
-                       return node.hasNodes();
+                       if (node.getSession().isLive())
+                               return node.hasNodes();
+                       else
+                               return false;
                } catch (RepositoryException re) {
                        throw new ArgeoException(
                                        "Unexpected error while checking children node existence",