04-11-2016 09:38 AM
<aspect name="sc:customAspect">
<title>Custom Aspect</title>
<properties>
<property name="sc:customProperty">
<type>d:text</type>
</property>
</properties>
</aspect>
public void init() {
this.policyComponent.bindPropertyBehaviour(NodeServicePolicies.OnUpdatePropertiesPolicy.QNAME,
QName.createQName(TcModel.NAMESPACE_TC_CONTENT_MODEL, TcModel.ASPECT_CUSTOM_ASPECT),
QName.createQName(TcModel.NAMESPACE_TC_CONTENT_MODEL, TcModel.PROP_CUSTOM_PROPERTY),
new JavaBehaviour(this, "onUpdateProperties", NotificationFrequency.TRANSACTION_COMMIT));
}
public void init() {
this.policyComponent.bindClassBehaviour(NodeServicePolicies.OnUpdatePropertiesPolicy.QNAME,
QName.createQName(TcModel.NAMESPACE_TC_CONTENT_MODEL, TcModel.ASPECT_CUSTOM_ASPECT),
new JavaBehaviour(this, "onUpdateProperties", NotificationFrequency.TRANSACTION_COMMIT));
}
04-11-2016 06:13 PM
04-12-2016 02:58 AM
public class WFBehaviour implements NodeServicePolicies.OnUpdatePropertiesPolicy {
private NodeService nodeService;
private PolicyComponent policyComponent;
public NodeService getNodeService() {
return nodeService;
}
public void setNodeService(NodeService nodeService) {
this.nodeService = nodeService;
}
public PolicyComponent getPolicyComponent() {
return policyComponent;
}
public void setPolicyComponent(PolicyComponent policyComponent) {
this.policyComponent = policyComponent;
}
public void init() {
this.policyComponent.bindPropertyBehaviour(NodeServicePolicies.OnUpdatePropertiesPolicy.QNAME,
QName.createQName("http://www.mycompany.com/model/content/1.0", "customAspect"),
QName.createQName("http://www.mycompany.com/model/content/1.0", "customProperty"),
new JavaBehaviour(this, "onUpdateProperties", NotificationFrequency.EVERY_EVENT));
}
@Override
public void onUpdateProperties(NodeRef arg0, Map<QName, Serializable> arg1, Map<QName, Serializable> arg2) {
System.out.println("onUpdateProperties IN");
}
}
04-12-2016 03:34 AM
<bean id="wfPolicy" class="com.mycompany.alfresco.behavior.WFBehaviour" init-method="init">
<property name="policyComponent" ref="policyComponent" />
<property name="nodeService" ref="NodeService" />
</bean>
04-12-2016 04:35 AM
this.policyComponent.bindClassBehaviour(NodeServicePolicies.OnUpdatePropertiesPolicy.QNAME,
QName.createQName("http://www.mycompany.com/model/content/1.0", "customAspect"),
new JavaBehaviour(this, "onUpdateProperties", NotificationFrequency.EVERY_EVENT));
04-12-2016 04:47 AM
04-13-2016 02:46 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.