_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 | import |
Import one XML content stream into the current object tree. |
| Function | import |
Import content from an uploaded file or archive. |
| Function | recurse_import |
Post-process imported objects and restore persisted blob payloads. |
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 | |
| self | Undocumented |
| file:file-like object | Open XML file-like object to parse. |
| Returns | |
| object | Imported object root. |
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 | |
| self | Undocumented |
| file:file-like object | Uploaded file object or path-like input. |
| REQUEST:ZPublisher.HTTPRequest | Current request containing optional filter configuration. |
| handler:callable | Callable that performs the final XML import step. |
| Returns | |
| object | Imported object root. |
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:object | Imported object node acting as recursion root. |
| folder:str | Temporary directory containing extracted import artifacts. |