03-11-2011 11:20 AM
ChildAssociationRef childAssoc = nodeService.createNode(parent, ContentModel.ASSOC_CONTAINS, assocQName, ContentModel.TYPE_CONTENT, properties);
NodeRef newNode = childAssoc.getChildRef();
ContentWriter writer = contentService.getWriter(node, ContentModel.PROP_CONTENT, true);
writer.setMimetype(mimetype);
writer.putContent(stream);
NodeRef node = nodeService.getChildByName(parent, ContentModel.ASSOC_CONTAINS, name);
versionService.createVersion(node, null);
ContentWriter writer = contentService.getWriter(node, ContentModel.PROP_CONTENT, true);
writer.setMimetype(mimetype);
writer.putContent(stream);
Exception in thread "main" org.alfresco.service.cmr.version.VersionServiceException: 02110001 The current version label of the node does not exist in the version history.
at org.alfresco.repo.version.Version2ServiceImpl.createVersion(Version2ServiceImpl.java:289)
at org.alfresco.repo.version.Version2ServiceImpl.createVersion(Version2ServiceImpl.java:139)
05-09-2012 11:26 AM
Map<String, Serializable> versionProperties = new HashMap<String, Serializable>();
versionProperties.put(VersionModel.PROP_VERSION_TYPE, VersionType.MAJOR);
versionService.createVersion(nodeRef, versionProperties);
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.