public static Collection<CommentJsonBean> expandedShortBeans(final Collection<Comment> comments, final JiraBaseUrls urls, final ProjectRoleManager projectRoleManager, final DateTimeFormatterFactory dateTimeFormatterFactory, final RendererManager rendererManager, final String rendererType, final IssueRenderContext renderContext, final String expand, final ApplicationUser loggedInUser, final EmailFormatter emailFormatter) { Collection<CommentJsonBean> result = Lists.newArrayListWithCapacity(comments.size()); for (Comment from : comments) { result.add(expandedShortBean(from, urls, projectRoleManager, dateTimeFormatterFactory, rendererManager, rendererType, renderContext, expand, loggedInUser, emailFormatter)); } return Lists.newArrayList(result); }
/** * @return null if the input is null * @deprecated Use {@link #expandedShortBean(com.atlassian.jira.issue.comments.Comment, JiraBaseUrls, com.atlassian.jira.security.roles.ProjectRoleManager, com.atlassian.jira.datetime.DateTimeFormatterFactory, com.atlassian.jira.issue.RendererManager, String, com.atlassian.jira.issue.fields.renderer.IssueRenderContext, String, com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.util.EmailFormatter)} */ @Deprecated public static CommentJsonBean expandedShortBean(Comment comment, JiraBaseUrls urls, ProjectRoleManager projectRoleManager, DateTimeFormatterFactory dateTimeFormatterFactory, RendererManager rendererManager, String rendererType, IssueRenderContext renderContext, final String expand) { return expandedShortBean(comment, urls, projectRoleManager, dateTimeFormatterFactory, rendererManager, rendererType, renderContext, expand, ComponentAccessor.getComponent(JiraAuthenticationContext.class).getUser(), ComponentAccessor.getComponent(EmailFormatter.class)); }
@Override public Response apply(final CommentService.CommentParameters commentParameters) { Comment comment = commentService.create(user, commentValidationResult, true); CommentJsonBean entity; if (expand != null) { entity = CommentJsonBean.expandedShortBean(comment, jiraBaseUrls, projectRoleManager, dateTimeFormatterFactory, rendererManager, getCommentFieldRendererType(issue), issue.getIssueRenderContext(), expand, authContext.getUser(), emailFormatter); } else { entity = CommentJsonBean.shortBean(comment, jiraBaseUrls, projectRoleManager, authContext.getUser(), emailFormatter); } return Response.status(Response.Status.CREATED).location(getUri(entity)).entity(entity).cacheControl(never()).build(); } });
@Override public Response apply(final Map<String, JSONObject> properties) { Comment updatedComment = commentValidationResult.getComment().get(); commentService.update(user, commentValidationResult, true); CommentJsonBean bean; if (expand != null) { bean = CommentJsonBean.expandedShortBean(updatedComment, jiraBaseUrls, projectRoleManager, dateTimeFormatterFactory, rendererManager, getCommentFieldRendererType(issue), issue.getIssueRenderContext(), expand, authContext.getUser(), emailFormatter); } else { bean = CommentJsonBean.shortBean(updatedComment, jiraBaseUrls, projectRoleManager, authContext.getUser(), emailFormatter); } return Response.ok(bean).location(getUri(bean)).cacheControl(never()).build(); } });
return Response.ok(CommentJsonBean.expandedShortBean(comment, jiraBaseUrls, projectRoleManager, dateTimeFormatterFactory, rendererManager, getCommentFieldRendererType(issue), issue.getIssueRenderContext(), expand, authContext.getUser(), emailFormatter)).cacheControl(never()).build();