public final static String plainTextToHtml(String str, String target) { return plainTextToHtml(str, target, true); }
/** * Converts plain text to html code. * * <ul> * <li>escapes appropriate characters * <li>puts in line breaks * <li>hyperlinks link and email addresses * </ul> * * @param str - String containing the plain text. * @return the escaped string */ public final static String plainTextToHtml(String str) { return plainTextToHtml(str, null); }
public final static String plainTextToHtml(String str, boolean encodeSpecialChars) { return plainTextToHtml(str, null, encodeSpecialChars); }
/** * Converts plain text to html code. * * <ul> * <li>escapes appropriate characters * <li>puts in line breaks * <li>hyperlinks link and email addresses * </ul> * * @param str - String containing the plain text. * @return the escaped string */ public final static String plainTextToHtml(String str) { return plainTextToHtml(str, null); }
public String textToHtml(String s) { return TextUtils.plainTextToHtml(s); }
public final static String plainTextToHtml(String str, boolean encodeSpecialChars) { return plainTextToHtml(str, null, encodeSpecialChars); }
public final static String plainTextToHtml(String str, String target) { return plainTextToHtml(str, target, true); }
public static String getExceptionAsHtml(final SearchException e) { return TextUtils.plainTextToHtml(ExceptionUtils.getFullStackTrace(e)); } }
public String render(String value, IssueRenderContext context) { return JiraKeyUtils.linkBugKeys(TextUtils.plainTextToHtml(value)); }
/** * Highlight a change log by breaking it into separate lines and highlighting each one */ public static String highlight(String body, String colour) { String htmlBody = TextUtils.plainTextToHtml(body); StringTokenizer st = new StringTokenizer(htmlBody, "\n"); StringBuilder buff = new StringBuilder(htmlBody.length()); while (st.hasMoreTokens()) { buff.append(highlightLine(st.nextToken() + "\n", colour)); } return TextUtils.closeTags(buff.toString()); }
void addErrors( final Set<Plugin> outdatedPlugins) { final String description = "Plugins found that are not compatible with JIRA v" + buildUtilsInfo.getVersion() + ". " + "The following plugins need to be either removed or updated in order for JIRA to start successfully:"; final StringBuilder pluginNames = new StringBuilder(); for (Plugin outdatedPlugin : outdatedPlugins) { pluginNames.append(pluginsToCheck.get(outdatedPlugin.getKey()).getErrorMessage(outdatedPlugin)).append("\n"); } final String cacMessage = "Please visit " + PAC_LINK + " to download the latest versions of these plugins."; final List<String> messages = CollectionBuilder.newBuilder("", description, "", pluginNames.toString().trim(), "", cacMessage, "").asList(); startupLog.printMessage(messages, Level.ERROR); final Event event = new Event(EventType.get("outdated-plugins-installed"), description + "<p/>" + TextUtils.plainTextToHtml(pluginNames.toString()) + "<p/>" + TextUtils.plainTextToHtml(cacMessage), EventLevel.get(EventLevel.ERROR)); final JohnsonEventContainer eventCont = johnsonProvider.getContainer(); eventCont.addEvent(event); }
public int doEndTag() throws JspException { try { String body = bodyContent.getString(); bodyContent.clearBody(); bodyContent.getEnclosingWriter().write(TextUtils.plainTextToHtml(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; }
addErrorMessage(TextUtils.plainTextToHtml(getText("admin.errors.export.exception.occured.backing.up", e))); return ERROR;