Class BehaviourFilterImpl
- java.lang.Object
-
- org.alfresco.repo.policy.BehaviourFilterImpl
-
- All Implemented Interfaces:
BehaviourFilter
public class BehaviourFilterImpl extends java.lang.Object implements BehaviourFilter
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 Summary
Constructors Constructor Description BehaviourFilterImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voiddisableAllBehaviours()Deprecated.voiddisableBehaviour()Disable behaviour for all typesvoiddisableBehaviour(org.alfresco.service.cmr.repository.NodeRef nodeRef)Disable all behaviours for a given nodevoiddisableBehaviour(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName className)Disable behaviour for specific node and classvoiddisableBehaviour(org.alfresco.service.namespace.QName className)Disable behaviour for a type or aspect for all nodes.voiddisableBehaviour(org.alfresco.service.namespace.QName className, boolean includeSubClasses)Disable behaviour for a type or aspect for all nodes.voidenableAllBehaviours()Deprecated.voidenableBehaviour()Enable behaviours for all classes.voidenableBehaviour(org.alfresco.service.cmr.repository.NodeRef nodeRef)Enable behaviour for a specific nodevoidenableBehaviour(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName className)Enable behaviour for specific nodevoidenableBehaviour(org.alfresco.service.namespace.QName className)Enable behaviour for all nodes
This is also applied to the to the disabled behaviours withBehaviourFilter.disableBehaviour(QName, boolean)voidenableBehaviours(org.alfresco.service.cmr.repository.NodeRef nodeRef)Deprecated.booleanisActivated()Determine if any behaviours have been disabled or altered.booleanisEnabled()Determine if behaviour is globally enabled.booleanisEnabled(org.alfresco.service.cmr.repository.NodeRef nodeRef)Determine if behaviour is enabled for a specific node.booleanisEnabled(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName className)Determine if behaviour is enabled for specific node and class.booleanisEnabled(org.alfresco.service.namespace.QName className)Determine if behaviour is enabled for a class.voidsetDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)voidsetTenantService(org.alfresco.repo.tenant.TenantService tenantService)
-
-
-
Method Detail
-
setDictionaryService
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
- Parameters:
dictionaryService- dictionary service
-
setTenantService
public void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
- Parameters:
tenantService- dictionary service
-
enableBehaviours
@Deprecated public void enableBehaviours(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Deprecated.- Specified by:
enableBehavioursin interfaceBehaviourFilter
-
disableAllBehaviours
@Deprecated public void disableAllBehaviours()
Deprecated.- Specified by:
disableAllBehavioursin interfaceBehaviourFilter
-
enableAllBehaviours
@Deprecated public void enableAllBehaviours()
Deprecated.- Specified by:
enableAllBehavioursin interfaceBehaviourFilter
-
disableBehaviour
public void disableBehaviour()
Description copied from interface:BehaviourFilterDisable behaviour for all typesThe change applies ONLY to the current transaction.
- Specified by:
disableBehaviourin interfaceBehaviourFilter
-
disableBehaviour
public void disableBehaviour(org.alfresco.service.namespace.QName className)
Description copied from interface:BehaviourFilterDisable 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 callingBehaviourFilter.disableBehaviour(QName, boolean)withfalseThe change applies ONLY to the current transaction.
- Specified by:
disableBehaviourin interfaceBehaviourFilter- Parameters:
className- the type/aspect behaviour to disable
-
disableBehaviour
public void disableBehaviour(org.alfresco.service.namespace.QName className, boolean includeSubClasses)Description copied from interface:BehaviourFilterDisable 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:
disableBehaviourin interfaceBehaviourFilter- Parameters:
className- the type/aspect behaviour to disableincludeSubClasses- set totrueto disable the behaviours of subclasses
-
disableBehaviour
public void disableBehaviour(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName className)Description copied from interface:BehaviourFilterDisable behaviour for specific node and classThe change applies ONLY to the current transaction.
- Specified by:
disableBehaviourin interfaceBehaviourFilter- Parameters:
nodeRef- the node to disable forclassName- the type/aspect behaviour to disable
-
disableBehaviour
public void disableBehaviour(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Description copied from interface:BehaviourFilterDisable all behaviours for a given node- Specified by:
disableBehaviourin interfaceBehaviourFilter- Parameters:
nodeRef- the node to disable for
-
enableBehaviour
public void enableBehaviour()
Description copied from interface:BehaviourFilterEnable behaviours for all classes.The change applies ONLY to the current transaction.
- Specified by:
enableBehaviourin interfaceBehaviourFilter
-
enableBehaviour
public void enableBehaviour(org.alfresco.service.namespace.QName className)
Description copied from interface:BehaviourFilterEnable behaviour for all nodes
This is also applied to the to the disabled behaviours withBehaviourFilter.disableBehaviour(QName, boolean)The change applies ONLY to the current transaction.
- Specified by:
enableBehaviourin interfaceBehaviourFilter- Parameters:
className- the type/aspect behaviour to enable
-
enableBehaviour
public void enableBehaviour(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName className)Description copied from interface:BehaviourFilterEnable behaviour for specific nodeThe change applies ONLY to the current transaction.
- Specified by:
enableBehaviourin interfaceBehaviourFilter- Parameters:
nodeRef- the node to enable forclassName- the type/aspect behaviour to enable or null for all classes
-
enableBehaviour
public void enableBehaviour(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Description copied from interface:BehaviourFilterEnable behaviour for a specific nodeThe change applies ONLY to the current transaction.
- Specified by:
enableBehaviourin interfaceBehaviourFilter- Parameters:
nodeRef- the node to enable for
-
isEnabled
public boolean isEnabled()
Description copied from interface:BehaviourFilterDetermine if behaviour is globally enabled.The change applies ONLY to the current transaction.
- Specified by:
isEnabledin interfaceBehaviourFilter- Returns:
- true => behaviour is enabled
-
isEnabled
public boolean isEnabled(org.alfresco.service.namespace.QName className)
Description copied from interface:BehaviourFilterDetermine if behaviour is enabled for a class.The change applies ONLY to the current transaction.
- Specified by:
isEnabledin interfaceBehaviourFilter- Parameters:
className- the behaviour to test for- Returns:
- true => behaviour is enabled
-
isEnabled
public boolean isEnabled(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName className)Description copied from interface:BehaviourFilterDetermine 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:
isEnabledin interfaceBehaviourFilter- Parameters:
nodeRef- the node to test forclassName- the behaviour to test for- Returns:
- true => behaviour is enabled
-
isEnabled
public boolean isEnabled(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Description copied from interface:BehaviourFilterDetermine if behaviour is enabled for a specific node.The change applies ONLY to the current transaction.
- Specified by:
isEnabledin interfaceBehaviourFilter- Parameters:
nodeRef- the node to test for- Returns:
- true => behaviour is enabled
-
isActivated
public boolean isActivated()
Description copied from interface:BehaviourFilterDetermine if any behaviours have been disabled or altered.The change applies ONLY to the current transaction.
- Specified by:
isActivatedin interfaceBehaviourFilter- Returns:
- true => behaviours have been altered
-
-