module documentation

_importable.py - ZMS Importable Mixin

Provides recurse_importContent, importContent, importFile helper functions for object import, deserialization, and batch uploads. It parses incoming ZEXP/ZIP uploads, reconstructs object graphs, and validates imported content.

License: GNU General Public License v2 or later, Organization: ZMS Publishing

Function importContent Import one XML content stream into the current object tree.
Function importFile Import content from an uploaded file or archive.
Function recurse_importContent Post-process imported objects and restore persisted blob payloads.
def importContent(self, file): (source)

Import one XML content stream into the current object tree.

The method temporarily disables catalog awareness, parses the XML stream, triggers post-processing via recurse_importContent, and finally fires the import event hook.

Parameters
selfUndocumented
file:file-like objectOpen XML file-like object to parse.
Returns
objectImported object root.
def importFile(self, file, REQUEST, handler): (source)

Import content from an uploaded file or archive.

Supports direct .zexp import, zipped packages containing XML/HTML, and optional import-filter preprocessing before delegating to handler.

Parameters
selfUndocumented
file:file-like objectUploaded file object or path-like input.
REQUEST:ZPublisher.HTTPRequestCurrent request containing optional filter configuration.
handler:callableCallable that performs the final XML import step.
Returns
objectImported object root.
def recurse_importContent(self, folder): (source)

Post-process imported objects and restore persisted blob payloads.

The function clears parser helper attributes, restores blob fields from the extracted import folder, commits object changes, and then recurses into child nodes.

Parameters
self:objectImported object node acting as recursion root.
folder:strTemporary directory containing extracted import artifacts.