Deleted nodes can now have aspects, properties, acls added, queried. Kind of

dumb that they couldn't before.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4646 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-12-18 20:25:31 +00:00
parent f91c7d874a
commit b3933922b2
2 changed files with 19 additions and 12 deletions

View File

@@ -3110,6 +3110,10 @@ public class AVMServiceTest extends AVMServiceTestBase
fService.createSnapshot("main", null, null); fService.createSnapshot("main", null, null);
props = fService.getNodeProperties(-1, "main:/a/b/c/bar"); props = fService.getNodeProperties(-1, "main:/a/b/c/bar");
assertEquals(0, props.size()); 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) 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_TITLED);
fService.addAspect("main:/a/b/c/foo", ContentModel.ASPECT_AUDITABLE); fService.addAspect("main:/a/b/c/foo", ContentModel.ASPECT_AUDITABLE);
fService.createSnapshot("main", null, null); fService.createSnapshot("main", null, null);
fService.removeNode("main:/a/b/c/bar");
fService.addAspect("main:/a/b/c/bar", ContentModel.ASPECT_TITLED);
List<QName> names = fService.getAspects(-1, "main:/a/b/c/foo"); List<QName> names = fService.getAspects(-1, "main:/a/b/c/foo");
assertEquals(2, names.size()); assertEquals(2, names.size());
assertTrue(fService.hasAspect(-1, "main:/a/b/c/foo", ContentModel.ASPECT_TITLED)); assertTrue(fService.hasAspect(-1, "main:/a/b/c/foo", ContentModel.ASPECT_TITLED));
assertFalse(fService.hasAspect(-1, "main:/a/b/c/foo", ContentModel.ASPECT_AUTHOR)); 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.removeAspect("main:/a/b/c/foo", ContentModel.ASPECT_TITLED);
fService.createSnapshot("main", null, null); fService.createSnapshot("main", null, null);
fService.getFileOutputStream("main:/a/b/c/foo").close(); fService.getFileOutputStream("main:/a/b/c/foo").close();

View File

@@ -932,7 +932,7 @@ public class AVMStoreImpl implements AVMStore, Serializable
*/ */
public void setNodeProperty(String path, QName name, PropertyValue value) 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) if (lPath == null)
{ {
throw new AVMNotFoundException("Path not found."); throw new AVMNotFoundException("Path not found.");
@@ -948,7 +948,7 @@ public class AVMStoreImpl implements AVMStore, Serializable
*/ */
public void setNodeProperties(String path, Map<QName, PropertyValue> properties) public void setNodeProperties(String path, Map<QName, PropertyValue> properties)
{ {
Lookup lPath = lookup(-1, path, true, false); Lookup lPath = lookup(-1, path, true, true);
if (lPath == null) if (lPath == null)
{ {
throw new AVMNotFoundException("Path not found."); 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) 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) if (lPath == null)
{ {
throw new AVMNotFoundException("Path not found."); throw new AVMNotFoundException("Path not found.");
@@ -983,7 +983,7 @@ public class AVMStoreImpl implements AVMStore, Serializable
*/ */
public Map<QName, PropertyValue> getNodeProperties(int version, String path) public Map<QName, PropertyValue> getNodeProperties(int version, String path)
{ {
Lookup lPath = lookup(version, path, false, false); Lookup lPath = lookup(version, path, false, true);
if (lPath == null) if (lPath == null)
{ {
throw new AVMNotFoundException("Path not found."); throw new AVMNotFoundException("Path not found.");
@@ -999,7 +999,7 @@ public class AVMStoreImpl implements AVMStore, Serializable
*/ */
public void deleteNodeProperty(String path, QName name) public void deleteNodeProperty(String path, QName name)
{ {
Lookup lPath = lookup(-1, path, true, false); Lookup lPath = lookup(-1, path, true, true);
if (lPath == null) if (lPath == null)
{ {
throw new AVMNotFoundException("Path not found."); throw new AVMNotFoundException("Path not found.");
@@ -1014,7 +1014,7 @@ public class AVMStoreImpl implements AVMStore, Serializable
*/ */
public void deleteNodeProperties(String path) public void deleteNodeProperties(String path)
{ {
Lookup lPath = lookup(-1, path, true, false); Lookup lPath = lookup(-1, path, true, true);
if (lPath == null) if (lPath == null)
{ {
throw new AVMNotFoundException("Path not found."); throw new AVMNotFoundException("Path not found.");
@@ -1158,7 +1158,7 @@ public class AVMStoreImpl implements AVMStore, Serializable
*/ */
public void setMetaDataFrom(String path, AVMNode from) public void setMetaDataFrom(String path, AVMNode from)
{ {
Lookup lPath = lookup(-1, path, true, false); Lookup lPath = lookup(-1, path, true, true);
if (lPath == null) if (lPath == null)
{ {
throw new AVMNotFoundException("Path not found: " + path); throw new AVMNotFoundException("Path not found: " + path);
@@ -1174,7 +1174,7 @@ public class AVMStoreImpl implements AVMStore, Serializable
*/ */
public void addAspect(String path, QName aspectName) public void addAspect(String path, QName aspectName)
{ {
Lookup lPath = lookup(-1, path, true, false); Lookup lPath = lookup(-1, path, true, true);
if (lPath == null) if (lPath == null)
{ {
throw new AVMNotFoundException("Path not found."); throw new AVMNotFoundException("Path not found.");
@@ -1199,7 +1199,7 @@ public class AVMStoreImpl implements AVMStore, Serializable
*/ */
public List<QName> getAspects(int version, String path) public List<QName> getAspects(int version, String path)
{ {
Lookup lPath = lookup(version, path, false, false); Lookup lPath = lookup(version, path, false, true);
if (lPath == null) if (lPath == null)
{ {
throw new AVMNotFoundException("Path not found."); throw new AVMNotFoundException("Path not found.");
@@ -1222,7 +1222,7 @@ public class AVMStoreImpl implements AVMStore, Serializable
*/ */
public void removeAspect(String path, QName aspectName) public void removeAspect(String path, QName aspectName)
{ {
Lookup lPath = lookup(-1, path, true, false); Lookup lPath = lookup(-1, path, true, true);
if (lPath == null) if (lPath == null)
{ {
throw new AVMNotFoundException("Path not found."); 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) 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) if (lPath == null)
{ {
throw new AVMNotFoundException("Path not found."); throw new AVMNotFoundException("Path not found.");
@@ -1263,7 +1263,7 @@ public class AVMStoreImpl implements AVMStore, Serializable
*/ */
public void setACL(String path, DbAccessControlList acl) public void setACL(String path, DbAccessControlList acl)
{ {
Lookup lPath = lookup(-1, path, true, false); Lookup lPath = lookup(-1, path, true, true);
if (lPath == null) if (lPath == null)
{ {
throw new AVMNotFoundException("Path not found."); throw new AVMNotFoundException("Path not found.");