### Eclipse Workspace Patch 1.0
#P hippo-repository-engine
Index: src/main/java/org/hippoecm/repository/jackrabbit/HippoLocalItemStateManager.java
===================================================================
--- src/main/java/org/hippoecm/repository/jackrabbit/HippoLocalItemStateManager.java	(revision 26450)
+++ src/main/java/org/hippoecm/repository/jackrabbit/HippoLocalItemStateManager.java	(working copy)
@@ -106,7 +106,7 @@
     private Map<NodeId,ItemState> virtualNodes = new HashMap<NodeId,ItemState>();
     Map<ItemId,Object> deletedExternals = new WeakHashMap<ItemId,Object>();
     private NodeId rootNodeId;
-    private boolean virtualLayerEnabled = false;
+    private final boolean virtualLayerEnabled;
     private int virtualLayerEnabledCount = 0;
     private boolean virtualLayerRefreshing = true;
     private boolean parameterizedView = false;
@@ -240,6 +240,7 @@
     protected void update(ChangeLog changeLog) throws ReferentialIntegrityException, StaleItemStateException,
                                                       ItemStateException {
         filteredChangeLog = new FilteredChangeLog(changeLog);
+
         virtualStates.clear();
         virtualNodes.clear();
         filteredChangeLog.invalidate();
@@ -517,6 +518,11 @@
 
         void invalidate() {
             if (!virtualLayerRefreshing) {
+                for (ItemState state : upstream.modifiedStates()) {
+                    if ((isVirtual(state) & ITEM_TYPE_EXTERNAL) != 0) {
+                        forceUpdate((NodeState)state);
+                    }
+                }
                 return;
             }
             Set<ItemId> changedParents = new HashSet<ItemId>();
#P hippo-repository-test
Index: src/test/java/org/hippoecm/repository/CheckoutNodeTest.java
===================================================================
--- src/test/java/org/hippoecm/repository/CheckoutNodeTest.java	(revision 0)
+++ src/test/java/org/hippoecm/repository/CheckoutNodeTest.java	(revision 0)
@@ -0,0 +1,81 @@
+/*
+ *  Copyright 2008 Hippo.
+ * 
+ *  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.hippoecm.repository;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+
+import org.hippoecm.repository.api.HippoNodeType;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class CheckoutNodeTest extends TestCase {
+    @SuppressWarnings("unused")
+    private final static String SVN_ID = "$Id$";
+
+    @Override
+    @Before
+    public void setUp() throws Exception {
+        super.setUp();
+        while(session.getRootNode().hasNode("test")) {
+            session.getRootNode().getNode("test").remove();
+            session.save();
+        }
+    }
+
+    @Override
+    @After
+    public void tearDown() throws Exception {
+        while(session.getRootNode().hasNode("test")) {
+            session.getRootNode().getNode("test").remove();
+            session.save();
+        }
+        super.tearDown();
+    }
+
+    @Test
+    public void testCheckoutWithVirtualNodesPresent() throws RepositoryException {
+        Node node, root = session.getRootNode().addNode("test","nt:unstructured");
+        root.addMixin("mix:referenceable");
+        node = root.addNode("documents");
+        node = node.addNode("document","hippo:testdocument");
+        node.addMixin("hippo:harddocument");
+        node.setProperty("aap", "noot");
+        session.save();
+
+        Node navigation = root.addNode("navigation", "hippo:testdocument");
+        navigation.addMixin("hippo:harddocument");
+        node = navigation.addNode("search",HippoNodeType.NT_FACETSELECT);
+        node.setProperty(HippoNodeType.HIPPO_DOCBASE, session.getRootNode().getNode("test").getUUID());
+        node.setProperty(HippoNodeType.HIPPO_FACETS, new String[0]);
+        node.setProperty(HippoNodeType.HIPPO_VALUES, new String[0]);
+        node.setProperty(HippoNodeType.HIPPO_MODES, new String[0]);
+        session.save();
+        session.refresh(false);
+        navigation.checkin();
+
+        assertTrue(navigation.getNode("search").hasNode("documents"));
+        assertTrue(navigation.getNode("search").getNode("documents").hasNode("document"));
+
+        navigation.checkout();
+
+        assertEquals("documents", root.getNode("navigation").getNode("search").getNode("documents").getName());
+    }
+}

Property changes on: src/test/java/org/hippoecm/repository/CheckoutNodeTest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
Added: svn:keywords
   + Id

