REPO-2257 - Service Pack: MNT-17661: Copy action copies thumbnail modification data

- fix ThumbnailService to use "do nothing" copy behaviour for "cm:thumbnailModification" aspect
- add embedded unit test

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@136840 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2017-05-22 12:17:09 +00:00
parent d8f90ea98d
commit 8c9416b739
2 changed files with 52 additions and 0 deletions

View File

@@ -39,6 +39,10 @@ import org.alfresco.model.ContentModel;
import org.alfresco.repo.content.transform.RuntimeExecutableContentTransformerOptions;
import org.alfresco.repo.content.transform.magick.ImageTransformationOptions;
import org.alfresco.repo.content.transform.swf.SWFTransformationOptions;
import org.alfresco.repo.copy.CopyBehaviourCallback;
import org.alfresco.repo.copy.CopyDetails;
import org.alfresco.repo.copy.CopyServicePolicies;
import org.alfresco.repo.copy.DoNothingCopyBehaviourCallback;
import org.alfresco.repo.node.NodeServicePolicies;
import org.alfresco.repo.policy.Behaviour;
import org.alfresco.repo.policy.BehaviourFilter;
@@ -213,6 +217,12 @@ public class ThumbnailServiceImpl implements ThumbnailService,
ContentModel.TYPE_THUMBNAIL,
new JavaBehaviour(this, "onDeleteNode", Behaviour.NotificationFrequency.EVERY_EVENT));
// Register copy class behaviour
this.policyComponent.bindClassBehaviour(
CopyServicePolicies.OnCopyNodePolicy.QNAME,
ContentModel.ASPECT_THUMBNAIL_MODIFICATION,
new JavaBehaviour(this, "getCopyCallback"));
transactionListener = new ThumbnailTransactionListenerAdapter();
}
@@ -928,4 +938,14 @@ public class ThumbnailServiceImpl implements ThumbnailService,
}, AuthenticationUtil.getSystemUserName());
}
}
/**
* See init - eg. registers "do nothing" copy behaviour for "cm:thumbnailModification" aspect
*
* @return Returns {@link DoNothingCopyBehaviourCallback}
*/
public CopyBehaviourCallback getCopyCallback(QName classRef, CopyDetails copyDetails)
{
return DoNothingCopyBehaviourCallback.getInstance();
}
}