Merged V4.0-BUG-FIX to HEAD

34397: ALF-13064: Updated document lib WebScript to protect against access errors dealing with permissions of locked documents
   34406: ALF-13069: Fix flash upload file selection page title corruption
   34434: ALF-13066: Fix for intermittent failure (testConcurrentLinkToDeletedNode)
   34439: Merged BRANCHES/V4.0 to BRANCHES/DEV/V4.0-BUG-FIX
      34438: Fix to issue where new Hazelcast based Share clustering was broken by a recent SpringSurf change to ServletRequestContextFactory bean config in libs rev 1028 or higher.
   34443: ALF-11433: IE8 specific fix to ensure that document-picker panel is hidden before documents selected event is fired and for TinyMCE to set focus on editor so that content is added correctly
   34457: Merged V3.4-BUG-FIX to V4.0-BUG-FIX
      34354: ALF-12995 - IMAP: File is modified when received as a message in IMAP account
      34444: ALF-12169: Guest/guest/gUest username is now normalized to corresponding person's user ID during authentication, solving problems with synchronization with Active Directory's Guest account
      34454: Java 1.6.0_31 for 3.4.9 and 4.0.2
   34458: Merged V3.4-BUG-FIX to V4.0-BUG-FIX (RECORD ONLY)
      34392: ALF-13146: Merged V4.0-BUG-FIX to V3.4-BUG-FIX
         33813: ALF-12736: Stack specific: 'Getting updates failed' notification appears when non-admin user creats DWS
            - From Pavel: "Some users from ldap don't have lastName. That is why NPE occurs."
   34459: Merged V4.0 to V4.0-BUG-FIX
      34391: Merged DEV to V4.0 (with corrections)
         34390: ALF-13013 : It's impossible to change Activities Feed properties on Websphere
            Now the Schedule subtree in JMX is set to the correct MBeanServer.
      34407: Merged HEAD-2011_12_06 to V4.0 (4.0.1)
         Updated copyrights 
         32813: ALF-4098: WCM: Assets in in-flight worflow are allowed to be edited.
         Ability of editing assets submitted to 'in-flight' workflow has been removed:
         - .AVMSyncService. service interface was expanded with new method .List<AVMDifference> compare(int srcVersion, String srcPath, int dstVersion, String dstPath, NameMatcher excluder, boolean expandDirs). to introduce ability of collecting all created/modified items in created/modified folder;
         - all .AVMSyncService. implementations were expanded in accordance with changes in interface;
         - new tests for newly created items, items in modified folder and for deleted items in modified folder were added
      34414: ALF-11607: Bootstrap fails against database 'DB2/LINUXX8664'
      - Patched hibernate jar to recognize DB2 64 bit Linux
      34416: ALF-12992: Updated weblogic DD for SOLR


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@34460 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Dave Ward
2012-03-06 19:50:32 +00:00
parent 55fbe62f91
commit 8521d6e2dc
15 changed files with 2545 additions and 2110 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2010 Alfresco Software Limited.
* Copyright (C) 2005-2012 Alfresco Software Limited.
*
* This file is part of Alfresco
*
@@ -110,9 +110,15 @@ public class AVMSyncServiceImpl implements AVMSyncService
public List<AVMDifference> compare(int srcVersion, String srcPath,
int dstVersion, String dstPath,
NameMatcher excluder)
{
return compare(srcVersion, srcPath, dstVersion, dstPath, excluder, false);
}
@Override
public List<AVMDifference> compare(int srcVersion, String srcPath, int dstVersion, String dstPath, NameMatcher excluder, boolean expandDirs)
{
long start = System.currentTimeMillis();
if (logger.isDebugEnabled())
{
logger.debug(srcPath + " : " + dstPath);
@@ -131,21 +137,20 @@ public class AVMSyncServiceImpl implements AVMSyncService
if (dstDesc == null)
{
// Special case: no pre-existing version in the destination.
result.add(new AVMDifference(srcVersion, srcPath,
dstVersion, dstPath,
AVMDifference.NEWER));
result.add(new AVMDifference(srcVersion, srcPath, dstVersion, dstPath, AVMDifference.NEWER));
}
else
{
// Invoke the recursive implementation.
compare(srcVersion, srcDesc, dstVersion, dstDesc, result, excluder, true);
compare(srcVersion, srcDesc, dstVersion, dstDesc, result, excluder, true, expandDirs);
}
if (logger.isDebugEnabled())
{
logger.debug("Raw compare: ["+srcVersion+","+srcPath+"]["+dstVersion+","+dstPath+"]["+result.size()+"] in "+(System.currentTimeMillis()-start)+" msecs");
logger.debug("Raw compare: [" + srcVersion + "," + srcPath + "][" + dstVersion + "," + dstPath + "][" + result.size() + "] in " + (System.currentTimeMillis() - start)
+ " msecs");
}
return result;
}
@@ -158,7 +163,7 @@ public class AVMSyncServiceImpl implements AVMSyncService
*/
private void compare(int srcVersion, AVMNodeDescriptor srcDesc,
int dstVersion, AVMNodeDescriptor dstDesc,
List<AVMDifference> result, NameMatcher excluder, boolean firstLevel)
List<AVMDifference> result, NameMatcher excluder, boolean firstLevel, boolean expandDirs)
{
String srcPath = srcDesc.getPath();
String dstPath = dstDesc.getPath();
@@ -225,6 +230,13 @@ public class AVMSyncServiceImpl implements AVMSyncService
result.add(new AVMDifference(srcVersion, srcPath,
dstVersion, dstPath,
dirDiffCode));
// Also add all child items if necessary and any exists
if (expandDirs)
{
addNewChildrenIfAny(srcVersion, srcDesc, dstVersion, AVMNodeConverter.ExtendAVMPath(dstPath, dstDesc.getName()), result);
}
return; // short circuit
}
case AVMDifference.SAME :
@@ -269,12 +281,19 @@ public class AVMSyncServiceImpl implements AVMSyncService
result.add(new AVMDifference(srcVersion, srcChildPath,
dstVersion, dstChildPath,
AVMDifference.NEWER));
// Also add all child items if necessary and any exists
if (expandDirs)
{
addNewChildrenIfAny(srcVersion, srcChild, dstVersion, dstChildPath, result);
}
continue;
}
// Otherwise recursively invoke.
compare(srcVersion, srcChild,
dstVersion, dstChild,
result, excluder, false);
result, excluder, false, expandDirs);
}
return;
}
@@ -344,7 +363,7 @@ public class AVMSyncServiceImpl implements AVMSyncService
// Otherwise, recursively invoke.
compare(srcVersion, srcChild,
dstVersion, dstChild,
result, excluder, false);
result, excluder, false, expandDirs);
}
return;
}
@@ -378,7 +397,7 @@ public class AVMSyncServiceImpl implements AVMSyncService
// Otherwise recursive invocation.
compare(srcVersion, srcChild,
dstVersion, dstChild,
result, excluder, false);
result, excluder, false, expandDirs);
}
// Iterate over the destination.
for (String name : dstList.keySet())
@@ -412,6 +431,32 @@ public class AVMSyncServiceImpl implements AVMSyncService
}
}
private void addNewChildrenIfAny(int srcVersion, AVMNodeDescriptor srcChild, int dstVersion, String dstChildPath, List<AVMDifference> result)
{
Map<String, AVMNodeDescriptor> srcList = fAVMService.getDirectoryListingDirect(srcChild, true);
for (String name : srcList.keySet())
{
srcChild = srcList.get(name);
String srcChildPath = srcChild.getPath();
String dstPath = AVMNodeConverter.ExtendAVMPath(dstChildPath, name);
AVMNodeDescriptor dstDesc = fAVMService.lookup(dstVersion, dstChildPath, true);
int diffCode = AVMDifference.NEWER;
if (null == dstDesc)
{
diffCode = AVMDifference.NEWER;
}
result.add(new AVMDifference(srcVersion, srcChildPath, dstVersion, dstPath, diffCode));
if (srcChild.isDirectory())
{
addNewChildrenIfAny(srcVersion, srcChild, dstVersion, dstPath, result);
}
}
}
/**
* Updates the destination nodes in the AVMDifferences
* with the source nodes. Normally any conflicts or cases in