Fix to AVMSubmitPackageHandler to handle folders in a workflow and recursively unlock files in a folder.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6059 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2007-06-21 19:46:44 +00:00
parent 12e8663942
commit 7873ce384e

View File

@@ -117,7 +117,7 @@ public class AVMSubmitPackageHandler extends JBPMSpringActionHandler implements
for (final AVMDifference diff : stagingDiffs)
{
fAVMSubmittedAspect.clearSubmitted(diff.getSourceVersion(), diff.getSourcePath());
this.fAVMLockingService.removeLock(webProject, diff.getSourcePath().substring(diff.getSourcePath().indexOf(":") + 1));
recursivelyRemoveLocks(webProject, diff.getSourceVersion(), diff.getSourcePath());
}
// Allow AVMSubmitTransactionListener to inspect the staging diffs
@@ -145,4 +145,21 @@ public class AVMSubmitPackageHandler extends JBPMSpringActionHandler implements
fAVMSyncService.flatten(from, targetPath);
}
}
private void recursivelyRemoveLocks(String webProject, int version, String path)
{
AVMNodeDescriptor desc = fAVMService.lookup(version, path, true);
if (desc.isFile() || desc.isDeletedFile())
{
fAVMLockingService.removeLock(webProject, path.substring(path.indexOf(":") + 1));
}
else
{
Map<String, AVMNodeDescriptor> list = fAVMService.getDirectoryListing(version, path, true);
for (AVMNodeDescriptor child : list.values())
{
recursivelyRemoveLocks(webProject, version, child.getPath());
}
}
}
}