public class PolicyComponentImpl extends java.lang.Object implements PolicyComponent
| Constructor and Description |
|---|
PolicyComponentImpl(org.alfresco.service.cmr.dictionary.DictionaryService dictionary)
Construct
|
| Modifier and Type | Method and Description |
|---|---|
BehaviourDefinition |
bindAssociationBehaviour(org.alfresco.service.namespace.QName policy,
java.lang.Object service,
Behaviour behaviour)
Bind a Service specific behaviour to an Association-level Policy
|
BehaviourDefinition |
bindAssociationBehaviour(org.alfresco.service.namespace.QName policy,
org.alfresco.service.namespace.QName className,
Behaviour behaviour)
Bind an Association specific behaviour to an Association-level Policy (for all associations of a Class)
|
BehaviourDefinition |
bindAssociationBehaviour(org.alfresco.service.namespace.QName policy,
org.alfresco.service.namespace.QName className,
org.alfresco.service.namespace.QName assocName,
Behaviour behaviour)
Bind an Association specific behaviour to an Association-level Policy
|
BehaviourDefinition |
bindClassBehaviour(org.alfresco.service.namespace.QName policy,
java.lang.Object service,
Behaviour behaviour)
Bind a Service behaviour to a Class-level Policy
|
BehaviourDefinition |
bindClassBehaviour(org.alfresco.service.namespace.QName policy,
org.alfresco.service.namespace.QName classRef,
Behaviour behaviour)
Bind a Class specific behaviour to a Class-level Policy.
|
BehaviourDefinition |
bindPropertyBehaviour(org.alfresco.service.namespace.QName policy,
java.lang.Object service,
Behaviour behaviour)
Bind a Service specific behaviour to a Property-level Policy
|
BehaviourDefinition |
bindPropertyBehaviour(org.alfresco.service.namespace.QName policy,
org.alfresco.service.namespace.QName className,
Behaviour behaviour)
Bind a Property specific behaviour to a Property-level Policy (for all properties of a Class)
|
BehaviourDefinition |
bindPropertyBehaviour(org.alfresco.service.namespace.QName policy,
org.alfresco.service.namespace.QName className,
org.alfresco.service.namespace.QName propertyName,
Behaviour behaviour)
Bind a Property specific behaviour to a Property-level Policy
|
java.util.Collection |
getRegisteredPolicies()
Gets all registered Policies
|
PolicyDefinition |
getRegisteredPolicy(PolicyType policyType,
org.alfresco.service.namespace.QName policy)
Gets the specified registered Policy
|
boolean |
isRegisteredPolicy(PolicyType policyType,
org.alfresco.service.namespace.QName policy)
Determine if the specified policy has been registered
|
AssociationPolicyDelegate |
registerAssociationPolicy(java.lang.Class policy)
Register a Association-level Policy
|
ClassPolicyDelegate |
registerClassPolicy(java.lang.Class policy)
Register a Class-level Policy
|
PropertyPolicyDelegate |
registerPropertyPolicy(java.lang.Class policy)
Register a Property-level Policy
|
void |
setBehaviourFilter(BehaviourFilter filter)
Sets the behaviour filter
|
void |
setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
Sets the tenant service
|
void |
setTransactionInvocationHandlerFactory(TransactionInvocationHandlerFactory factory)
Sets the transaction-based policy invocation handler
|
public PolicyComponentImpl(org.alfresco.service.cmr.dictionary.DictionaryService dictionary)
dictionary - dictionary servicebehaviourFilter - behaviour filterpublic void setBehaviourFilter(BehaviourFilter filter)
filter - public void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
tenantService - public void setTransactionInvocationHandlerFactory(TransactionInvocationHandlerFactory factory)
factory - public ClassPolicyDelegate registerClassPolicy(java.lang.Class policy)
PolicyComponentregisterClassPolicy in interface PolicyComponentpolicy - the policy interface classpublic PropertyPolicyDelegate registerPropertyPolicy(java.lang.Class policy)
PolicyComponentregisterPropertyPolicy in interface PolicyComponentpolicy - the policy interface classpublic AssociationPolicyDelegate registerAssociationPolicy(java.lang.Class policy)
PolicyComponentregisterAssociationPolicy in interface PolicyComponentpolicy - the policy interface classpublic java.util.Collection getRegisteredPolicies()
PolicyComponentgetRegisteredPolicies in interface PolicyComponentpublic PolicyDefinition getRegisteredPolicy(PolicyType policyType, org.alfresco.service.namespace.QName policy)
PolicyComponentgetRegisteredPolicy in interface PolicyComponentpolicyType - the policy typepolicy - the policy namepublic boolean isRegisteredPolicy(PolicyType policyType, org.alfresco.service.namespace.QName policy)
PolicyComponentisRegisteredPolicy in interface PolicyComponentpolicyType - the policy typepolicy - the fully qualified name of the policypublic BehaviourDefinition bindClassBehaviour(org.alfresco.service.namespace.QName policy, org.alfresco.service.namespace.QName classRef, Behaviour behaviour)
PolicyComponentSo when the named policy, happens on the specified aspect or type, the specified behaviour is executed.
Example of calling this method
this.policyComponent.bindClassBehaviour(
NodeServicePolicies.BeforeUpdateNodePolicy.QNAME,
ContentModel.ASPECT_LOCKABLE,
new JavaBehaviour(this, "beforeUpdateNode"));
bindClassBehaviour in interface PolicyComponentpolicy - the fully qualified policy nameclassRef - the qualified name of a type or aspect that the policy is bound tobehaviour - the behaviour. What gets executed by the policypublic BehaviourDefinition bindClassBehaviour(org.alfresco.service.namespace.QName policy, java.lang.Object service, Behaviour behaviour)
PolicyComponentbindClassBehaviour in interface PolicyComponentpolicy - the fully qualified policy nameservice - the service (any object, in fact)behaviour - the behaviour. What gets executed by the policypublic BehaviourDefinition bindPropertyBehaviour(org.alfresco.service.namespace.QName policy, org.alfresco.service.namespace.QName className, org.alfresco.service.namespace.QName propertyName, Behaviour behaviour)
PolicyComponentbindPropertyBehaviour in interface PolicyComponentpolicy - the fully qualified policy nameclassName - the qualified name of the class (type or aspect) to bind againstpropertyName - the name of the property to bind againstbehaviour - the behaviour. What gets executed by the policypublic BehaviourDefinition bindPropertyBehaviour(org.alfresco.service.namespace.QName policy, org.alfresco.service.namespace.QName className, Behaviour behaviour)
PolicyComponentbindPropertyBehaviour in interface PolicyComponentpolicy - the fully qualified policy nameclassName - the name of the class (type or aspect) to bind againstbehaviour - the behaviour, what gets executed by the policypublic BehaviourDefinition bindPropertyBehaviour(org.alfresco.service.namespace.QName policy, java.lang.Object service, Behaviour behaviour)
PolicyComponentbindPropertyBehaviour in interface PolicyComponentpolicy - the fully qualified policy nameservice - the binding servicebehaviour - the behaviourpublic BehaviourDefinition bindAssociationBehaviour(org.alfresco.service.namespace.QName policy, org.alfresco.service.namespace.QName className, org.alfresco.service.namespace.QName assocName, Behaviour behaviour)
PolicyComponentFor example, before a rule folder association is created.
policyComponent.bindAssociationBehaviour(
NodeServicePolicies.OnCreateChildAssociationPolicy.QNAME,
RuleModel.ASPECT_RULES,
RuleModel.ASSOC_RULE_FOLDER,
new JavaBehaviour(this, "OnCreateChildAssociation"));
bindAssociationBehaviour in interface PolicyComponentpolicy - the policy nameclassName - the name of the class (type or aspect) to bind againstassocName - the name of the association to bind againstbehaviour - the behaviour. What gets executed by the policypublic BehaviourDefinition bindAssociationBehaviour(org.alfresco.service.namespace.QName policy, org.alfresco.service.namespace.QName className, Behaviour behaviour)
PolicyComponentbindAssociationBehaviour in interface PolicyComponentpolicy - the policy nameclassName - the name of the class (type or aspect) to bind againstbehaviour - the behaviour. What gets executed by the policypublic BehaviourDefinition bindAssociationBehaviour(org.alfresco.service.namespace.QName policy, java.lang.Object service, Behaviour behaviour)
PolicyComponentbindAssociationBehaviour in interface PolicyComponentpolicy - the policy nameservice - the binding servicebehaviour - the behaviour. What gets executed by the policyCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.