mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.2 to HEAD
16737: Fix for ETHREEOH-2903: MSSQL bootstrap failed : "n must be positive" 16826: Missing merge metadata on root from previous check-in CHK-9689 16847: Merged V3.1 to V3.2 16835: Build fix after PDFBox lib change 16915: (RECORD ONLY) Removed deep svn:mergeinfo 16923: Lucene performance: avoid too many index deltas ... 16933: Fix ETHREEOH-1788 - Bootstrap fails due to disabled-avm-indexing-context.xml 16935: Merged V3.1 to V3.2 15894: Fix ETHREEOH-2416 and ALFCOM-3300: Duplicate name exceptions not being trapped correctly 16936: Merged V3.1 to V3.2 16672: Fixed ETHREEOH-2021: System error appears when trying to paste content 16686: Fixed ETHREEOH-2129: HibernateNodeDaoService implementation does not cater for a null condition ___________________________________________________________________ Modified: svn:mergeinfo Merged /alfresco/BRANCHES/V3.1:r15894,16672,16686,16811,16816,16835 Merged /alfresco/BRANCHES/V3.2:r16737,16826,16847,16915,16923,16933,16935-16936 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@17015 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -64,6 +64,7 @@ import org.alfresco.service.cmr.search.QueryParameterDefinition;
|
||||
import org.alfresco.service.cmr.search.SearchService;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.GUID;
|
||||
import org.alfresco.util.SearchLanguageConversion;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
@@ -571,23 +572,18 @@ public class FileFolderServiceImpl implements FileFolderService
|
||||
targetParentRef = assocRef.getParentRef();
|
||||
}
|
||||
|
||||
boolean changedParent = !targetParentRef.equals(assocRef.getParentRef());
|
||||
// there is nothing to do if both the name and parent folder haven't changed
|
||||
if (targetParentRef.equals(assocRef.getParentRef()))
|
||||
if (!nameChanged && !changedParent)
|
||||
{
|
||||
if (newName.equals(beforeFileInfo.getName()))
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Doing nothing - neither filename or parent has changed: \n" +
|
||||
" parent: " + targetParentRef + "\n" +
|
||||
" before: " + beforeFileInfo + "\n" +
|
||||
" new name: " + newName);
|
||||
}
|
||||
return beforeFileInfo;
|
||||
}
|
||||
else if (newName.equalsIgnoreCase(beforeFileInfo.getName()))
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Doing nothing - neither filename or parent has changed: \n" +
|
||||
" parent: " + targetParentRef + "\n" +
|
||||
" before: " + beforeFileInfo + "\n" +
|
||||
" new name: " + newName);
|
||||
}
|
||||
return beforeFileInfo;
|
||||
}
|
||||
|
||||
QName existingQName = assocRef.getQName();
|
||||
@@ -629,13 +625,29 @@ public class FileFolderServiceImpl implements FileFolderService
|
||||
// TODO: Replace this with a more formal means of identifying "system" folders (i.e. aspect or UUID)
|
||||
if (!isSystemPath(sourceNodeRef))
|
||||
{
|
||||
// move the node so that the association moves as well
|
||||
ChildAssociationRef newAssocRef = nodeService.moveNode(
|
||||
sourceNodeRef,
|
||||
targetParentRef,
|
||||
assocTypeQname,
|
||||
qname);
|
||||
targetNodeRef = newAssocRef.getChildRef();
|
||||
// The cm:name might clash with another node in the target location.
|
||||
if (nameChanged)
|
||||
{
|
||||
// The name will be changing, so we really need to set the node's name to the new
|
||||
// name. This can't be done at the same time as the move - to avoid incorrect violations
|
||||
// of the name constraints, the cm:name is set to something random and will be reset
|
||||
// to the correct name later.
|
||||
nodeService.setProperty(sourceNodeRef, ContentModel.PROP_NAME, GUID.generate());
|
||||
}
|
||||
try
|
||||
{
|
||||
// move the node so that the association moves as well
|
||||
ChildAssociationRef newAssocRef = nodeService.moveNode(
|
||||
sourceNodeRef,
|
||||
targetParentRef,
|
||||
assocTypeQname,
|
||||
qname);
|
||||
targetNodeRef = newAssocRef.getChildRef();
|
||||
}
|
||||
catch (DuplicateChildNodeNameException e)
|
||||
{
|
||||
throw new FileExistsException(targetParentRef, newName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -647,7 +659,7 @@ public class FileFolderServiceImpl implements FileFolderService
|
||||
{
|
||||
try
|
||||
{
|
||||
// copy the node
|
||||
// Copy the node. The cm:name will be dropped and reset later.
|
||||
targetNodeRef = copyService.copy(
|
||||
sourceNodeRef,
|
||||
targetParentRef,
|
||||
|
Reference in New Issue
Block a user