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/BRANCHES/DEV/5.1.N/root@121674 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Raluca Munteanu
2016-01-29 14:33:26 +00:00
parent 46b53eb6c8
commit 8894536641

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