mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merge branch 'feature-2.3/RM-2188_PreviewNotAvailableDeclaredRecord' into 'release/V2.3'
Feature 2.3/rm 2188 preview not available declared record Backported changes from fixed issue RM-3030 in V2.4. See merge request !493
This commit is contained in:
@@ -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<ChildAssociationRef> renditions = renditionService.getRenditions(nodeRef);
|
||||
NodeRef rendition;
|
||||
for (ChildAssociationRef chAssRef : renditions)
|
||||
{
|
||||
rendition = chAssRef.getChildRef();
|
||||
if (nodeService.exists(rendition))
|
||||
{
|
||||
// Apply file plan component aspect to node's renditions
|
||||
nodeService.addAspect(rendition, ASPECT_FILE_PLAN_COMPONENT, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
Reference in New Issue
Block a user