public class AliasableAspect extends Object implements NodeServicePolicies.OnAddAspectPolicy, NodeServicePolicies.BeforeRemoveAspectPolicy, NodeServicePolicies.OnUpdatePropertiesPolicy, NodeServicePolicies.BeforeDeleteNodePolicy, CopyServicePolicies.OnCopyNodePolicy
Policy.Arg
Modifier and Type | Field and Description |
---|---|
static String |
ALIASABLE_ATTRIBUTE_KEY_1
The first "key" into the attribute table - identifies that the attribute is for this class
|
static String |
ALIASABLE_ATTRIBUTE_KEY_2
The second "key" into the attribute table - identifies that the attribute is an alias
|
QNAME
QNAME
ARG_0, ARG_1, ARG_2, QNAME
QNAME
ARG_0, ARG_1, QNAME
Constructor and Description |
---|
AliasableAspect() |
Modifier and Type | Method and Description |
---|---|
void |
addAlias(org.alfresco.service.cmr.repository.NodeRef nodeRef,
String alias)
Set the email alias for the specified node.
|
void |
beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Called before a node is deleted.
|
void |
beforeRemoveAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef,
org.alfresco.service.namespace.QName aspectTypeQName)
Called before an aspect is removed from a node
|
AttributeService |
getAttributeService() |
org.alfresco.service.cmr.repository.NodeRef |
getByAlias(String alias)
Get a node ref by its email alias
|
CopyBehaviourCallback |
getCopyCallback(org.alfresco.service.namespace.QName classRef,
CopyDetails copyDetails)
Called for all types and aspects before copying a node.
|
void |
init()
Spring initilaise method used to register the policy behaviours
|
static String |
normaliseAlias(String value)
method to normalise an email alias.
|
void |
onAddAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef,
org.alfresco.service.namespace.QName aspectTypeQName)
Called after an aspect has been added to a node
|
void |
onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Map<org.alfresco.service.namespace.QName,Serializable> before,
Map<org.alfresco.service.namespace.QName,Serializable> after)
Called after a node's properties have been changed.
|
void |
removeAlias(String alias)
remove the specified alias
|
void |
setAttributeService(AttributeService attributeService) |
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService) |
void |
setPolicyComponent(PolicyComponent policyComponent) |
public static final String ALIASABLE_ATTRIBUTE_KEY_1
public static final String ALIASABLE_ATTRIBUTE_KEY_2
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
nodeService
- Alfresco Node Servicepublic void setPolicyComponent(PolicyComponent policyComponent)
policyComponent
- Alfresco Policy Componentpublic void init()
public static String normaliseAlias(String value)
value
- public void addAlias(org.alfresco.service.cmr.repository.NodeRef nodeRef, String alias)
nodeRef
- Reference to target nodealias
- Alias that we want to set to the target nodeorg.alfresco.error.AlfrescoRuntimeException
- if the alias property is duplicated by another node.public void removeAlias(String alias)
alias
- to removepublic org.alfresco.service.cmr.repository.NodeRef getByAlias(String alias)
public void onAddAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName aspectTypeQName)
NodeServicePolicies.OnAddAspectPolicy
onAddAspect
in interface NodeServicePolicies.OnAddAspectPolicy
nodeRef
- the node to which the aspect was addedaspectTypeQName
- the type of the aspectorg.alfresco.error.AlfrescoRuntimeException
- Throws if the alias property is duplicated.NodeServicePolicies.OnAddAspectPolicy.onAddAspect(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.namespace.QName)
public void onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef, Map<org.alfresco.service.namespace.QName,Serializable> before, Map<org.alfresco.service.namespace.QName,Serializable> after)
NodeServicePolicies.OnUpdatePropertiesPolicy
onUpdateProperties
in interface NodeServicePolicies.OnUpdatePropertiesPolicy
nodeRef
- reference to the updated nodebefore
- the node's properties before the changeafter
- the node's properties after the changeorg.alfresco.error.AlfrescoRuntimeException
- Throws if the alias property is duplicated.NodeServicePolicies.OnUpdatePropertiesPolicy.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef, java.util.Map, java.util.Map)
public void beforeRemoveAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName aspectTypeQName)
NodeServicePolicies.BeforeRemoveAspectPolicy
beforeRemoveAspect
in interface NodeServicePolicies.BeforeRemoveAspectPolicy
nodeRef
- the node from which the aspect will be removedaspectTypeQName
- the type of the aspectpublic void beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
NodeServicePolicies.BeforeDeleteNodePolicy
beforeDeleteNode
in interface NodeServicePolicies.BeforeDeleteNodePolicy
nodeRef
- the node referencepublic CopyBehaviourCallback getCopyCallback(org.alfresco.service.namespace.QName classRef, CopyDetails copyDetails)
CopyServicePolicies.OnCopyNodePolicy
getCopyCallback
in interface CopyServicePolicies.OnCopyNodePolicy
classRef
- the type or aspect qualified namecopyDetails
- the details of the impending copyCopyServicePolicies
public void setAttributeService(AttributeService attributeService)
public AttributeService getAttributeService()
Copyright © 2005–2017 Alfresco Software. All rights reserved.