mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -1382,6 +1382,12 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr
|
|||||||
removeTempFile(tempFile);
|
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));
|
objectId.setValue(connector.createObjectId(nodeRef));
|
||||||
|
|
||||||
connector.getActivityPoster().postFileFolderUpdated(info.isFolder(), 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]);
|
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));
|
objectId.setValue(connector.createObjectId(nodeRef));
|
||||||
|
|
||||||
boolean isObjectInfoRequired = getContext().isObjectInfoRequired();
|
boolean isObjectInfoRequired = getContext().isObjectInfoRequired();
|
||||||
|
@@ -1205,7 +1205,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
|
|||||||
return sb.toString();
|
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)
|
if(versionService.getVersionHistory(nodeRef) == null)
|
||||||
{
|
{
|
||||||
@@ -1674,11 +1674,10 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
|
|||||||
{
|
{
|
||||||
NodeRef nodeRef = nodeInfo.getNodeRef();
|
NodeRef nodeRef = nodeInfo.getNodeRef();
|
||||||
|
|
||||||
|
this.disableBehaviour(ContentModel.ASPECT_VERSIONABLE, nodeRef);
|
||||||
|
|
||||||
if(!nodeService.hasAspect(nodeRef, ContentModel.ASPECT_CMIS_UPDATE_CONTEXT))
|
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>();
|
Map<QName, Serializable> props = new HashMap<QName, Serializable>();
|
||||||
props.put(ContentModel.PROP_GOT_FIRST_CHUNK, true);
|
props.put(ContentModel.PROP_GOT_FIRST_CHUNK, true);
|
||||||
nodeService.addAspect(nodeRef, ContentModel.ASPECT_CMIS_UPDATE_CONTEXT, props);
|
nodeService.addAspect(nodeRef, ContentModel.ASPECT_CMIS_UPDATE_CONTEXT, props);
|
||||||
@@ -1723,6 +1722,8 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
|
|||||||
{
|
{
|
||||||
out.close();
|
out.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.enableBehaviour(ContentModel.ASPECT_VERSIONABLE, nodeRef);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -495,7 +495,17 @@ public class CMISTest
|
|||||||
|
|
||||||
// checkout/checkin object with mimetype and encoding
|
// checkout/checkin object with mimetype and encoding
|
||||||
{
|
{
|
||||||
objectIdHolder.setValue(objectId);
|
ObjectData objectDa = withCmisService(new CmisServiceCallback<ObjectData>()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public ObjectData execute(CmisService cmisService)
|
||||||
|
{
|
||||||
|
return cmisService.getObjectByPath(repositoryId, path, null, false, IncludeRelationships.NONE, null, false, false, null);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
objectIdHolder.setValue(objectDa.getId());
|
||||||
withCmisService(new CmisServiceCallback<Void>()
|
withCmisService(new CmisServiceCallback<Void>()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user