Merged 5.1.N (5.1.1) to HEAD (5.1)

121674 rmunteanu: Merged 5.0.N (5.0.4) to 5.1.N (5.1.1) (PARTIAL MERGE)
      121659 abozianu: Merged DEV to 5.0.N (5.0.4)
         121643 abozianu: MNT-14687 : Creating a document as checkedout and then cancelling the checkout should delete the document
            - fixed webscript error


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@123649 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-03-11 21:42:40 +00:00
parent de8c1e0af5
commit 678273be01

View File

@@ -2541,6 +2541,24 @@ public class ScriptNode implements Scopeable, NamespacePrefixResolverProvider
this.services.getLockService().unlock(this.nodeRef);
}
/**
* Gets the check-out of a working copy document
* @return the original Node that was checked out or null if it's not a working copy
*/
public ScriptNode getCheckedOut()
{
NodeRef original = this.services.getCheckOutCheckInService().getCheckedOut(this.nodeRef);
if(original != null)
{
return newInstance(original, this.services, this.scope);
}
else
{
return null;
}
}
/**
* Cancel the check-out of a working copy document. The working copy will be deleted and any changes made to it
* are lost. Note that this method can only be called on a working copy Node. The reference to this working copy