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 Object
implements NodeServicePolicies.BeforeDeleteNodePolicy, CopyServicePolicies.OnCopyNodePolicy
Undeletable aspect behaviour bean.
Deletions of nodes with the
ContentModel.ASPECT_UNDELETABLE are 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 the SiteService, where SiteModel.TYPE_SITE nodes are given the ContentModel.ASPECT_UNDELETABLE as a mandatory aspect. Therefore any attempt to delete such a node will result in an exception. However, this behaviour is disabled within the SiteService in 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, QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy
QNAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbeforeDeleteNode(NodeRef nodeRef) Ensures that undeletable nodes cannot be deleted by default.getCopyCallback(QName classRef, CopyDetails copyDetails) Called for all types and aspects before copying a node.voidinit()Initialise methodvoidsetNodeService(NodeService nodeService) Set the node servicevoidsetPolicyComponent(PolicyComponent policyComponent) Set the policy component
-
Constructor Details
-
UndeletableAspect
public UndeletableAspect()
-
-
Method Details
-
setPolicyComponent
Set the policy component- Parameters:
policyComponent- policy component
-
setNodeService
Set the node service- Parameters:
nodeService- node service
-
init
public void init()Initialise method -
beforeDeleteNode
Ensures that undeletable nodes cannot be deleted by default.- Specified by:
beforeDeleteNodein interfaceNodeServicePolicies.BeforeDeleteNodePolicy- Parameters:
nodeRef- the node reference
-
getCopyCallback
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:
-