Fix for ALF-4595. Incorrect behaviour of some folders' metadata.

Needed to disable audit behaviour when creating rendition child nodes.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22514 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Neil McErlean
2010-09-14 14:59:50 +00:00
parent 9e4ec6276f
commit f95973d7a3
2 changed files with 15 additions and 1 deletions

View File

@@ -628,7 +628,19 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
NodeRef parentNode = renditionDefinition.getRenditionParent();
QName assocType = renditionDefinition.getRenditionAssociationType();
QName nodeType = getRenditionNodeType(renditionDefinition);
ChildAssociationRef childAssoc = nodeService.createNode(parentNode, assocType, assocName, nodeType, nodeProps);
// Ensure that the creation of rendition children does not cause updates
// to the modified, modifier properties on the source node
behaviourFilter.disableBehaviour(parentNode, ContentModel.ASPECT_AUDITABLE);
ChildAssociationRef childAssoc = null;
try
{
childAssoc = nodeService.createNode(parentNode, assocType, assocName, nodeType, nodeProps);
}
finally
{
behaviourFilter.enableBehaviour(parentNode, ContentModel.ASPECT_AUDITABLE);
}
return childAssoc;
}

View File

@@ -32,6 +32,7 @@ import junit.framework.TestCase;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.action.executer.ActionExecuter;
import org.alfresco.repo.policy.BehaviourFilter;
import org.alfresco.repo.rendition.RenditionDefinitionImpl;
import org.alfresco.repo.rendition.executer.AbstractRenderingEngine.RenderingContext;
import org.alfresco.service.cmr.rendition.RenditionDefinition;
@@ -64,6 +65,7 @@ public class AbstractRenderingEngineTest extends TestCase
engine = new TestRenderingEngine();
engine.setContentService(contentService);
engine.setNodeService(nodeService);
engine.setBehaviourFilter(mock(BehaviourFilter.class));
}
@SuppressWarnings("unchecked")