ALF-8882 Edit Online: Modifier and Modified date are changed even no changes were applied

- needed to turn off ASPECT_AUDITABLE on removeProperty which is called on unlock
   - added code to not enable this aspect early if nested calls were made (this is not done, but is safer this way)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@32047 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2011-11-17 10:18:45 +00:00
parent 4a73cf915b
commit d80f8c136a
2 changed files with 12 additions and 2 deletions

View File

@@ -94,6 +94,7 @@
<property name="methodNames">
<list>
<value>setProperty</value>
<value>removeProperty</value>
</list>
</property>
<property name="argumentValues">

View File

@@ -83,9 +83,15 @@ public class DisableAuditableBehaviourInterceptor implements MethodInterceptor
methodNames.contains(methodName) &&
(arg1 == null || argumentQNameValues.contains(arg1)))
{
Set<NodeRef> disabledNodeRefs = new HashSet<NodeRef>(); // Avoid nested calls that enable the aspect early
for (NodeRef nodeRef : nodes)
{
if (!disabledNodeRefs.contains(nodeRef) &&
behaviourFilter.isEnabled(nodeRef, ContentModel.ASPECT_AUDITABLE))
{
behaviourFilter.disableBehaviour(nodeRef, ContentModel.ASPECT_AUDITABLE);
disabledNodeRefs.add(nodeRef);
}
}
try
{
@@ -94,11 +100,14 @@ public class DisableAuditableBehaviourInterceptor implements MethodInterceptor
finally
{
for (NodeRef nodeRef : nodes)
{
if (disabledNodeRefs.contains(nodeRef))
{
behaviourFilter.enableBehaviour(nodeRef, ContentModel.ASPECT_AUDITABLE);
}
}
}
}
else
{
return methodInvocation.proceed();