diff --git a/source/java/org/alfresco/repo/avm/AVMServiceTest.java b/source/java/org/alfresco/repo/avm/AVMServiceTest.java index d0637847a5..b6ec58d256 100644 --- a/source/java/org/alfresco/repo/avm/AVMServiceTest.java +++ b/source/java/org/alfresco/repo/avm/AVMServiceTest.java @@ -3110,6 +3110,10 @@ public class AVMServiceTest extends AVMServiceTestBase fService.createSnapshot("main", null, null); props = fService.getNodeProperties(-1, "main:/a/b/c/bar"); assertEquals(0, props.size()); + fService.removeNode("main:/a/b/c/foo"); + fService.setNodeProperty("main:/a/b/c/foo", QName.createQName("silly.uri", "Prop1"), + new PropertyValue(null, 42)); + assertEquals(1, fService.getNodeProperties(-1, "main:/a/b/c/foo").size()); } catch (Exception e) { @@ -3167,10 +3171,13 @@ public class AVMServiceTest extends AVMServiceTestBase fService.addAspect("main:/a/b/c/foo", ContentModel.ASPECT_TITLED); fService.addAspect("main:/a/b/c/foo", ContentModel.ASPECT_AUDITABLE); fService.createSnapshot("main", null, null); + fService.removeNode("main:/a/b/c/bar"); + fService.addAspect("main:/a/b/c/bar", ContentModel.ASPECT_TITLED); List names = fService.getAspects(-1, "main:/a/b/c/foo"); assertEquals(2, names.size()); assertTrue(fService.hasAspect(-1, "main:/a/b/c/foo", ContentModel.ASPECT_TITLED)); assertFalse(fService.hasAspect(-1, "main:/a/b/c/foo", ContentModel.ASPECT_AUTHOR)); + assertTrue(fService.hasAspect(-1, "main:/a/b/c/foo", ContentModel.ASPECT_TITLED)); fService.removeAspect("main:/a/b/c/foo", ContentModel.ASPECT_TITLED); fService.createSnapshot("main", null, null); fService.getFileOutputStream("main:/a/b/c/foo").close(); diff --git a/source/java/org/alfresco/repo/avm/AVMStoreImpl.java b/source/java/org/alfresco/repo/avm/AVMStoreImpl.java index 71ef2b09c1..accbe76685 100644 --- a/source/java/org/alfresco/repo/avm/AVMStoreImpl.java +++ b/source/java/org/alfresco/repo/avm/AVMStoreImpl.java @@ -932,7 +932,7 @@ public class AVMStoreImpl implements AVMStore, Serializable */ public void setNodeProperty(String path, QName name, PropertyValue value) { - Lookup lPath = lookup(-1, path, true, false); + Lookup lPath = lookup(-1, path, true, true); if (lPath == null) { throw new AVMNotFoundException("Path not found."); @@ -948,7 +948,7 @@ public class AVMStoreImpl implements AVMStore, Serializable */ public void setNodeProperties(String path, Map properties) { - Lookup lPath = lookup(-1, path, true, false); + Lookup lPath = lookup(-1, path, true, true); if (lPath == null) { throw new AVMNotFoundException("Path not found."); @@ -966,7 +966,7 @@ public class AVMStoreImpl implements AVMStore, Serializable */ public PropertyValue getNodeProperty(int version, String path, QName name) { - Lookup lPath = lookup(version, path, false, false); + Lookup lPath = lookup(version, path, false, true); if (lPath == null) { throw new AVMNotFoundException("Path not found."); @@ -983,7 +983,7 @@ public class AVMStoreImpl implements AVMStore, Serializable */ public Map getNodeProperties(int version, String path) { - Lookup lPath = lookup(version, path, false, false); + Lookup lPath = lookup(version, path, false, true); if (lPath == null) { throw new AVMNotFoundException("Path not found."); @@ -999,7 +999,7 @@ public class AVMStoreImpl implements AVMStore, Serializable */ public void deleteNodeProperty(String path, QName name) { - Lookup lPath = lookup(-1, path, true, false); + Lookup lPath = lookup(-1, path, true, true); if (lPath == null) { throw new AVMNotFoundException("Path not found."); @@ -1014,7 +1014,7 @@ public class AVMStoreImpl implements AVMStore, Serializable */ public void deleteNodeProperties(String path) { - Lookup lPath = lookup(-1, path, true, false); + Lookup lPath = lookup(-1, path, true, true); if (lPath == null) { throw new AVMNotFoundException("Path not found."); @@ -1158,7 +1158,7 @@ public class AVMStoreImpl implements AVMStore, Serializable */ public void setMetaDataFrom(String path, AVMNode from) { - Lookup lPath = lookup(-1, path, true, false); + Lookup lPath = lookup(-1, path, true, true); if (lPath == null) { throw new AVMNotFoundException("Path not found: " + path); @@ -1174,7 +1174,7 @@ public class AVMStoreImpl implements AVMStore, Serializable */ public void addAspect(String path, QName aspectName) { - Lookup lPath = lookup(-1, path, true, false); + Lookup lPath = lookup(-1, path, true, true); if (lPath == null) { throw new AVMNotFoundException("Path not found."); @@ -1199,7 +1199,7 @@ public class AVMStoreImpl implements AVMStore, Serializable */ public List getAspects(int version, String path) { - Lookup lPath = lookup(version, path, false, false); + Lookup lPath = lookup(version, path, false, true); if (lPath == null) { throw new AVMNotFoundException("Path not found."); @@ -1222,7 +1222,7 @@ public class AVMStoreImpl implements AVMStore, Serializable */ public void removeAspect(String path, QName aspectName) { - Lookup lPath = lookup(-1, path, true, false); + Lookup lPath = lookup(-1, path, true, true); if (lPath == null) { throw new AVMNotFoundException("Path not found."); @@ -1247,7 +1247,7 @@ public class AVMStoreImpl implements AVMStore, Serializable */ public boolean hasAspect(int version, String path, QName aspectName) { - Lookup lPath = lookup(version, path, false, false); + Lookup lPath = lookup(version, path, false, true); if (lPath == null) { throw new AVMNotFoundException("Path not found."); @@ -1263,7 +1263,7 @@ public class AVMStoreImpl implements AVMStore, Serializable */ public void setACL(String path, DbAccessControlList acl) { - Lookup lPath = lookup(-1, path, true, false); + Lookup lPath = lookup(-1, path, true, true); if (lPath == null) { throw new AVMNotFoundException("Path not found.");