private void addCommentIfNotBlank(Page blueprintPage, String comment) { if (StringUtils.isNotBlank(comment)) { comment = GeneralUtil.plain2html(comment); commentManager.addCommentToObject(blueprintPage, null, comment); } }
Comment pageComment = commentManager.getComment(Long.parseLong(commentIdStr)); if (null != pageComment) commentManager.updateCommentContent( pageComment, xhtmlContent.convertWikiToStorage( parentComment = commentManager.getComment(Long.parseLong(parentCommentIdStr)); return commentManager.addCommentToObject( commentPage, parentComment,
if (type.equals(Comment.CONTENT_TYPE)) parentComment = commentManager.getComment(id); if (parentComment == null) Comment newComment = commentManager.addCommentToObject(page, parentComment, comment); return Either.right(URI.create(applicationProperties.getBaseUrl(UrlMode.CANONICAL) + newComment.getUrlPath()));
private Map<Searchable, Integer> countComments(final List<DetailLine> detailLines, final DetailsSummaryMacroMetricsEvent.Builder metrics) { final Map<Searchable, Integer> commentsCounts; metrics.summaryTableCountCommentsStart(); commentsCounts = commentManager.countComments(searchablesFrom(detailLines)); metrics.summaryTableCountCommentsFinish(count(commentsCounts.values())); return commentsCounts; }
@Override public Map<String, ?> getComment(String authenticationToken, String commentId) { Comment comment = commentManager.getComment(Long.parseLong(commentId)); Map<String, Object> commentStruct = null; if (null != comment && permissionManager.hasPermission(AuthenticatedUserThreadLocal.getUser(), Permission.VIEW, comment)) { commentStruct = new Hashtable<String, Object>(); commentStruct.put("id", comment.getIdAsString()); if (null != comment.getParent()) commentStruct.put("parentId", comment.getParent().getIdAsString()); commentStruct.put("ownerId", comment.getOwner().getIdAsString()); commentStruct.put("content", comment.getBodyAsString()); if (StringUtils.isNotBlank(comment.getCreatorName())) commentStruct.put("creator", comment.getCreatorName()); commentStruct.put("created", comment.getCreationDate()); if (StringUtils.isNotBlank(comment.getLastModifierName())) commentStruct.put("lastModifier", comment.getLastModifierName()); commentStruct.put("lastModified", comment.getLastModificationDate()); } return commentStruct; }
commentCount += commentManager.countComments(page); commentCount += commentManager.countComments(blogPost);
private ContentReportData createReportData(List<Searchable> searchables, Map<String, String> macroParams) { Map<Searchable, Integer> commentCountsMap = null; if (isParamEnabled(macroParams, PARAM_SHOW_COMMENTS_COUNT)) { commentCountsMap = commentManager.countComments(searchables); } Map<Searchable, Integer> likeCountsMap = null; if (isParamEnabled(macroParams, PARAM_SHOW_LIKES_COUNT)) { likeCountsMap = likeManager.countLikes(searchables); } return new ContentReportData(commentCountsMap, likeCountsMap); }