Class UnmovableAspect

  • All Implemented Interfaces:
    NodeServicePolicies.BeforeMoveNodePolicy, ClassPolicy, Policy

    public class UnmovableAspect
    extends java.lang.Object
    implements NodeServicePolicies.BeforeMoveNodePolicy
    Unmovable aspect behaviour bean. Deletions of nodes with the ContentModel.ASPECT_UNMOVABLE are not allowed by default. This class registers the behaviour that prevents the move.

    This aspect/behaviour combination allows for detailed application control of when node deletion is allowed or disallowed for particular nodes. It is not related to the normal permissions controls, which of course apply.

    Since:
    4.2.5
    Author:
    Sergey Scherbovich
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy

        Policy.Arg
    • Constructor Summary

      Constructors 
      Constructor Description
      UnmovableAspect()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void beforeMoveNode​(org.alfresco.service.cmr.repository.ChildAssociationRef oldChildAssocRef, org.alfresco.service.cmr.repository.NodeRef newParentRef)
      Prevents node from to be moved
      void init()
      Initialise method
      void setNodeService​(org.alfresco.service.cmr.repository.NodeService nodeService)
      Set the node service
      void setPolicyComponent​(PolicyComponent policyComponent)
      Set the policy component
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UnmovableAspect

        public UnmovableAspect()
    • Method Detail

      • setPolicyComponent

        public void setPolicyComponent​(PolicyComponent policyComponent)
        Set the policy component
        Parameters:
        policyComponent - policy component
      • setNodeService

        public void setNodeService​(org.alfresco.service.cmr.repository.NodeService nodeService)
        Set the node service
        Parameters:
        nodeService - node service
      • init

        public void init()
        Initialise method
      • beforeMoveNode

        public void beforeMoveNode​(org.alfresco.service.cmr.repository.ChildAssociationRef oldChildAssocRef,
                                   org.alfresco.service.cmr.repository.NodeRef newParentRef)
        Prevents node from to be moved
        Specified by:
        beforeMoveNode in interface NodeServicePolicies.BeforeMoveNodePolicy
        Parameters:
        oldChildAssocRef - the child association reference prior to the move
        newParentRef - the new parent node reference