mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged 5.1.N (5.1.2) to 5.2.N (5.2.1)
128190 amorarasu: Merged 5.1.1 (5.1.1) to 5.1.N (5.1.2) 128171 amukha: MNT-16401: Delete comment notification from Blog or Links is not displayed in Site Activities dashlet - Corrected the comemnts webscript. - Added JUnit tests. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@128215 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -68,6 +68,24 @@ public class CommentDelete extends AbstractCommentsWebScript
|
||||
parentNodeRef = new NodeRef((String) getOrNull(jsonPageParams, JSON_KEY_NODEREF));
|
||||
}
|
||||
|
||||
if (parentNodeRef == null)
|
||||
{
|
||||
// find the parent content node for the comment
|
||||
// Example would be a blog post which will have the following structure:
|
||||
// blog post -> forum node -> topic node -> the actual comment node
|
||||
NodeRef topicNodeRef = nodeService.getPrimaryParent(nodeRef).getParentRef();
|
||||
if (topicNodeRef == null || !nodeService.getType(topicNodeRef).equals(ForumModel.TYPE_TOPIC))
|
||||
{
|
||||
throw new IllegalArgumentException("The NodeRef specified is not a child of the topic.");
|
||||
}
|
||||
NodeRef forumNodeRef = nodeService.getPrimaryParent(topicNodeRef).getParentRef();
|
||||
if (forumNodeRef == null || !nodeService.getType(forumNodeRef).equals(ForumModel.TYPE_FORUM))
|
||||
{
|
||||
throw new IllegalArgumentException("The NodeRef specified doesn't belong to a correct structure of forums.");
|
||||
}
|
||||
parentNodeRef = nodeService.getPrimaryParent(forumNodeRef).getParentRef();
|
||||
}
|
||||
|
||||
if (parentNodeRef != null)
|
||||
{
|
||||
this.behaviourFilter.disableBehaviour(parentNodeRef, ContentModel.ASPECT_AUDITABLE);
|
||||
|
Reference in New Issue
Block a user