Skip to content

Instantly share code, notes, and snippets.

@alex4u2nv
Last active August 29, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alex4u2nv/10000929 to your computer and use it in GitHub Desktop.
Save alex4u2nv/10000929 to your computer and use it in GitHub Desktop.
public class MyBehaviourPolicy implements NodeServicePolicies.OnCreateChildAssociationPolicy {
private PolicyComponent policyComponent;
public PolicyComponent getPolicyComponent() {
return policyComponent;
}
public void setPolicyComponent(PolicyComponent policyComponent) {
this.policyComponent = policyComponent;
}
public void init() {
this.OnCreateChildAssociationPolicy.bindAssociationBehaviour(
NodeServicePolicies.OnCreateChildAssociationPolicy.QNAME,
ContentModel.TYPE_AUTHORITY_CONTAINER,
ContentModel.ASSOC_MEMBER,
new JavaBehaviour(this, "onCreateChildAssociation", NotificationFrequency.TRANSACTION_COMMIT)
);
}
@Override
public void onCreateChildAssociation(ChildAssociationRef arg0, boolean arg1) {
//do your magic
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment