class documentation

class Exportable(_filtermanager.FilterItem): (source)

View In Hierarchy

Mixin that provides XML, HTML, and archive export helpers.

Method exportExternalResources Download configured remote resources and relink them locally.
Method exportRessources Export auxiliary resources required by an archive export.
Method getObjChildrenToXml Render all filtered child nodes as XML fragments.
Method getObjToXml Render the current object as its custom XML fragment.
Method manage_export Export the current object in one of the configured formats.
Method recurse_downloadHtmlPages Recursively render and store HTML pages for a content subtree.
Method toXhtml Render the current object as localized standalone HTML.
Method toXml Render the current object tree as an XML export document.
Method toZippedHtml Build a ZIP archive containing localized HTML export pages.
Method toZippedXml Build a ZIP archive containing the XML export and resources.
Class Variable security Undocumented
def exportExternalResources(self, obj, html, path, REQUEST): (source)

Download configured remote resources and relink them locally.

Parameters
obj:OFS.SimpleItem.ItemContent object whose HTML is being exported.
html:strRendered markup.
path:strDirectory receiving downloaded resources.
REQUEST:ZPublisher.HTTPRequestCurrent request.
Returns
strMarkup with localized external resource links.
def exportRessources(self, tempfolder, REQUEST, from_content=True, from_zms=False, from_home=False): (source)

Export auxiliary resources required by an archive export.

Parameters
tempfolder:strTemporary export directory.
REQUEST:ZPublisher.HTTPRequestCurrent request.
from_content:boolExport resources referenced by content.
from_zms:boolExport shared ZMS product resources.
from_home:boolExport resources from the site root.
Returns
listPaths of exported resources.
def getObjChildrenToXml(self): (source)

Render all filtered child nodes as XML fragments.

Returns
strSerialized XML for child nodes.
def getObjToXml(self): (source)

Render the current object as its custom XML fragment.

Returns
strSerialized XML fragment.
def manage_export(self, export_format, lang, REQUEST, RESPONSE): (source)

Export the current object in one of the configured formats.

Parameters
export_format:int or strRequested export format id.
lang:strActive language.
REQUEST:ZPublisher.HTTPRequestCurrent request.
RESPONSE:ZPublisher.HTTPResponseCurrent response.
Returns
str or bytesExport payload when downloading directly.
def recurse_downloadHtmlPages(self, obj, path, lang, REQUEST): (source)

Recursively render and store HTML pages for a content subtree.

Parameters
obj:OFS.SimpleItem.ItemRoot object of the subtree.
path:strDestination directory.
lang:strActive export language.
REQUEST:ZPublisher.HTTPRequestCurrent request.
def toXhtml(self, REQUEST, deep=True): (source)

Render the current object as localized standalone HTML.

Parameters
REQUEST:ZPublisher.HTTPRequestCurrent request.
deep:boolInclude child content recursively.
Returns
str or bytesExportable HTML or XHTML markup.
def toXml(self, REQUEST=None, deep=True, data2hex=False, multilang=True): (source)

Render the current object tree as an XML export document.

Parameters
REQUEST:ZPublisher.HTTPRequestRequest used to resolve export context.
deep:boolInclude child nodes recursively.
data2hex:boolHex-encode binary data values.
multilang:boolInclude all language variants.
Returns
strSerialized XML export.
def toZippedHtml(self, REQUEST, get_data=True): (source)

Build a ZIP archive containing localized HTML export pages.

Parameters
REQUEST:ZPublisher.HTTPRequestCurrent request.
get_data:boolReturn archive bytes instead of a file path.
Returns
str or bytesZIP archive payload or path.
def toZippedXml(self, REQUEST, get_data=True): (source)

Build a ZIP archive containing the XML export and resources.

Parameters
REQUEST:ZPublisher.HTTPRequestCurrent request.
get_data:boolReturn archive bytes instead of a file path.
Returns
str or bytesZIP archive payload or path.
security = (source)

Undocumented