use of org.xwiki.filter.instance.input.DocumentInstanceInputProperties in project xwiki-platform by xwiki.
the class XWikiAttachment method toXML.
/**
* Write an XML representation of the attachment into an {@link com.xpn.xwiki.internal.xml.XMLWriter}
*
* @param out the output where to write the XML
* @param bWithAttachmentContent if true, binary content of the attachment is included (base64 encoded)
* @param bWithVersions if true, all archive version is also included
* @param format true if the XML should be formated
* @param encoding the encoding to use when serializing XML
* @throws XWikiException when an error occurs during xwiki operation
* @since 9.10RC1
*/
public void toXML(OutputTarget out, boolean bWithAttachmentContent, boolean bWithVersions, boolean format, String encoding) throws XWikiException {
// Input
DocumentInstanceInputProperties documentProperties = new DocumentInstanceInputProperties();
documentProperties.setWithWikiAttachmentsContent(bWithAttachmentContent);
documentProperties.setWithJRCSRevisions(bWithVersions);
documentProperties.setWithRevisions(false);
// Output
XAROutputProperties xarProperties = new XAROutputProperties();
xarProperties.setPreserveVersion(bWithVersions);
xarProperties.setEncoding(encoding);
xarProperties.setFormat(format);
try {
Utils.getComponent(XWikiDocumentFilterUtils.class).exportEntity(this, out, xarProperties, documentProperties);
} catch (Exception e) {
throw new XWikiException(XWikiException.MODULE_XWIKI_DOC, XWikiException.ERROR_DOC_XML_PARSING, "Error parsing xml", e, null);
}
}
Aggregations