This exposes DeletedNodes through AVMService via calls for lookup

and directory listing that take an includeLinks flag.  Original calls 
(w/o a flag) should have unchanged behavior. 


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3752 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-09-11 00:00:57 +00:00
parent 8a95b09b98
commit 5e0378deb2
12 changed files with 329 additions and 92 deletions

View File

@@ -107,12 +107,30 @@ public class AVMServiceImpl implements AVMService
* @param path The path to lookup.
*/
public SortedMap<String, AVMNodeDescriptor> getDirectoryListing(int version, String path)
{
return getDirectoryListing(version, path, false);
}
/**
* Get a listing of a Folder by name, with the option of seeing
* Deleted Nodes.
* @param version The version id to look in.
* @param path The simple absolute path to the file node.
* @param includeDeleted Whether to see Deleted Nodes.
* @return A Map of names to descriptors.
* @throws AVMNotFoundException If <code>path</code> is not found.
* @throws AVMWrongTypeException If <code>path</code> contains a non-terminal
* component that is not a directory, or if <code>path</code> is not pointing
* at a directory.
*/
public SortedMap<String, AVMNodeDescriptor> getDirectoryListing(int version, String path,
boolean includeDeleted)
{
if (path == null)
{
throw new AVMBadArgumentException("Null path.");
}
return fAVMRepository.getListing(version, path);
return fAVMRepository.getListing(version, path, includeDeleted);
}
/**
@@ -128,26 +146,59 @@ public class AVMServiceImpl implements AVMService
*/
public SortedMap<String, AVMNodeDescriptor>
getDirectoryListingDirect(int version, String path)
{
return getDirectoryListingDirect(version, path, false);
}
/**
* Get the listing of nodes contained directly in a directory. This is the
* same as getDirectoryListing for PlainDirectories, but returns only those that
* are directly contained in a layered directory. This has the option of
* seeing Deleted Nodes.
* @param version The version to look up.
* @param path The full path to get listing for.
* @param includeDeleted Whether to see Deleted Nodes.
* @return A Map of names to descriptors.
* @throws AVMNotFoundException If <code>path</code> does not exist.
* @throws AVMWrongTypeException If <code>path</code> contains any non-directory
* elements.
*/
public SortedMap<String, AVMNodeDescriptor>
getDirectoryListingDirect(int version, String path, boolean includeDeleted)
{
if (path == null)
{
throw new AVMBadArgumentException("Null path.");
}
return fAVMRepository.getListingDirect(version, path);
return fAVMRepository.getListingDirect(version, path, includeDeleted);
}
/**
* Get a directory listing from a node descriptor.
* @param dir The directory node descriptor.
* @return A Map of names to node descriptors.
*/
public SortedMap<String, AVMNodeDescriptor> getDirectoryListing(AVMNodeDescriptor dir)
{
return getDirectoryListing(dir, false);
}
/**
* Get a directory listing from a node descriptor, with the option of
* seeing deleted nodes.
* @param dir The directory node descriptor.
* @param includeDeleted Whether to see Deleted Nodes.
* @return A Map of names to node descriptors.
* @throws AVMNotFoundException If the descriptor is stale.
* @throws AVMWrongTypeException If the descriptor does not point at a directory.
*/
public SortedMap<String, AVMNodeDescriptor> getDirectoryListing(AVMNodeDescriptor dir,
boolean includeDeleted)
{
if (dir == null)
{
throw new AVMBadArgumentException("Null descriptor.");
}
return fAVMRepository.getListing(dir);
return fAVMRepository.getListing(dir, includeDeleted);
}
/**
@@ -398,12 +449,29 @@ public class AVMServiceImpl implements AVMService
* @return A Descriptor.
*/
public AVMNodeDescriptor lookup(int version, String path)
{
return lookup(version, path, false);
}
/**
* Lookup a node by version ids and path, with the option of
* seeing Deleted Nodes.
* @param version The version id to look under.
* @param path The simple absolute path to the parent directory.
* @param includeDeleted Whether to see Deleted Nodes.
* @return An AVMNodeDescriptor.
* @throws AVMNotFoundException If <code>path</code> does not exist or
* if <code>version</code> does not exist.
* @throws AVMWrongTypeException If <code>path</code> contains a non-terminal
* element that is not a directory.
*/
public AVMNodeDescriptor lookup(int version, String path, boolean includeDeleted)
{
if (path == null)
{
throw new AVMBadArgumentException("Path is null.");
}
Lookup lookup = fAVMRepository.lookup(version, path);
Lookup lookup = fAVMRepository.lookup(version, path, includeDeleted);
return lookup.getCurrentNode().getDescriptor(lookup);
}
@@ -414,14 +482,30 @@ public class AVMServiceImpl implements AVMService
* @return The node descriptor of the child.
*/
public AVMNodeDescriptor lookup(AVMNodeDescriptor dir, String name)
{
return lookup(dir, name, false);
}
/**
* Lookup a node from a directory node, with the option of seeing
* Deleted Nodes.
* @param dir The descriptor for the directory node.
* @param name The name to lookup.
* @param includeDeleted Whether to see Deleted Nodes.
* @return The descriptor for the child.
* @throws AVMNotFoundException If <code>name</code> does not exist or
* if <code>dir</code> is dangling.
* @throws AVMWrongTypeException If <code>dir</code> does not refer to a directory.
*/
public AVMNodeDescriptor lookup(AVMNodeDescriptor dir, String name, boolean includeDeleted)
{
if (dir == null || name == null)
{
throw new AVMBadArgumentException("Illegal null argument.");
}
return fAVMRepository.lookup(dir, name);
return fAVMRepository.lookup(dir, name, includeDeleted);
}
/**
* Purge an AVMStore. Permanently delete everything that
* is only referenced in that AVMStore.