07-17-2015 04:04 AM
07-22-2015 05:34 AM
07-22-2015 07:44 AM
07-22-2015 08:24 AM
system.content.eagerOrphanCleanup = true
all'alfresco-global.properties. (Non posso garantirti che funzioni dato che, come ti ho detto, non ho mi sono mai trovato nella tua situazione…).07-22-2015 11:23 AM
07-23-2015 04:53 AM
public class TestBehaviour implements NodeServicePolicies.OnCreateNodePolicy {
private Behaviour onCreateNode;
private PolicyComponent policyComponent;
private NodeService nodeService;
private Log log = LogFactory.getLog(TestBehaviour.class);
public void setPolicyComponent(PolicyComponent policyComponent) {
this.policyComponent = policyComponent;
}
public void setNodeService(NodeService nodeService) {
this.nodeService = nodeService;
}
public void init() {
this.onCreateNode = new JavaBehaviour(this, "onCreateNode", Behaviour.NotificationFrequency.TRANSACTION_COMMIT);
this.policyComponent.bindClassBehaviour(
QNAME.createQName(NamespaceService.ALFRESCO_URI, "onCreateNode"),
"cm:content",
this.onCreateNode);
}
@Override
public void onCreateNode(ChildAssociationRef childAssociationRef) {
NodeRef nodeRef = childAssociationRef.getParentRef();
QName titleProperty = QNAME.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "description");
log.warn(titleProperty.toString());
log.warn(nodeRef.getId());
try {
nodeService.setProperty(childAssociationRef.getChildRef(), titleProperty, "Test Behaviour");
log.warn("onCreateNode OK");
}
catch (InvalidNodeRefException _e) {
log.error("ERRORE onCreateNode");
}
}
}
<bean id="testBehaviour" class="local.lab.TestBehaviour" init-method="init">
<property name="policyComponent">
<ref bean="policyComponent" />
</property>
<property name="nodeService">
<ref bean="NodeService"/>
</property>
</bean>
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.