Added getDirectoryListingDirect() and getDeleted() to AVMService

interface.  These return respectively those nodes directly
contained by a directory and the names of those nodes that
have been deleted in a directory.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3383 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-07-24 00:35:18 +00:00
parent 9e560d2d38
commit 55c4d49fbf
9 changed files with 300 additions and 2 deletions

View File

@@ -17,6 +17,7 @@
package org.alfresco.repo.avm;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -349,6 +350,21 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
return listing;
}
/**
* Get a listing of the nodes directly contained by a directory.
* @param lPath The Lookup to this directory.
* @return A Map of names to nodes.
*/
public Map<String, AVMNode> getListingDirect(Lookup lPath)
{
Map<String, AVMNode> listing = new HashMap<String, AVMNode>();
for (ChildEntry entry : AVMContext.fgInstance.fChildEntryDAO.getByParent(this))
{
listing.put(entry.getName(), entry.getChild());
}
return listing;
}
/**
* Get a listing from a directory node descriptor.
* @param dir The directory node descriptor.
@@ -401,6 +417,21 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
return baseListing;
}
/**
* Get the names of nodes deleted in this directory.
* @return A List of names.
*/
public List<String> getDeletedNames()
{
List<DeletedChild> deleted = getDeleted();
List<String> listing = new ArrayList<String>();
for (DeletedChild child : deleted)
{
listing.add(child.getName());
}
return listing;
}
/**
* Lookup a child by name.
* @param lPath The Lookup.