|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PolicyComponent
Policy Component for managing Policies and Behaviours.
This component provides the ability to:
A behaviour may be bound to a Policy before the Policy is registered. In this case, the behaviour is not validated (i.e. checked to determine if it supports the policy interface) until the Policy is registered. Otherwise, the behaviour is validated at bind-time. Policies may be selectively "turned off" by the Behaviour Filter.
BehaviourFilter
,
NodeServicePolicies
Method Summary | |
---|---|
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 className,
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 |
Method Detail |
---|
ClassPolicyDelegate registerClassPolicy(java.lang.Class policy)
policy
- the policy interface class
PropertyPolicyDelegate registerPropertyPolicy(java.lang.Class policy)
policy
- the policy interface class
AssociationPolicyDelegate registerAssociationPolicy(java.lang.Class policy)
policy
- the policy interface class
java.util.Collection getRegisteredPolicies()
PolicyDefinition getRegisteredPolicy(PolicyType policyType, org.alfresco.service.namespace.QName policy)
policyType
- the policy typepolicy
- the policy name
boolean isRegisteredPolicy(PolicyType policyType, org.alfresco.service.namespace.QName policy)
policyType
- the policy typepolicy
- the fully qualified name of the policy
BehaviourDefinition bindClassBehaviour(org.alfresco.service.namespace.QName policy, org.alfresco.service.namespace.QName className, Behaviour behaviour)
So 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"));
policy
- the fully qualified policy nameclassName
- the qualified name of a type or aspect that the policy is bound tobehaviour
- the behaviour. What gets executed by the policy
BehaviourDefinition bindClassBehaviour(org.alfresco.service.namespace.QName policy, java.lang.Object service, Behaviour behaviour)
policy
- the fully qualified policy nameservice
- the service (any object, in fact)behaviour
- the behaviour. What gets executed by the policy
BehaviourDefinition bindPropertyBehaviour(org.alfresco.service.namespace.QName policy, org.alfresco.service.namespace.QName className, org.alfresco.service.namespace.QName propertyName, Behaviour behaviour)
policy
- 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 policy
BehaviourDefinition bindPropertyBehaviour(org.alfresco.service.namespace.QName policy, org.alfresco.service.namespace.QName className, Behaviour behaviour)
policy
- the fully qualified policy nameclassName
- the name of the class (type or aspect) to bind againstbehaviour
- the behaviour, what gets executed by the policy
BehaviourDefinition bindPropertyBehaviour(org.alfresco.service.namespace.QName policy, java.lang.Object service, Behaviour behaviour)
policy
- the fully qualified policy nameservice
- the binding servicebehaviour
- the behaviour
BehaviourDefinition bindAssociationBehaviour(org.alfresco.service.namespace.QName policy, org.alfresco.service.namespace.QName className, org.alfresco.service.namespace.QName assocName, Behaviour behaviour)
For example, before a rule folder association is created.
policyComponent.bindAssociationBehaviour( NodeServicePolicies.OnCreateChildAssociationPolicy.QNAME, RuleModel.ASPECT_RULES, RuleModel.ASSOC_RULE_FOLDER, new JavaBehaviour(this, "OnCreateChildAssociation"));
policy
- 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 policy
BehaviourDefinition bindAssociationBehaviour(org.alfresco.service.namespace.QName policy, org.alfresco.service.namespace.QName className, Behaviour behaviour)
policy
- the policy nameclassName
- the name of the class (type or aspect) to bind againstbehaviour
- the behaviour. What gets executed by the policy
BehaviourDefinition bindAssociationBehaviour(org.alfresco.service.namespace.QName policy, java.lang.Object service, Behaviour behaviour)
policy
- the policy nameservice
- the binding servicebehaviour
- the behaviour. What gets executed by the policy
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |