Fixed AR-822: Space deletion via FTP or Web Client is improved.

The node is renamed and hidden from FileFolderService clients.  A background task then performs the archival.
A bootstrap component ensures that failed archivals are picked up again.
Found a bug with the status of nodes archived as part of a hierarchy not being updated correctly.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6148 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-07-04 01:03:16 +00:00
parent d2027916c7
commit 6c07ba53c7
12 changed files with 851 additions and 25 deletions

View File

@@ -76,6 +76,7 @@ public class FileFolderServiceImpl implements FileFolderService
"./*" +
"[like(@cm:name, $cm:name, false)" +
" and not (subtypeOf('" + ContentModel.TYPE_SYSTEM_FOLDER + "'))" +
" and not (hasAspect('" + ContentModel.ASPECT_DELETED_NODE + "'))" +
" and (subtypeOf('" + ContentModel.TYPE_FOLDER + "') or subtypeOf('" + ContentModel.TYPE_CONTENT + "')" +
" or subtypeOf('" + ContentModel.TYPE_LINK + "'))]";
@@ -83,6 +84,7 @@ public class FileFolderServiceImpl implements FileFolderService
private static final String LUCENE_QUERY_SHALLOW_ALL =
"+PARENT:\"${cm:parent}\"" +
"-TYPE:\"" + ContentModel.TYPE_SYSTEM_FOLDER + "\" " +
"-ASPECT:\"" + ContentModel.ASPECT_DELETED_NODE + "\" " +
"+(" +
"TYPE:\"" + ContentModel.TYPE_CONTENT + "\" " +
"TYPE:\"" + ContentModel.TYPE_FOLDER + "\" " +
@@ -93,12 +95,14 @@ public class FileFolderServiceImpl implements FileFolderService
private static final String LUCENE_QUERY_SHALLOW_FOLDERS =
"+PARENT:\"${cm:parent}\"" +
"-TYPE:\"" + ContentModel.TYPE_SYSTEM_FOLDER + "\" " +
"-ASPECT:\"" + ContentModel.ASPECT_DELETED_NODE + "\" " +
"+TYPE:\"" + ContentModel.TYPE_FOLDER + "\" ";
/** Shallow search for all files and folders */
private static final String LUCENE_QUERY_SHALLOW_FILES =
"+PARENT:\"${cm:parent}\"" +
"-TYPE:\"" + ContentModel.TYPE_SYSTEM_FOLDER + "\" " +
"-ASPECT:\"" + ContentModel.ASPECT_DELETED_NODE + "\" " +
"+TYPE:\"" + ContentModel.TYPE_CONTENT + "\" ";
/** Deep search for files and folders with a name pattern */
@@ -106,6 +110,7 @@ public class FileFolderServiceImpl implements FileFolderService
".//*" +
"[like(@cm:name, $cm:name, false)" +
" and not (subtypeOf('" + ContentModel.TYPE_SYSTEM_FOLDER + "'))" +
" and not (hasAspect('" + ContentModel.ASPECT_DELETED_NODE + "'))" +
" and (subtypeOf('" + ContentModel.TYPE_FOLDER + "') or subtypeOf('" + ContentModel.TYPE_CONTENT + "')" +
" or subtypeOf('" + ContentModel.TYPE_LINK + "'))]";
@@ -198,11 +203,14 @@ public class FileFolderServiceImpl implements FileFolderService
List<FileInfo> results = new ArrayList<FileInfo>(nodeRefs.size());
for (NodeRef nodeRef : nodeRefs)
{
if (nodeService.exists(nodeRef))
// Ignore missing nodes
if (!nodeService.exists(nodeRef))
{
FileInfo fileInfo = toFileInfo(nodeRef, true);
results.add(fileInfo);
continue;
}
// It's good
FileInfo fileInfo = toFileInfo(nodeRef, true);
results.add(fileInfo);
}
return results;
}
@@ -324,6 +332,10 @@ public class FileFolderServiceImpl implements FileFolderService
public NodeRef searchSimple(NodeRef contextNodeRef, String name)
{
NodeRef childNodeRef = nodeService.getChildByName(contextNodeRef, ContentModel.ASSOC_CONTAINS, name);
if (childNodeRef != null && nodeService.hasAspect(childNodeRef, ContentModel.ASPECT_DELETED_NODE))
{
childNodeRef = null;
}
if (logger.isDebugEnabled())
{
logger.debug(