Merged searchapi (5.2.1) to 5.2.N (5.2.1)

130005 gjames: Merged 5.2.N-AHIND (5.2.1) to searchapi (5.2.1)
      129716 amorarasu: REPO-340 / REPO-1136 - V1 REST API: Unlock Node


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@130267 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gethin James
2016-09-06 15:12:54 +00:00
parent 91cc53e31b
commit 59a1186522
4 changed files with 83 additions and 3 deletions

View File

@@ -36,6 +36,7 @@ import org.alfresco.rest.api.model.Document;
import org.alfresco.rest.api.model.Folder; import org.alfresco.rest.api.model.Folder;
import org.alfresco.rest.api.model.LockInfo; import org.alfresco.rest.api.model.LockInfo;
import org.alfresco.rest.api.model.Node; import org.alfresco.rest.api.model.Node;
import org.alfresco.rest.api.model.UnlockInfo;
import org.alfresco.rest.api.model.UserInfo; import org.alfresco.rest.api.model.UserInfo;
import org.alfresco.rest.framework.resource.content.BasicContentInfo; import org.alfresco.rest.framework.resource.content.BasicContentInfo;
import org.alfresco.rest.framework.resource.content.BinaryResource; import org.alfresco.rest.framework.resource.content.BinaryResource;
@@ -255,6 +256,15 @@ public interface Nodes
*/ */
Node lock(String nodeId, LockInfo lockInfo, Parameters parameters); Node lock(String nodeId, LockInfo lockInfo, Parameters parameters);
/**
* Unlock a node
* @param nodeId
* @param unlockInfo
* @param parameters
* @return
*/
Node unlock(String nodeId, UnlockInfo unlockInfo, Parameters parameters);
/** /**
* Unlock a node * Unlock a node
* @param nodeId * @param nodeId

View File

@@ -0,0 +1,60 @@
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.rest.api.model;
/**
* Representation of a unlock info
*
* @author Ancuta Morarasu
*/
public class UnlockInfo
{
private Boolean includeChildren;
private Boolean allowCheckedOut;
public UnlockInfo() {}
public Boolean getIncludeChildren()
{
return includeChildren;
}
public void setIncludeChildren(Boolean includeChildren)
{
this.includeChildren = includeChildren;
}
public Boolean getAllowCheckedOut()
{
return allowCheckedOut;
}
public void setAllowCheckedOut(Boolean allowCheckedOut)
{
this.allowCheckedOut = allowCheckedOut;
}
}

View File

@@ -33,6 +33,7 @@ import org.alfresco.rest.api.Nodes;
import org.alfresco.rest.api.model.LockInfo; import org.alfresco.rest.api.model.LockInfo;
import org.alfresco.rest.api.model.Node; import org.alfresco.rest.api.model.Node;
import org.alfresco.rest.api.model.NodeTarget; import org.alfresco.rest.api.model.NodeTarget;
import org.alfresco.rest.api.model.UnlockInfo;
import org.alfresco.rest.framework.BinaryProperties; import org.alfresco.rest.framework.BinaryProperties;
import org.alfresco.rest.framework.Operation; import org.alfresco.rest.framework.Operation;
import org.alfresco.rest.framework.WebApiDescription; import org.alfresco.rest.framework.WebApiDescription;
@@ -180,6 +181,15 @@ public class NodesEntityResource implements
return nodes.lock(nodeId, lockInfo, parameters); return nodes.lock(nodeId, lockInfo, parameters);
} }
@Operation("unlock")
@WebApiDescription(title = "Unlock Node",
description="Removes a lock on a node.",
successStatus = HttpServletResponse.SC_OK)
public Node unlock(String nodeId, UnlockInfo unlockInfo, Parameters parameters, WithResponse withResponse)
{
return nodes.unlock(nodeId, unlockInfo, parameters);
}
@Operation("unlock") @Operation("unlock")
@WebApiDescription(title = "Unlock Node", @WebApiDescription(title = "Unlock Node",
description="Removes a lock on a node.", description="Removes a lock on a node.",