public void encodeFormattedTextAttribute(Element element, String baseAttributeName, String value) { // store the formatted text in an attribute called baseAttributeName-html Xml.encodeAttribute(element, baseAttributeName + "-html", value); // Store the non-formatted (plaintext) version as well Xml.encodeAttribute(element, baseAttributeName, convertFormattedTextToPlaintext(value)); }
/** * Serialize the properties into XML, adding an element to the doc under the top of the stack element. * * @param propsToSerialize * The properties to serialize. * @param doc * The DOM doc to contain the XML (or null for a string return). * @param stack * The DOM elements, the top of which is the containing element of the new "resource" element. * @return The newly added element. */ public static Element propertiesToXml(Properties propsToSerialize, Document doc, Stack<Element> stack) { Element properties = doc.createElement("properties"); ((Element) stack.peek()).appendChild(properties); Enumeration<?> props = propsToSerialize.propertyNames(); while (props.hasMoreElements()) { String name = (String) props.nextElement(); String value = propsToSerialize.getProperty(name); Element propElement = doc.createElement("property"); properties.appendChild(propElement); propElement.setAttribute("name", name); // encode to allow special characters in the value Xml.encodeAttribute(propElement, "value", (String) value); propElement.setAttribute("enc", "BASE64"); } return properties; }
if (m_description != null) Xml.encodeAttribute(role, "description-enc", m_description); if (m_providerOnly) Xml.encodeAttribute(role, "provider-only", "true");
/** * Serialize the resource into XML, adding an element to the doc under the top of the stack element. * * @param doc * The DOM doc to contain the XML (or null for a string return). * @param stack * The DOM elements, the top of which is the containing element of the new "resource" element. * @return The newly added element. */ public Element toXml(Document doc, Stack stack) { Element message = super.toXml(doc, stack); // Over-ride super.toXml() definition of body and body-html attributes // store the html body in attribute Xml.encodeAttribute(message, "body-html", getHtmlBody() ); // store the plain-text body in attribute Xml.encodeAttribute(message, "body", getBody() ); return message; } } // class BasicMailArchiveMessageEdit
Xml.encodeAttribute(propElement, "value", (String) value); propElement.setAttribute("enc", "BASE64"); properties.appendChild(propElement); propElement.setAttribute("name", name); Xml.encodeAttribute(propElement, "value", (String) val); propElement.setAttribute("enc", "BASE64"); propElement.setAttribute("list", "list");
Xml.encodeAttribute(message, "subject", msg.getSubject()); Xml.encodeAttribute(message, "body", msg.getBody());
if (newCreatorId != null) Xml.encodeAttribute(element4, "CHEF:creator", newCreatorId); element4.setAttribute("enc", "BASE64"); if (newModifierId != null) Xml.encodeAttribute(element4, "CHEF:creator", newModifierId); element4.setAttribute("enc", "BASE64");
if (newCreatorId != null) Xml.encodeAttribute(element4, "CHEF:creator", newCreatorId); element4.setAttribute("enc", "BASE64"); if (newModifierId != null) Xml.encodeAttribute(element4, "CHEF:modifiedby", newModifierId); element4.setAttribute("enc", "BASE64");
Xml.encodeAttribute(site, "short-description-enc", m_shortDescription); Xml.encodeAttribute(site, "description-enc", m_description);
Xml.encodeAttribute(propElement, "value", (String) value); propElement.setAttribute("enc", "BASE64"); properties.appendChild(propElement); propElement.setAttribute("name", key); Xml.encodeAttribute(propElement, "value", (String) val); propElement.setAttribute("enc", "BASE64"); propElement.setAttribute("list", "list");