REPO-340 / REPO-1136 - V1 REST API: Unlock Node

- Removed the allowCheckedOut option from the unlock body

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@129804 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ancuta Morarasu
2016-08-23 20:24:18 +00:00
parent d53ac5135a
commit b04cef45d1
3 changed files with 12 additions and 20 deletions

View File

@@ -2991,12 +2991,7 @@ public class NodesImpl implements Nodes
{ {
unlockInfo.setIncludeChildren(false); unlockInfo.setIncludeChildren(false);
} }
if (unlockInfo.getAllowCheckedOut() == null) lockService.unlock(nodeRef, unlockInfo.getIncludeChildren());
{
unlockInfo.setAllowCheckedOut(false);
}
lockService.unlock(nodeRef, unlockInfo.getIncludeChildren(), unlockInfo.getAllowCheckedOut());
return getFolderOrDocument(nodeId, parameters); return getFolderOrDocument(nodeId, parameters);
} }

View File

@@ -34,7 +34,7 @@ package org.alfresco.rest.api.model;
public class UnlockInfo public class UnlockInfo
{ {
private Boolean includeChildren; private Boolean includeChildren;
private Boolean allowCheckedOut; // private Boolean allowCheckedOut;
public UnlockInfo() {} public UnlockInfo() {}
@@ -47,14 +47,14 @@ public class UnlockInfo
{ {
this.includeChildren = includeChildren; this.includeChildren = includeChildren;
} }
//
public Boolean getAllowCheckedOut() // public Boolean getAllowCheckedOut()
{ // {
return allowCheckedOut; // return allowCheckedOut;
} // }
//
public void setAllowCheckedOut(Boolean allowCheckedOut) // public void setAllowCheckedOut(Boolean allowCheckedOut)
{ // {
this.allowCheckedOut = allowCheckedOut; // this.allowCheckedOut = allowCheckedOut;
} // }
} }

View File

@@ -87,7 +87,6 @@ import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.service.cmr.site.SiteVisibility; import org.alfresco.service.cmr.site.SiteVisibility;
import org.alfresco.util.GUID; import org.alfresco.util.GUID;
import org.alfresco.util.TempFileProvider; import org.alfresco.util.TempFileProvider;
import org.apache.http.HttpStatus;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;
@@ -3786,7 +3785,6 @@ public class NodeApiTest extends AbstractSingleNetworkSiteTest
UnlockInfo unlockInfo = new UnlockInfo(); UnlockInfo unlockInfo = new UnlockInfo();
unlockInfo.setIncludeChildren(true); unlockInfo.setIncludeChildren(true);
unlockInfo.setAllowCheckedOut(true);
HttpResponse response = post(getNodeOperationUrl(d1Id, "unlock"), toJsonAsStringNonNull(unlockInfo), null, 200); HttpResponse response = post(getNodeOperationUrl(d1Id, "unlock"), toJsonAsStringNonNull(unlockInfo), null, 200);
Document documentResp = RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Document.class); Document documentResp = RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Document.class);
@@ -3910,7 +3908,6 @@ public class NodeApiTest extends AbstractSingleNetworkSiteTest
// Unlock folder and children // Unlock folder and children
UnlockInfo unlockInfo = new UnlockInfo(); UnlockInfo unlockInfo = new UnlockInfo();
unlockInfo.setIncludeChildren(true); unlockInfo.setIncludeChildren(true);
unlockInfo.setAllowCheckedOut(true);
post(getNodeOperationUrl(folderAId, "unlock"), toJsonAsStringNonNull(unlockInfo), null, 200); post(getNodeOperationUrl(folderAId, "unlock"), toJsonAsStringNonNull(unlockInfo), null, 200);
params = Collections.singletonMap("include", "aspectNames,properties,isLocked"); params = Collections.singletonMap("include", "aspectNames,properties,isLocked");