DocumentModel newComment;
if (commentParentRef != null) {
// if exists retrieve comment parent
DocumentModel commentParent = session.getDocument(new IdRef(
commentParentRef));
newComment = commentableDoc.addComment(commentParent, myComment);
} else {
newComment = commentableDoc.addComment(myComment);
}
// automatically validate the comments
if (CommentsConstants.COMMENT_LIFECYCLE.equals(newComment.getLifeCyclePolicy())) {