mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
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:
@@ -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<QName> 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();
|
||||
|
@@ -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<QName, PropertyValue> 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<QName, PropertyValue> 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<QName> 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.");
|
||||
|
Reference in New Issue
Block a user