Merged V3.2 to HEAD

17307: Merged DEV/BELARUS/V3.2-2009_10_19 to V3.2
       17121: ETHREEOH-2999: Accessing Recent snapshots fails in a web project that is created from an already existing project 
       17223: ETHREEEOH-2999: (post-review changes)
   17346: ETHREEOH-2824 - further perf improvement for multiple single submits (to active workflow sandboxes) from large modified list
   17375: Fix ETHREEOH-1643 - WCM revert file & version history, including a few unreported WCM / UI revert file issues
   17380: ETHREEOH-1643 - fix build/test fallout


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@18110 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2010-01-19 10:26:45 +00:00
parent bb3c8a1244
commit 8db9d90a72
6 changed files with 116 additions and 53 deletions

View File

@@ -961,30 +961,28 @@ public class SandboxServiceImpl implements SandboxService
List<AssetInfo> assetsToRevert = new ArrayList<AssetInfo>(assets.size());
List<WorkflowTask> tasks = null;
List<String> wfRelativePaths = WCMWorkflowUtil.getAssociatedPathsForSandbox(avmSyncService, workflowService, sbStoreId);
for (AssetInfo asset : assets)
{
if (tasks == null)
if (! asset.getSandboxId().equals(sbStoreId))
{
tasks = WCMWorkflowUtil.getAssociatedTasksForSandbox(workflowService, WCMUtil.getSandboxStoreId(asset.getAvmPath()));
// belts-and-braces
logger.warn("revertListAssets: Skip assert "+asset.getPath()+" (was "+asset.getSandboxId()+", expected "+sbStoreId+")");
continue;
}
// TODO refactor getAssociatedTasksForNode to use AssetInfo instead of AVMNodeDescriptor
AVMNodeDescriptor node = ((AssetInfoImpl)asset).getAVMNodeDescriptor();
if (node != null)
// check if in workflow
if (! wfRelativePaths.contains(asset.getPath()))
{
if (WCMWorkflowUtil.getAssociatedTasksForNode(avmService, node, tasks).size() == 0)
{
assetsToRevert.add(asset);
if (VirtServerUtils.requiresUpdateNotification(asset.getAvmPath()))
{
// Bind the post-commit transaction listener with data required for virtualization server notification
UpdateSandboxTransactionListener tl = new UpdateSandboxTransactionListener(asset.getAvmPath());
AlfrescoTransactionSupport.bindListener(tl);
}
}
assetsToRevert.add(asset);
if (VirtServerUtils.requiresUpdateNotification(asset.getAvmPath()))
{
// Bind the post-commit transaction listener with data required for virtualization server notification
UpdateSandboxTransactionListener tl = new UpdateSandboxTransactionListener(asset.getAvmPath());
AlfrescoTransactionSupport.bindListener(tl);
}
}
}