_exportable.py - ZMS Exportable Mixin
This module implements the Exportable mixin, which provides methods for exporting Zope objects to the filesystem, including binary files, images, and folder structures. It handles encoding, file writing, and recursive export of folder contents. The module also includes helper functions for localizing HTML content and managing export paths. The Exportable mixin can be used by ZMS content classes to enable export functionality.
License: GNU General Public License v2 or later, Organization: ZMS Publishing
| Class | |
Mixin that provides XML, HTML, and archive export helpers. |
| Function | export |
Export binary file and image objects from a folder to the filesystem. |
| Function | export |
Recursively export a Zope folder and its renderable objects. |
| Function | find |
Find the first occurrence of any delimiter in a string. |
| Function | local |
Convert rendered HTML to the charset configured for the request. |
| Function | local |
Rewrite exported markup so links resolve in static HTML archives. |
| Function | rfind |
Find the last occurrence of any delimiter in a string. |
| Function | write |
Write export data to disk using the preferred encoding. |
Export binary file and image objects from a folder to the filesystem.
| Parameters | |
| self | Undocumented |
| root:OFS.ObjectManager.ObjectManager | Container holding the exported folder. |
| id:str | Folder id on the container. |
| path:str | Destination directory. |
Recursively export a Zope folder and its renderable objects.
| Parameters | |
| self | Undocumented |
| root:OFS.ObjectManager.ObjectManager | Parent folder that contains the exported folder. |
| path:str | Base export directory. |
| id:str | Folder id to export. |
| REQUEST:ZPublisher.HTTPRequest | Current request used to render templates. |
| depth:int | Additional relative path depth for nested exports. |
Find the first occurrence of any delimiter in a string.
| Parameters | |
| s:str | Text to search. |
| delimiters:list | Candidate delimiter characters. |
| Returns | |
| int | Position of the first delimiter or -1. |
Convert rendered HTML to the charset configured for the request.
| Parameters | |
| self | Undocumented |
| html:str or bytes | Rendered markup. |
| Returns | |
| bytes or str | Encoded markup. |
Rewrite exported markup so links resolve in static HTML archives.
| Parameters | |
| self | Undocumented |
| obj:OFS.SimpleItem.Item | Exported content object. |
| level:int | Relative depth from the export root. |
| html:str or bytes | Rendered markup. |
| xhtml:bool | Flag indicating XHTML export mode. |
| Returns | |
| str | Localized markup with rewritten links. |
Find the last occurrence of any delimiter in a string.
| Parameters | |
| s:str | Text to search. |
| delimiters:list | Candidate delimiter characters. |
| Returns | |
| int | Position of the last delimiter or -1. |