Fix ALF-3086: CMIS checkin of a non-versionable document should make it versionable

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@20477 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2010-06-01 15:17:07 +00:00
parent 16d62588ad
commit 9dac0368c1

View File

@@ -1048,6 +1048,13 @@ public class CMISServicesImpl implements CMISServices, ApplicationContextAware,
NodeRef nodeRef = getObject(objectId, NodeRef.class, true, true, true);
try
{
if (this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_VERSIONABLE) == false)
{
Map<QName, Serializable> props = new HashMap<QName, Serializable>();
props.put(ContentModel.PROP_INITIAL_VERSION, false);
props.put(ContentModel.PROP_AUTO_VERSION, false);
this.nodeService.addAspect(nodeRef, ContentModel.ASPECT_VERSIONABLE, props);
}
return checkOutCheckInService.checkin(nodeRef, createVersionProperties(checkinComment, isMajor));
}
catch (CheckOutCheckInServiceException e)