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
|
QNAMEQNAMEARG_0, ARG_1, ARG_2, QNAMEQNAMEARG_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.OnAddAspectPolicyonAddAspect in interface NodeServicePolicies.OnAddAspectPolicynodeRef - 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.OnUpdatePropertiesPolicyonUpdateProperties in interface NodeServicePolicies.OnUpdatePropertiesPolicynodeRef - 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.BeforeRemoveAspectPolicybeforeRemoveAspect in interface NodeServicePolicies.BeforeRemoveAspectPolicynodeRef - the node from which the aspect will be removedaspectTypeQName - the type of the aspectpublic void beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
NodeServicePolicies.BeforeDeleteNodePolicybeforeDeleteNode in interface NodeServicePolicies.BeforeDeleteNodePolicynodeRef - the node referencepublic CopyBehaviourCallback getCopyCallback(org.alfresco.service.namespace.QName classRef, CopyDetails copyDetails)
CopyServicePolicies.OnCopyNodePolicygetCopyCallback in interface CopyServicePolicies.OnCopyNodePolicyclassRef - the type or aspect qualified namecopyDetails - the details of the impending copyCopyServicePoliciespublic void setAttributeService(AttributeService attributeService)
public AttributeService getAttributeService()
Copyright © 2005–2018 Alfresco Software. All rights reserved.