From 30a211d262379c2e4a23ba274dd8617b7d3fdff6 Mon Sep 17 00:00:00 2001 From: Jan Vonka Date: Thu, 1 Sep 2016 10:35:46 +0000 Subject: [PATCH] REPO-1187 / REPO-164: V1 REST API to "lock content node" - initially, we will support one of two lock types, either ALLOW_OWNER_CHANGES (default, if not requested otherwise) or FULL - we will not support ALLOW_ADD_CHILDREN lock type (removed as part of this change request) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@130046 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- source/java/org/alfresco/rest/api/model/LockInfo.java | 7 ++++--- .../test-java/org/alfresco/rest/api/tests/NodeApiTest.java | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/source/java/org/alfresco/rest/api/model/LockInfo.java b/source/java/org/alfresco/rest/api/model/LockInfo.java index ebadd9e052..47351c8f4c 100644 --- a/source/java/org/alfresco/rest/api/model/LockInfo.java +++ b/source/java/org/alfresco/rest/api/model/LockInfo.java @@ -48,9 +48,9 @@ public class LockInfo @SuppressWarnings("deprecation") public static enum LockType2 { - FULL(LockType.READ_ONLY_LOCK), - ALLOW_ADD_CHILDREN(LockType.NODE_LOCK), - ALLOW_OWNER_CHANGES(LockType.WRITE_LOCK); + FULL(LockType.READ_ONLY_LOCK), + ALLOW_OWNER_CHANGES(LockType.WRITE_LOCK); + // ALLOW_ADD_CHILDREN(LockType.NODE_LOCK); // removed for now, as per REPO-1187 private LockType type; @@ -58,6 +58,7 @@ public class LockInfo { this.type = type; } + public LockType getType() { return type; diff --git a/source/test-java/org/alfresco/rest/api/tests/NodeApiTest.java b/source/test-java/org/alfresco/rest/api/tests/NodeApiTest.java index a88d018fc4..169075d696 100644 --- a/source/test-java/org/alfresco/rest/api/tests/NodeApiTest.java +++ b/source/test-java/org/alfresco/rest/api/tests/NodeApiTest.java @@ -3728,6 +3728,10 @@ public class NodeApiTest extends AbstractSingleNetworkSiteTest Map body = new HashMap<>(); body.put("type", "FULL123"); post(getNodeOperationUrl(dC1Id, "lock"), toJsonAsStringNonNull(body), null, 400); + + body = new HashMap<>(); + body.put("type", "ALLOW_ADD_CHILDREN"); + post(getNodeOperationUrl(dC1Id, "lock"), toJsonAsStringNonNull(body), null, 400); body = new HashMap<>(); body.put("lifetime", "PERSISTENT123");