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…).
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>
Archive content from product discussions in Italian.
This group is now closed and content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.