12-29-2011 04:25 AM
12-29-2011 11:57 AM
01-09-2012 11:46 AM
public class AddFileListener implements NodeServicePolicies.OnCreateNodePolicy {
private Logger logger = Logger.getLogger(AddFileListener.class);
private Behaviour onCreateNode;
private PolicyComponent policyComponent;
protected NodeService nodeService;
protected ContentService contentService;
public void setContentService(ContentService contentService) {
this.contentService = contentService;
}
public void setPolicyComponent(PolicyComponent policyComponent) {
this.policyComponent = policyComponent;
}
public void setNodeService(NodeService nodeService) {
this.nodeService = nodeService;
}
void init() {
// Create behaviours
this.onCreateNode = new JavaBehaviour(this, "onCreateNode",
NotificationFrequency.EVERY_EVENT);
// Register interest in the onCreateNode policy - for content
policyComponent.bindClassBehaviour(QName.createQName(
NamespaceService.ALFRESCO_URI, "onCreateNode"),
ContentModel.TYPE_CONTENT, onCreateNode);
}
@Override
public void onCreateNode(ChildAssociationRef childAssRef) {
System.out.println("node value is ::" + childAssRef.getQName());
}
@Override
public void onCreateNode(ChildAssociationRef childAssRef) {
System.out.println("node value is ::" + childAssRef.getQName());
NodeRef nodeRefFile = childAssRef.getChildRef();
ContentReader reader = contentService.getReader(nodeRefFile,ContentModel.PROP_CONTENT);
}
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.