From 19b36d664fa0da6f6770252d580f1d53e84ab5d9 Mon Sep 17 00:00:00 2001 From: Ana Bozianu Date: Thu, 18 Feb 2016 12:18:00 +0200 Subject: [PATCH 1/2] RM-2937 - The destruction of records can not be completed if the metadata is set to be maintained after destruction. - ExtendedContentDestructionComoponent uses the NodeService interface which enforces capability check. ExtendedContentDestructionComoponent extends ContentDestructionComoponent from community which uses the nodeService implementation. I fixed it by using the implementation directly. - After fixing the issue I noticed the renditions nodes are not deleted which is a regression from 2.3 and there is no comment to specify this was intended so I deleted the rendition node. --- .../content/ContentDestructionComponent.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/content/ContentDestructionComponent.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/content/ContentDestructionComponent.java index ee60e787ad..fc28255978 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/content/ContentDestructionComponent.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/content/ContentDestructionComponent.java @@ -179,6 +179,9 @@ public class ContentDestructionComponent { // destroy renditions content destroyContent(child.getChildRef(), false); + + //delete the rendition node + getNodeService().deleteNode(child.getChildRef()); } } } From dbf123af839a139531e1ad3f6b52ff8240118d5e Mon Sep 17 00:00:00 2001 From: Ana Bozianu Date: Fri, 19 Feb 2016 13:31:17 +0200 Subject: [PATCH 2/2] RM-2937 - The destruction of records can not be completed if the metadata is set to be maintained after destruction. - removed nodeService and eagerContentStoreCleaner from rm.contentDestructionComponent bean as they are already set on contentDestructionComponent - fixed the ignored boolean --- .../content/ContentDestructionComponent.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/content/ContentDestructionComponent.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/content/ContentDestructionComponent.java index fc28255978..01982b6665 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/content/ContentDestructionComponent.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/content/ContentDestructionComponent.java @@ -168,8 +168,9 @@ public class ContentDestructionComponent // We want to remove the rn:renditioned aspect, but due to the possibility // that there is Alfresco 3.2-era data with the cm:thumbnailed aspect // applied, we must consider removing it too. - if (getNodeService().hasAspect(nodeRef, RenditionModel.ASPECT_RENDITIONED) || - getNodeService().hasAspect(nodeRef, ContentModel.ASPECT_THUMBNAILED)) + if (includeRenditions + && (getNodeService().hasAspect(nodeRef, RenditionModel.ASPECT_RENDITIONED) + || getNodeService().hasAspect(nodeRef, ContentModel.ASPECT_THUMBNAILED))) { // get the rendition assoc types Set childAssocTypes = dictionaryService.getAspect(RenditionModel.ASPECT_RENDITIONED).getChildAssociations().keySet();