public String linkBugKeys(String body) { return JiraKeyUtils.linkBugKeys(body); }
public String render(String value, IssueRenderContext context) { return JiraKeyUtils.linkBugKeys(TextUtils.plainTextToHtml(value)); }
public int doEndTag() throws JspException { try { String body = bodyContent.getString(); bodyContent.clearBody(); // Provide the path so that links still work - even if the page is not requested by the "usual" URL final HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); bodyContent.getEnclosingWriter().write(JiraKeyUtils.linkBugKeys(body)); } catch (IOException e) { throw new JspException("IOException: " + e); } return super.doEndTag(); } }
private List<ChangesetDO> searchForChangesets(RepositoryPath repositoryPath, Integer numberToDisplay, Collection<ValidationError> errors) throws OAuthNotAuthorisedException { List<ChangesetDO> changesets = new ArrayList<ChangesetDO>(); try { List<Changeset> found = changeSetManager.searchForChangeSets(repositoryPath, numberToDisplay); for (Changeset cs : found) { changesets.add( new ChangesetDO( cs.getCsid(), cs.getAuthor(), JiraKeyUtils.linkBugKeys(TextUtils.plainTextToHtml(cs.getMsgPreview())), cs.getRevisionCount(), cs.getFullName() ) ); } } catch (OAuthNotAuthorisedException oauth) { //handle this higher up the stack throw oauth; } catch (IOException e) { log.error("Error retrieving changesets from fisheye", e); errors.add(new ValidationError("feError", "gadget.fisheye.error.io")); } return changesets; }
/** * Retrieves the html formatted environment. * <p/> * A simple string (with linked bug keys displayed) is returned if a rendered version cannot be generated. * * @return String the html formatted environment. */ public String getHtmlEnvironment() { // Try to generate rendered values for environment try { FieldLayout fieldLayout = fieldLayoutManager.getFieldLayout(issue); FieldLayoutItem fieldLayoutItem = fieldLayout.getFieldLayoutItem(IssueFieldConstants.ENVIRONMENT); String rendererType = (fieldLayoutItem != null) ? fieldLayoutItem.getRendererType() : null; String renderedContent = rendererManager.getRenderedContent(rendererType, issue.getEnvironment(), issue.getIssueRenderContext()); return renderedContent.replaceAll("<p>", "<p style='margin-top:0;margin-bottom:10px;'>"); } catch (Exception e) { log.warn("Unable to produce rendered version of the environment for the issue " + issue.getKey(), e); return JiraKeyUtils.linkBugKeys(issue.getEnvironment()); } }
originalCommentParams.put("originalhtmlComment", JiraKeyUtils.linkBugKeys(originalComment.getBody()));
/** * Retrieves the html formatted description. * <p/> * A simple string (with linked bug keys displayed) is returned if a rendered version cannot be generated. * * @return String the html formatted description. */ public String getHtmlDescription() { // Try to generate rendered values for description try { FieldLayout fieldLayout = fieldLayoutManager.getFieldLayout(issue); FieldLayoutItem fieldLayoutItem = fieldLayout.getFieldLayoutItem(IssueFieldConstants.DESCRIPTION); String rendererType = (fieldLayoutItem != null) ? fieldLayoutItem.getRendererType() : null; String renderedContent = rendererManager.getRenderedContent(rendererType, issue.getDescription(), issue.getIssueRenderContext()); return renderedContent.replaceAll("<p>", "<p style='margin-top:0;margin-bottom:10px;'>"); } catch (Exception e) { log.warn("Unable to produce rendered version of the description for the issue " + issue.getKey(), e); return JiraKeyUtils.linkBugKeys(issue.getDescription()); } }
commentParams.put("htmlComment", JiraKeyUtils.linkBugKeys(comment.getBody()));