diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-model-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-model-context.xml index 1319ba79ef..18fe9ee15f 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-model-context.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-model-context.xml @@ -103,6 +103,7 @@ + diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/aspect/FilePlanComponentAspect.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/aspect/FilePlanComponentAspect.java index b797293858..42dbf01f1b 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/aspect/FilePlanComponentAspect.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/aspect/FilePlanComponentAspect.java @@ -37,6 +37,7 @@ import org.alfresco.repo.policy.annotation.BehaviourBean; import org.alfresco.repo.policy.annotation.BehaviourKind; import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork; +import org.alfresco.service.cmr.rendition.RenditionService; import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.ScriptService; @@ -73,6 +74,9 @@ public class FilePlanComponentAspect extends BaseBehaviourBean /** file plan service */ private FilePlanService filePlanService; + /** rendition service */ + private RenditionService renditionService; + /** * @param scriptService set script service */ @@ -97,6 +101,14 @@ public class FilePlanComponentAspect extends BaseBehaviourBean this.filePlanService = filePlanService; } + /** + * @param renditionService rendition service + */ + public void setRenditionService(RenditionService service) + { + this.renditionService = service; + } + /** * @see org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy#onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef, java.util.Map, java.util.Map) */ @@ -211,6 +223,19 @@ public class FilePlanComponentAspect extends BaseBehaviourBean { nodeService.setProperty(nodeRef, PROP_ROOT_NODEREF, root); } + + // If the node has any renditions, they inherit the file plan from their source node. + List renditions = renditionService.getRenditions(nodeRef); + NodeRef thumbnail; + for (ChildAssociationRef chAssRef : renditions) + { + thumbnail = chAssRef.getChildRef(); + if (nodeService.exists(thumbnail)) + { + // Apply file plan component aspect to thumbnail + nodeService.addAspect(thumbnail, ASPECT_FILE_PLAN_COMPONENT, null); + } + } } return null;