Manager Reference
The managers
Module
A CioXml2 file manager collection.
- cioxml2.managers.includeme(configurator: Configurator)[source]
Function to include CioXml2 managers.
- Parameters:
configurator (pyramid.config.Configurator) – Object used to do configuration declaration within the application.
The managers.xml
Module
A file manager for generic XML files.
- cioxml2.managers.xml.includeme(configurator: Configurator)[source]
Function to include a CioWarehouse2 manager.
- Parameters:
configurator (pyramid.config.Configurator) – Object used to do configuration declaration within the application.
- class cioxml2.managers.xml.ManagerXml[source]
Class to manage a generic XML file.
viewings
andeditings
dictionaries have the following additional keys:'xsl'
: XSL file to transform the XML file'image_paths'
: list of paths to dynamically find images'image_extensions'
: list of authorized extensions for images'audio_paths'
: list of paths to dynamically find audios'audio_extensions'
: list of authorized extensions for audio'video_paths'
: list of paths to dynamically find videos'video_extensions'
: list of authorized extensions for videos
The three last fields can contain the following tag:
{directory}
: path of the directory containing the input file
- view(request: Request, warehouse: Warehouse, ciopath: CioPath, ts_factory=None) str | None [source]
Return a string containing HTML to display the file.
- edit(request: Request, warehouse: Warehouse, ciopath: CioPath, ts_factory=None) str | None [source]
Return a string containing HTML to edit the file.
- edit_cxe(request: Request, warehouse: Warehouse, ciopath: CioPath, editing: dict) tuple[Form | None, str, str | None] [source]
Return a string containing HTML to edit in a WYSIWYM manner.
- Parameters:
request (pyramid.request.Request) – Current request.
warehouse (ciowarehouse2.lib.warehouse.Warehouse) – Object describing the warehouse containing the file.
ciopath (ciowarehouse2.lib.ciopath.CioPath) – CioPath to the file.
editing (dict) – Dictionary representing the editing.
- Return type:
- Returns:
A tuple such as
(form, frame, class)
.
- edit_mask(request: Request, warehouse: Warehouse, ciopath: CioPath, editing: dict, tree: ElementTree | None = None, in_panel: bool = False) tuple[Form | None, str, str | None, ElementTree | None] [source]
Return a string containing HTML to edit the file with a mask.
- Parameters:
request (pyramid.request.Request) – Current request.
warehouse (ciowarehouse2.lib.warehouse.Warehouse) – Object describing the warehouse containing the file.
ciopath (ciowarehouse2.lib.ciopath.CioPath) – CioPath to the file.
editing (dict) – Dictionary representing the editing.
tree (lxml.etree.ElementTree) – (optional) Content of the file.
in_panel (bool) – (default=False)
True
if it is displayed in a panel.
- Return type:
- Returns:
A tuple such as
(form, frame, class, original)
.
- classmethod edit_xml(request: Request, warehouse: Warehouse, ciopath: CioPath, content: str | None = None) tuple[Form, str] [source]
Return a string containing HTML to edit the file as XML.
- Parameters:
request (pyramid.request.Request) – Current request.
warehouse (.lib.warehouse.Warehouse) – Object describing the warehouse containing the file.
path (str) – Relative path to the file.
content – (optional) Content of the file.
- Return type:
- Returns:
A tuple such as
(form, frame)
.
- save(request: Request, warehouse: Warehouse, ciopath: CioPath, editing: dict, values: dict, go_on: bool, original: ElementTree | None = None) str | None [source]
Save the XML file.
- xml2html(request: Request, warehouse: Warehouse, ciopath: CioPath, rendering: dict, mode: str = 'view', tree: ElementTree | None = None, in_panel: bool = False) tuple[str | None, str | None, ElementTree | None] [source]
Thanks to a XSL file, return a piece of HTML to display or edit a file.
- Parameters:
request (pyramid.request.Request) – Current request.
warehouse (ciowarehouse2.lib.warehouse.Warehouse) – Object describing the warehouse containing the file.
cioppath – CioPath of the current file.
rendering (dict) – Dictionary defining the rendering.
mode (str) – (optional) Display mode (‘view, ‘frame’ or ‘values’).
tree (lxml.etree.ElementTree) – (optional) Content of the file.
in_panel (bool) – (default=False)
True
if it is displayed in a panel.
- Return type:
- Returns:
A tuple such as
(html, class, content_as_tree)
.
See:
managers.xml.ManagerXml.view()
andmanagers.xml.ManagerXml.edit()
The managers.cioset
Module
A file manager for Cioset XML files.
- cioxml2.managers.cioset.includeme(configurator: Configurator)[source]
Function to include WBWarehouse a manager.
- Parameters:
configurator (pyramid.config.Configurator) – Object used to do configuration declaration within the application.
The managers.cioarticle
Module
A file manager for Cioarticle XML files.
- cioxml2.managers.cioarticle.includeme(configurator: Configurator)[source]
Function to include a CioWarehouse2 manager.
- Parameters:
configurator (pyramid.config.Configurator) – Object used to do configuration declaration within the application.
The managers.ciomemo
Module
A file manager for Ciomemo XML files.
- cioxml2.managers.ciomemo.includeme(configurator: Configurator)[source]
Function to include a CioWarehouse2 manager.
- Parameters:
configurator (pyramid.config.Configurator) – Object used to do configuration declaration within the application.
The managers.ciorecipe
Module
A file manager for Ciorecipe XML files.
- cioxml2.managers.ciorecipe.includeme(configurator: Configurator)[source]
Function to include a CioWarehouse2 manager.
- Parameters:
configurator (pyramid.config.Configurator) – Object used to do configuration declaration within the application.