Merged 5.0.N (5.0.4) to 5.1.N (5.1.1)

120046 abozianu: Merged DEV to 5.0.N (5.0.4)
      117528 abozianu: MNT-14687 : Creating a document as checkedout and then cancelling the checkout should delete the document
         - added a new aspect for cmis checked out documents : ASPECT_CMIS_CHECKEDOUT
      118441 abozianu: MNT-14687 : Creating a document as checkedout and then cancelling the checkout should delete the document
         - changed aspect name from ASPECT_CMIS_CHECKEDOUT to ASPECT_CMIS_CREATED_CHECKEDOUT
      118775 abozianu: MNT-14687 : Creating a document as checkedout and then cancelling the checkout should delete the document
         - fixed commit error


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@120109 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Natalia Smintanca
2015-12-14 12:21:09 +00:00
parent 03deaa808f
commit 0b95d698a8
5 changed files with 79 additions and 6 deletions

View File

@@ -488,6 +488,7 @@ public class CheckOutCheckInServiceImpl implements CheckOutCheckInService,Extens
nodeService.addAspect(workingCopy, ContentModel.ASPECT_LOCKABLE, null);
nodeService.addAspect(nodeRef, ContentModel.ASPECT_CHECKED_OUT, null);
nodeService.createAssociation(nodeRef, workingCopy, ContentModel.ASSOC_WORKING_COPY_LINK);
nodeService.removeAspect(workingCopy, ContentModel.ASPECT_CMIS_CREATED_CHECKEDOUT);
}
finally
{
@@ -648,13 +649,17 @@ public class CheckOutCheckInServiceImpl implements CheckOutCheckInService,Extens
}
}
}
if (versionProperties != null && nodeService.hasAspect(nodeRef, ContentModel.ASPECT_VERSIONABLE))
if (versionProperties != null &&
nodeService.hasAspect(nodeRef, ContentModel.ASPECT_VERSIONABLE) &&
!nodeService.hasAspect(nodeRef, ContentModel.ASPECT_CMIS_CREATED_CHECKEDOUT))
{
// Create the new version
this.versionService.createVersion(nodeRef, versionProperties);
}
nodeService.removeAspect(nodeRef, ContentModel.ASPECT_CMIS_CREATED_CHECKEDOUT);
if (keepCheckedOut == false)
{
// Delete the working copy
@@ -728,6 +733,11 @@ public class CheckOutCheckInServiceImpl implements CheckOutCheckInService,Extens
// Invoke policy
invokeOnCancelCheckOut(nodeRef);
if (nodeService.hasAspect(nodeRef, ContentModel.ASPECT_CMIS_CREATED_CHECKEDOUT))
{
nodeService.deleteNode(nodeRef);
}
}
catch (UnableToReleaseLockException exception)
{
@@ -740,7 +750,7 @@ public class CheckOutCheckInServiceImpl implements CheckOutCheckInService,Extens
return nodeRef;
}
@Override
@Extend(traitAPI=CheckOutCheckInServiceTrait.class,extensionAPI=CheckOutCheckInServiceExtension.class)
public NodeRef getWorkingCopy(NodeRef nodeRef)