mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
65590: Merged V4.2-BUG-FIX (4.2.2) to HEAD-BUG-FIX (4.3/Cloud) 65433: Merged DEV to V4.2-BUG-FIX (4.2.2) 63225 : MNT-10536 : Public API > GET nodes/<nodeId>/comments. - Throw InvalidArgumentException (status 400) if detected node is not a content or a folder 65046 : MNT-10536 : Public API > GET nodes/<nodeId>/comments. - Test for the fix git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@66245 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -38,6 +38,8 @@ package org.alfresco.rest.api.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.AbstractList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -215,6 +217,14 @@ public class CommentsImpl implements Comments
|
||||
public CollectionWithPagingInfo<Comment> getComments(String nodeId, Paging paging)
|
||||
{
|
||||
final NodeRef nodeRef = nodes.validateNode(nodeId);
|
||||
|
||||
/* MNT-10536 : fix */
|
||||
final Set<QName> contentAndFolders =
|
||||
new HashSet<QName>(Arrays.asList(ContentModel.TYPE_FOLDER, ContentModel.TYPE_CONTENT));
|
||||
if (!nodes.nodeMatches(nodeRef, contentAndFolders, null))
|
||||
{
|
||||
throw new InvalidArgumentException("NodeId of folder or content is expected");
|
||||
}
|
||||
|
||||
PagingRequest pagingRequest = Util.getPagingRequest(paging);
|
||||
final PagingResults<NodeRef> pagingResults = commentService.listComments(nodeRef, pagingRequest);
|
||||
|
Reference in New Issue
Block a user