org.alfresco.repo.policy
Class BehaviourFilterImpl

java.lang.Object
  extended by 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.


Constructor Summary
BehaviourFilterImpl()
           
 
Method Summary
 void disableAllBehaviours()
          Disable all behaviours.
 boolean disableBehaviour(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName className)
          Disable behaviour for specific node
 boolean disableBehaviour(org.alfresco.service.namespace.QName className)
          Disable behaviour for a type or aspect for all nodes.
 void enableAllBehaviours()
          Enable all behaviours i.e.
 void enableBehaviour(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName className)
          Enable behaviour for specific node
 void enableBehaviour(org.alfresco.service.namespace.QName className)
          Enable behaviour for all nodes
 void enableBehaviours(org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Enable all behaviours for specific node
 boolean isActivated()
          Determine if any behaviours have been disabled?
 boolean isEnabled(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName className)
          Determine if behaviour is enabled for specific node.
 boolean isEnabled(org.alfresco.service.namespace.QName className)
          Determine if behaviour is enabled across all nodes.
 void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
           
 void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BehaviourFilterImpl

public BehaviourFilterImpl()
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

disableBehaviour

public boolean disableBehaviour(org.alfresco.service.namespace.QName className)
Description copied from interface: BehaviourFilter
Disable behaviour for a type or aspect for all nodes.

The change applies ONLY to the current transaction.

Specified by:
disableBehaviour in interface BehaviourFilter
Parameters:
className - the type/aspect behaviour to disable
Returns:
true => already disabled

disableBehaviour

public boolean disableBehaviour(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                org.alfresco.service.namespace.QName className)
Description copied from interface: BehaviourFilter
Disable behaviour for specific node

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
Returns:
true => already disabled

enableBehaviour

public void enableBehaviour(org.alfresco.service.namespace.QName className)
Description copied from interface: BehaviourFilter
Enable behaviour for all nodes

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(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                            org.alfresco.service.namespace.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

enableBehaviours

public void enableBehaviours(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Description copied from interface: BehaviourFilter
Enable all behaviours for specific node

The change applies ONLY to the current transaction.

Specified by:
enableBehaviours in interface BehaviourFilter
Parameters:
nodeRef - the node to enable for

disableAllBehaviours

public void disableAllBehaviours()
Description copied from interface: BehaviourFilter
Disable all behaviours. Once this method is called the node and class level filters, enableBehaviours and disableBehaviours methods have no effect, every behaviour is disabled. EnableAllBehaviours reverses the result of calling this method.

Calling this method may result in nodes existing in your repository that do not conform to your policies.

The change applies ONLY to the current transaction.

Specified by:
disableAllBehaviours in interface BehaviourFilter
See Also:
BehaviourFilter.enableAllBehaviours()

enableAllBehaviours

public void enableAllBehaviours()
Description copied from interface: BehaviourFilter
Enable all behaviours i.e. undo all disable calls - at the global, node and class level.

The change applies ONLY to the current transaction.

Specified by:
enableAllBehaviours in interface BehaviourFilter

isEnabled

public boolean isEnabled(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                         org.alfresco.service.namespace.QName className)
Description copied from interface: BehaviourFilter
Determine if behaviour is enabled for specific node.

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(org.alfresco.service.namespace.QName className)
Description copied from interface: BehaviourFilter
Determine if behaviour is enabled across all nodes.

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

isActivated

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

The change applies ONLY to the current transaction.

Specified by:
isActivated in interface BehaviourFilter
Returns:
true => behaviours have been filtered


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.