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

130261 gjames: Merged searchapi (5.2.1) to 5.2.N (5.2.1)
      129999 ahind: Merged 5.2.N-AHIND (5.2.1) to searchapi (5.2.1)
         129643 amorarasu: REPO-164 / REPO-1086 - V1 REST API: Lock Node


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@130344 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-09-06 22:06:41 +00:00
parent 4ab6e72418
commit 51b838e2ef
4 changed files with 42 additions and 41 deletions

View File

@@ -245,7 +245,7 @@ public interface Nodes
* @return
*/
List<AssocTarget> addTargets(String sourceNodeId, List<AssocTarget> entities);
/**
* Lock a node
* @param nodeId
@@ -254,7 +254,7 @@ public interface Nodes
* @return
*/
Node lock(String nodeId, LockInfo lockInfo, Parameters parameters);
/**
* Unlock a node
* @param nodeId

View File

@@ -1333,7 +1333,7 @@ public class NodesImpl implements Nodes
Set<QName> assocTypeQNames = buildAssocTypes(assocTypeQNameParam);
// call GetChildrenCannedQuery (via FileFolderService)
if (((filterProps == null) || (filterProps.size() == 0)) &&
if (((filterProps == null) || (filterProps.size() == 0)) &&
((assocTypeQNames == null) || (assocTypeQNames.size() == 0)) &&
(smartStore.isVirtual(parentNodeRef)|| (smartStore.canVirtualize(parentNodeRef))))
{
@@ -1996,11 +1996,11 @@ public class NodesImpl implements Nodes
return false;
}
private boolean isLocked(NodeRef nodeRef, Set<QName> aspects)
{
boolean locked = false;
if (((aspects != null) && aspects.contains(ContentModel.ASPECT_LOCKABLE))
if (((aspects != null) && aspects.contains(ContentModel.ASPECT_LOCKABLE))
|| nodeService.hasAspect(nodeRef, ContentModel.ASPECT_LOCKABLE))
{
locked = lockService.isLocked(nodeRef);
@@ -2970,10 +2970,10 @@ public class NodesImpl implements Nodes
lockInfo = validateLockInformation(lockInfo);
lockService.lock(nodeRef, lockInfo.getMappedType(), lockInfo.getTimeToExpire(), lockInfo.getLifetime());
return getFolderOrDocument(nodeId, parameters);
}
private LockInfo validateLockInformation(LockInfo lockInfo)
{
// Set default values for the lock details.
@@ -3001,7 +3001,7 @@ public class NodesImpl implements Nodes
{
throw new PermissionDeniedException("Current user doesn't have permission to unlock node " + nodeId);
}
lockService.unlock(nodeRef);
return getFolderOrDocument(nodeId, parameters);
}

View File

@@ -170,7 +170,7 @@ public class NodesEntityResource implements
{
return nodes.moveOrCopyNode(nodeId, target.getTargetParentId(), target.getName(), parameters, false);
}
@Operation("lock")
@WebApiDescription(title = "Lock Node",
description="Places a lock on a node.",
@@ -179,7 +179,7 @@ public class NodesEntityResource implements
{
return nodes.lock(nodeId, lockInfo, parameters);
}
@Operation("unlock")
@WebApiDescription(title = "Unlock Node",
description="Removes a lock on a node.",