Package org.alfresco.repo.node
Class UndeletableAspect
- java.lang.Object
-
- org.alfresco.repo.node.UndeletableAspect
-
- All Implemented Interfaces:
CopyServicePolicies.OnCopyNodePolicy,NodeServicePolicies.BeforeDeleteNodePolicy,ClassPolicy,Policy
public class UndeletableAspect extends java.lang.Object implements NodeServicePolicies.BeforeDeleteNodePolicy, CopyServicePolicies.OnCopyNodePolicy
Undeletable aspect behaviour bean. Deletions of nodes with theContentModel.ASPECT_UNDELETABLEare not allowed by default. This class registers the behaviour that prevents the deletion. 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. An example of its usage is in theSiteService, whereSiteModel.TYPE_SITEnodes are given theContentModel.ASPECT_UNDELETABLEas a mandatory aspect. Therefore any attempt to delete such a node will result in an exception. However, this behaviour is disabled within theSiteServicein order to allow site node deletion from within that service but from no other code.- Since:
- 3.5.0
- Author:
- Neil Mc Erlean
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.Arg
-
-
Field Summary
-
Fields inherited from interface org.alfresco.repo.copy.CopyServicePolicies.OnCopyNodePolicy
ARG_0, ARG_1, QNAME
-
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy
QNAME
-
-
Constructor Summary
Constructors Constructor Description UndeletableAspect()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)Ensures that undeletable nodes cannot be deleted by default.CopyBehaviourCallbackgetCopyCallback(org.alfresco.service.namespace.QName classRef, CopyDetails copyDetails)Called for all types and aspects before copying a node.voidinit()Initialise methodvoidsetNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)Set the node servicevoidsetPolicyComponent(PolicyComponent policyComponent)Set the policy component
-
-
-
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
-
beforeDeleteNode
public void beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Ensures that undeletable nodes cannot be deleted by default.- Specified by:
beforeDeleteNodein interfaceNodeServicePolicies.BeforeDeleteNodePolicy- Parameters:
nodeRef- the node reference
-
getCopyCallback
public CopyBehaviourCallback getCopyCallback(org.alfresco.service.namespace.QName classRef, CopyDetails copyDetails)
Description copied from interface:CopyServicePolicies.OnCopyNodePolicyCalled for all types and aspects before copying a node.- Specified by:
getCopyCallbackin interfaceCopyServicePolicies.OnCopyNodePolicy- Parameters:
classRef- the type or aspect qualified namecopyDetails- the details of the impending copy- Returns:
- Return the callback that will be used to modify the copy behaviour for this dictionary class. Return null to assume the default.
- See Also:
CopyServicePolicies
-
-