02-10-2011 06:24 AM
// create PARENT node
NodeRef parent = nodeService.createNode(folder,
ContentModel.ASSOC_CONTAINS,
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, name),
ContentModel.TYPE_FOLDER,
contentProps).getChildRef();
nodeService.addAspect(parent,ContentModel.ASPECT_VERSIONABLE, null);
// create first CHILD node
NodeRef firstChild = nodeService.createNode(parent,
ContentModel.ASSOC_CONTAINS,
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, parent.getId()),
ContentModel.TYPE_CONTENT).getChildRef();
nodeService.addAspect(firstChild,ContentModel.ASPECT_VERSIONABLE, null);
Map<String, Serializable> versionProps = new HashMap<String, Serializable>();
//create the first version
versionProps.put("NomeVersione", "prima");
versionService.createVersion(parent, versionProps, false);
//create second CHILD node
NodeRef secondChild = nodeService.createNode(parent,
ContentModel.ASSOC_CONTAINS,
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, parent.getId()),
ContentModel.TYPE_CONTENT).getChildRef();
nodeService.addAspect(secondChild,ContentModel.ASPECT_VERSIONABLE, null);
//crea the second version
versionProps.put("NomeVersione", "seconda");
versionService.createVersion(parent, versionProps, false);
// END OF ADD OPERATIONS
nodeService.removeChild(parent, firstChild);
08-30-2012 01: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.