Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)

60578: Merged V4.2-BUG-FIX (4.2.2) to HEAD-BUG-FIX (Cloud/4.3)
      60246: Merged DEV to V4.2-BUG-FIX
      59624 : MNT-10176 : Cmisaction:setContent: No minor version created
       Create a new version when execute "Set content stream" or "update properties" actions in CMIS workbench. Add new unit test. 
      59749 : Merged DEV
       59276 : MNT-10175 : CMIS 1.1 API: Two versions are created after appending content stream with isLastChunk=true
         Create new version of document only on appending last chunk of content
       59656 : MNT-10175 : CMIS 1.1 API: Two versions are created after appending content stream with isLastChunk=true
         Test for versioning around content appending 
      60185 : MNT-10176 : Cmisaction:setContent: No minor version created
       Fix some unit test. 
      60218 : MNT-10176 : Cmisaction:setContent: No minor version created
      Corrected TestCMIS.testVersioning. 


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@62312 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2014-02-12 14:01:07 +00:00
parent 6a0c3b5490
commit 07beefbee7
3 changed files with 28 additions and 5 deletions

View File

@@ -1382,6 +1382,12 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr
removeTempFile(tempFile);
}
// MNT-10176 Cmisaction:setContent; The properties don't update.
if (connector.getNodeService().exists(nodeRef) && connector.getNodeService().hasAspect(nodeRef, ContentModel.ASPECT_VERSIONABLE))
{
connector.createVersion(nodeRef, VersionType.MINOR, "Set content stream");
}
objectId.setValue(connector.createObjectId(nodeRef));
connector.getActivityPoster().postFileFolderUpdated(info.isFolder(), nodeRef);
@@ -1490,6 +1496,12 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr
connector.setProperties(nodeRef, info.getType(), properties, new String[0]);
// MNT-10176 Cmisaction:setContent; The properties don't update.
if(connector.getNodeService().exists(nodeRef) && connector.getNodeService().hasAspect(nodeRef, ContentModel.ASPECT_VERSIONABLE))
{
connector.createVersion(nodeRef, VersionType.MINOR, "Update properties");
}
objectId.setValue(connector.createObjectId(nodeRef));
boolean isObjectInfoRequired = getContext().isObjectInfoRequired();

View File

@@ -1205,7 +1205,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
return sb.toString();
}
private void createVersion(NodeRef nodeRef, VersionType versionType, String reason)
public void createVersion(NodeRef nodeRef, VersionType versionType, String reason)
{
if(versionService.getVersionHistory(nodeRef) == null)
{
@@ -1674,11 +1674,10 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
{
NodeRef nodeRef = nodeInfo.getNodeRef();
this.disableBehaviour(ContentModel.ASPECT_VERSIONABLE, nodeRef);
if(!nodeService.hasAspect(nodeRef, ContentModel.ASPECT_CMIS_UPDATE_CONTEXT))
{
// version on first chunk
createVersion(nodeRef, VersionType.MINOR, "Append content stream");
Map<QName, Serializable> props = new HashMap<QName, Serializable>();
props.put(ContentModel.PROP_GOT_FIRST_CHUNK, true);
nodeService.addAspect(nodeRef, ContentModel.ASPECT_CMIS_UPDATE_CONTEXT, props);
@@ -1723,6 +1722,8 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
{
out.close();
}
this.enableBehaviour(ContentModel.ASPECT_VERSIONABLE, nodeRef);
}
}