Class VersionableAspect

    • Field Detail

      • logger

        protected static org.apache.commons.logging.Log logger
    • Constructor Detail

      • VersionableAspect

        public VersionableAspect()
    • Method Detail

      • setPolicyComponent

        public void setPolicyComponent​(PolicyComponent policyComponent)
        Set the policy component
        Parameters:
        policyComponent - the policy component
      • setVersionService

        public void setVersionService​(VersionService versionService)
        Set the version service
        Parameters:
        versionService - the version service
      • setNodeService

        public void setNodeService​(org.alfresco.service.cmr.repository.NodeService nodeService)
        Set the node service
        Parameters:
        nodeService - the node service
      • setLockService

        public void setLockService​(LockService lockService)
        Set the lock service
        Parameters:
        lockService - the lock service
      • setDictionaryDAO

        public void setDictionaryDAO​(org.alfresco.repo.dictionary.DictionaryDAO dictionaryDAO)
        Sets the dictionary DAO.
        Parameters:
        dictionaryDAO - the dictionary DAO
      • setNamespacePrefixResolver

        public void setNamespacePrefixResolver​(org.alfresco.service.namespace.NamespacePrefixResolver namespacePrefixResolver)
        Sets the namespace prefix resolver.
        Parameters:
        namespacePrefixResolver - the namespace prefix resolver
      • getExcludedOnUpdateProps

        public java.util.List<java.lang.String> getExcludedOnUpdateProps()
        Returns:
        Returns the current list of properties that do not trigger versioning
      • setExcludedOnUpdateProps

        public void setExcludedOnUpdateProps​(java.util.List<java.lang.String> excludedOnUpdateProps)
        Parameters:
        excludedOnUpdateProps - the list of properties that force versioning to ignore changes
      • init

        public void init()
        Initialise the versionable aspect policies
      • beforeAddAspect

        public void beforeAddAspect​(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                    org.alfresco.service.namespace.QName aspectTypeQName)
        Before add aspect policy behaviour
        Specified by:
        beforeAddAspect in interface NodeServicePolicies.BeforeAddAspectPolicy
        Parameters:
        nodeRef - NodeRef
        aspectTypeQName - QName
      • onAddAspect

        public void onAddAspect​(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                org.alfresco.service.namespace.QName aspectTypeQName)
        On add aspect policy behaviour
        Specified by:
        onAddAspect in interface NodeServicePolicies.OnAddAspectPolicy
        Parameters:
        nodeRef - NodeRef
        aspectTypeQName - QName
      • onContentUpdate

        public void onContentUpdate​(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                    boolean newContent)
        On content update policy behaviour If applicable and "cm:autoVersion" is TRUE then version the node on content update (even if no property updates)
        Specified by:
        onContentUpdate in interface ContentServicePolicies.OnContentUpdatePolicy
        Parameters:
        nodeRef - the node reference
      • onUpdateProperties

        public void onUpdateProperties​(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                       java.util.Map<org.alfresco.service.namespace.QName,​java.io.Serializable> before,
                                       java.util.Map<org.alfresco.service.namespace.QName,​java.io.Serializable> after)
        On update properties policy behaviour If applicable and "cm:autoVersionOnUpdateProps" is TRUE then version the node on properties update (even if no content updates)
        Specified by:
        onUpdateProperties in interface NodeServicePolicies.OnUpdatePropertiesPolicy
        Parameters:
        nodeRef - reference to the updated node
        before - the node's properties before the change
        after - the node's properties after the change
        Since:
        3.2
      • onDictionaryInit

        public void onDictionaryInit()
        Specified by:
        onDictionaryInit in interface org.alfresco.repo.dictionary.DictionaryListener
      • afterDictionaryInit

        public void afterDictionaryInit()
        Specified by:
        afterDictionaryInit in interface org.alfresco.repo.dictionary.DictionaryListener
      • afterDictionaryDestroy

        public void afterDictionaryDestroy()
        Specified by:
        afterDictionaryDestroy in interface org.alfresco.repo.dictionary.DictionaryListener