/** * Get the formatted body (either html or plain-text converted to html), as a string. * * @return The formatted body as a string. */ public String getFormattedBody() { if ( getHtmlBody() != null && getHtmlBody().length() > 0 ) return m_html_body; else return Web.encodeUrlsAsHtml( FormattedText.convertPlaintextToFormattedText(m_body) ); } // getHtmlBody
if (m_body != null) m_body = FormattedText.convertPlaintextToFormattedText(m_body);
if (m_body != null) m_body = FormattedText.convertPlaintextToFormattedText(m_body);
if (m_body != null) m_body = FormattedText.convertPlaintextToFormattedText(m_body);
if (m_body != null) m_body = FormattedText.convertPlaintextToFormattedText(m_body);
m_instructions = FormattedText.convertPlaintextToFormattedText(m_instructions); if (element.getTagName().equals("instructions-formatted")) m_instructions = FormattedText.convertOldFormattedText(m_instructions);
message.setBody(FormattedText.convertPlaintextToFormattedText(inmsg.getBody()));
message.setOwner(owner); message.setMessageDate(messageDate); message.setBody(FormattedText.convertPlaintextToFormattedText(body)); message.setMigratedMessageId(migratedId);
/** * This is to mimic the FormattedText.decodeFormattedTextAttribute but use SAX serialization instead * @return */ protected String formattedTextDecodeFormattedTextAttribute(Attributes attributes, String baseAttributeName) { String ret; // first check if an HTML-encoded attribute exists, for example "foo-html", and use it if available ret = StringUtils.trimToNull(xmlDecodeAttribute(attributes, baseAttributeName + "-html")); if (ret != null) return ret; // next try the older kind of formatted text like "foo-formatted", and convert it if found ret = StringUtils.trimToNull(xmlDecodeAttribute(attributes, baseAttributeName + "-formatted")); ret = FormattedText.convertOldFormattedText(ret); if (ret != null) return ret; // next try just a plaintext attribute and convert the plaintext to formatted text if found // convert from old plaintext instructions to new formatted text instruction ret = xmlDecodeAttribute(attributes, baseAttributeName); ret = FormattedText.convertPlaintextToFormattedText(ret); return ret; }