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"> <property name="methodNames">
<list> <list>
<value>setProperty</value> <value>setProperty</value>
<value>removeProperty</value>
</list> </list>
</property> </property>
<property name="argumentValues"> <property name="argumentValues">

View File

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