Class BehaviourFilterImpl

java.lang.Object
org.alfresco.repo.policy.BehaviourFilterImpl
All Implemented Interfaces:
BehaviourFilter, Extensible

public class BehaviourFilterImpl extends Object implements BehaviourFilter, Extensible
Implementation of Behaviour Filter. All methods operate on transactionally-bound resources. Behaviour will therefore never span transactions; the filter state has the same lifespan as the transaction in which it was created.

Multitenancy and disabling by NodeRef:
Conversions based on the current tenant context are done automatically.

Author:
Derek Hulley
  • Constructor Details

    • BehaviourFilterImpl

      public BehaviourFilterImpl()
  • Method Details

    • setDictionaryService

      public void setDictionaryService(DictionaryService dictionaryService)
      Parameters:
      dictionaryService - dictionary service
    • setTenantService

      public void setTenantService(TenantService tenantService)
      Parameters:
      tenantService - dictionary service
    • enableBehaviours

      @Deprecated public void enableBehaviours(NodeRef nodeRef)
      Deprecated.
      Specified by:
      enableBehaviours in interface BehaviourFilter
    • disableAllBehaviours

      @Deprecated public void disableAllBehaviours()
      Deprecated.
      Specified by:
      disableAllBehaviours in interface BehaviourFilter
    • enableAllBehaviours

      @Deprecated public void enableAllBehaviours()
      Deprecated.
      Specified by:
      enableAllBehaviours in interface BehaviourFilter
    • disableBehaviour

      public void disableBehaviour()
      Description copied from interface: BehaviourFilter
      Disable behaviour for all types

      The change applies ONLY to the current transaction.

      Specified by:
      disableBehaviour in interface BehaviourFilter
    • disableBehaviour

      public void disableBehaviour(QName className)
      Description copied from interface: BehaviourFilter
      Disable behaviour for a type or aspect for all nodes.
      Given a direct instance of className (ie. not a subclass) all behaviour is disabled (including superclass behaviour).

      The same as calling BehaviourFilter.disableBehaviour(QName, boolean) with false

      The change applies ONLY to the current transaction.

      Specified by:
      disableBehaviour in interface BehaviourFilter
      Parameters:
      className - the type/aspect behaviour to disable
    • disableBehaviour

      public void disableBehaviour(QName className, boolean includeSubClasses)
      Description copied from interface: BehaviourFilter
      Disable behaviour for a type or aspect for all nodes.
      Given an instance of className (including instances that are subclasses of className, if includeSubClasses is true) all behaviour is disabled (including superclass behaviour).

      Successive calls (within the current transaction) will overwrite the filter for this class.
      The change applies ONLY to the current transaction.
      Specified by:
      disableBehaviour in interface BehaviourFilter
      Parameters:
      className - the type/aspect behaviour to disable
      includeSubClasses - set to true to disable the behaviours of subclasses
    • disableBehaviour

      public void disableBehaviour(NodeRef nodeRef, QName className)
      Description copied from interface: BehaviourFilter
      Disable behaviour for specific node and class

      The change applies ONLY to the current transaction.

      Specified by:
      disableBehaviour in interface BehaviourFilter
      Parameters:
      nodeRef - the node to disable for
      className - the type/aspect behaviour to disable
    • disableBehaviour

      public void disableBehaviour(NodeRef nodeRef)
      Description copied from interface: BehaviourFilter
      Disable all behaviours for a given node
      Specified by:
      disableBehaviour in interface BehaviourFilter
      Parameters:
      nodeRef - the node to disable for
    • enableBehaviour

      public void enableBehaviour()
      Description copied from interface: BehaviourFilter
      Enable behaviours for all classes.

      The change applies ONLY to the current transaction.

      Specified by:
      enableBehaviour in interface BehaviourFilter
    • enableBehaviour

      public void enableBehaviour(QName className)
      Description copied from interface: BehaviourFilter
      Enable behaviour for all nodes
      This is also applied to the to the disabled behaviours with BehaviourFilter.disableBehaviour(QName, boolean)

      The change applies ONLY to the current transaction.

      Specified by:
      enableBehaviour in interface BehaviourFilter
      Parameters:
      className - the type/aspect behaviour to enable
    • enableBehaviour

      public void enableBehaviour(NodeRef nodeRef, QName className)
      Description copied from interface: BehaviourFilter
      Enable behaviour for specific node

      The change applies ONLY to the current transaction.

      Specified by:
      enableBehaviour in interface BehaviourFilter
      Parameters:
      nodeRef - the node to enable for
      className - the type/aspect behaviour to enable or null for all classes
    • enableBehaviour

      public void enableBehaviour(NodeRef nodeRef)
      Description copied from interface: BehaviourFilter
      Enable behaviour for a specific node

      The change applies ONLY to the current transaction.

      Specified by:
      enableBehaviour in interface BehaviourFilter
      Parameters:
      nodeRef - the node to enable for
    • isEnabled

      public boolean isEnabled()
      Description copied from interface: BehaviourFilter
      Determine if behaviour is globally enabled.

      The change applies ONLY to the current transaction.

      Specified by:
      isEnabled in interface BehaviourFilter
      Returns:
      true => behaviour is enabled
    • isEnabled

      public boolean isEnabled(QName className)
      Description copied from interface: BehaviourFilter
      Determine if behaviour is enabled for a class.

      The change applies ONLY to the current transaction.

      Specified by:
      isEnabled in interface BehaviourFilter
      Parameters:
      className - the behaviour to test for
      Returns:
      true => behaviour is enabled
    • isEnabled

      public boolean isEnabled(NodeRef nodeRef, QName className)
      Description copied from interface: BehaviourFilter
      Determine if behaviour is enabled for specific node and class.

      Note: A node behaviour is enabled only when: a) the behaviour is not disabled across all nodes b) the behaviour is not disabled specifically for the provided node

      The change applies ONLY to the current transaction.

      Specified by:
      isEnabled in interface BehaviourFilter
      Parameters:
      nodeRef - the node to test for
      className - the behaviour to test for
      Returns:
      true => behaviour is enabled
    • isEnabled

      public boolean isEnabled(NodeRef nodeRef)
      Description copied from interface: BehaviourFilter
      Determine if behaviour is enabled for a specific node.

      The change applies ONLY to the current transaction.

      Specified by:
      isEnabled in interface BehaviourFilter
      Parameters:
      nodeRef - the node to test for
      Returns:
      true => behaviour is enabled
    • isActivated

      public boolean isActivated()
      Description copied from interface: BehaviourFilter
      Determine if any behaviours have been disabled or altered.

      The change applies ONLY to the current transaction.

      Specified by:
      isActivated in interface BehaviourFilter
      Returns:
      true => behaviours have been altered
    • getTrait

      public <M extends Trait> ExtendedTrait<M> getTrait(Class<? extends M> traitAPI)
      Specified by:
      getTrait in interface Extensible