As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
private Set<QName> determineChangedProps(Map<QName, Serializable> oldProps, Map<QName, Serializable> newProps) { Set<QName> result = new HashSet<QName>(); for (QName qn : oldProps.keySet()) { if (newProps.get(qn) == null || newProps.get(qn).equals(oldProps.get(qn)) == false) { result.add(qn); } } for (QName qn : newProps.keySet()) { if (oldProps.get(qn) == null) { result.add(qn); } } return result; }
public void onUpdateProperties(NodeRef nodeRef, Map<QName, Serializable> before, Map<QName, Serializable> after) { if (nodeService.exists(nodeRef)) { Set<QName> changedProps = determineChangedProps(before, after); if (changedProps.contains(YourModel.PROP_YOUR_CUSTOM_PROPERTY_QNAME)) { // DO WHATEVER YOU WANT HERE } }
/** * Register a Property-level Policy * * @param <P> the policy interface * @param policy the policy interface class * @return A delegate for the property-level policy (typed by the policy interface) */ public <P extends PropertyPolicy> PropertyPolicyDelegate<P> registerPropertyPolicy(Class<P> policy);
/** * Bind a Service specific behaviour to a Property-level Policy * * @param policy the fully qualified policy name * @param service the binding service * @param behaviour the behaviour * @return the registered behaviour definition */ public BehaviourDefinition<ServiceBehaviourBinding> bindPropertyBehaviour(QName policy, Object service, Behaviour behaviour);
getPolicyComponent().bindPropertyBehaviour( NodeServicePolicies.OnUpdatePropertiesPolicy.QNAME, QName.createQName("myModel1", "AAA"), this.onUpdateProperties);