Class AliasableAspect

    • Field Detail

      • ALIASABLE_ATTRIBUTE_KEY_1

        public static final java.lang.String ALIASABLE_ATTRIBUTE_KEY_1
        The first "key" into the attribute table - identifies that the attribute is for this class
        See Also:
        Constant Field Values
      • ALIASABLE_ATTRIBUTE_KEY_2

        public static final java.lang.String ALIASABLE_ATTRIBUTE_KEY_2
        The second "key" into the attribute table - identifies that the attribute is an alias
        See Also:
        Constant Field Values
    • Constructor Detail

      • AliasableAspect

        public AliasableAspect()
    • Method Detail

      • setNodeService

        public void setNodeService​(org.alfresco.service.cmr.repository.NodeService nodeService)
        Parameters:
        nodeService - Alfresco Node Service
      • setPolicyComponent

        public void setPolicyComponent​(PolicyComponent policyComponent)
        Parameters:
        policyComponent - Alfresco Policy Component
      • init

        public void init()
        Spring initilaise method used to register the policy behaviours
      • normaliseAlias

        public static java.lang.String normaliseAlias​(java.lang.String value)
        method to normalise an email alias. Currently this involves trimmimg and lower casing, but it may change in future
        Parameters:
        value -
        Returns:
        the normalised value.
      • addAlias

        public void addAlias​(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                             java.lang.String alias)
        Set the email alias for the specified node. If the rule is broken, AlfrescoRuntimeException will be thrown.
        Parameters:
        nodeRef - Reference to target node
        alias - Alias that we want to set to the target node
        Throws:
        org.alfresco.error.AlfrescoRuntimeException - if the alias property is duplicated by another node.
      • removeAlias

        public void removeAlias​(java.lang.String alias)
        remove the specified alias
        Parameters:
        alias - to remove
      • getByAlias

        public org.alfresco.service.cmr.repository.NodeRef getByAlias​(java.lang.String alias)
        Get a node ref by its email alias
        Returns:
        the node ref, or null if there is no node for that alias
      • setAttributeService

        public void setAttributeService​(AttributeService attributeService)