12-02-2015 01:57 PM
12-02-2015 02:34 PM
12-03-2015 04:27 AM
12-07-2015 08:15 AM
12-07-2015 08:36 AM
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
}
}
12-07-2015 08:53 AM
12-07-2015 10:56 AM
/**
* 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);
12-07-2015 11:51 AM
getPolicyComponent().bindPropertyBehaviour(
NodeServicePolicies.OnUpdatePropertiesPolicy.QNAME,
QName.createQName("myModel1", "AAA"),
this.onUpdateProperties);
12-07-2015 01:44 PM
12-09-2015 08:41 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.