cm:copiedfrom aspect is not applied to copies of type not derived from cm:object

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29292 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2011-07-25 08:45:41 +00:00
parent 18a50d8532
commit a4a5605403
2 changed files with 31 additions and 1 deletions

View File

@@ -596,7 +596,12 @@ public class CopyServiceImpl implements CopyService
originalAssoc.getTargetRef(),
ContentModel.ASSOC_ORIGINAL);
}
internalNodeService.createAssociation(copyTarget, sourceNodeRef, ContentModel.ASSOC_ORIGINAL);
// We create the link if the source is a cm:object
QName sourceTypeQName = internalNodeService.getType(sourceNodeRef);
if (dictionaryService.isSubClass(sourceTypeQName, ContentModel.TYPE_CMOBJECT))
{
internalNodeService.createAssociation(copyTarget, sourceNodeRef, ContentModel.ASSOC_ORIGINAL);
}
// Copy permissions
copyPermissions(sourceNodeRef, copyTarget);