Handler Reference

The handlers Module

A CioXml file handler collection.

cioxml.handlers.includeme(configurator)[source]

Function to include CioXml handlers.

Parameters:

configurator (pyramid.config.Configurator) – Object used to do configuration declaration within the application.

The handlers.handler_xml Module

A file handler for generic XML files.

cioxml.handlers.handler_xml.includeme(configurator)[source]

Function to include a CioWarehouse handler.

Parameters:

configurator (pyramid.config.Configurator) – Object used to do configuration declaration within the application.

class cioxml.handlers.handler_xml.HandlerXml[source]

Class to manage a generic XML file.

viewings and editings 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

infos_complete_fields(warehouse, path, abs_path, whoosh_fields, request=None)[source]

Complete the whoosh_fields dictionary with information found in the metadata file.

See: ciowarehouse.lib.handler.Handler.infos_complete_fields()

thumbnails(warehouse, abs_file, thumb_dir, request=None, registry=None)[source]

Create the small and large thumbnails representing the file.

See: ciowarehouse.handlers.Handler.thumbnails()

view(request, warehouse, content=None, ts_factory=None)[source]

Return a string containing HTML to display the file.

See: ciowarehouse.lib.handler.Handler.view()

edit(request, warehouse, content=None, ts_factory=None)[source]

Return a string containing HTML to edit the file.

See: ciowarehouse.lib.handler.Handler.edit()

edit_cxe(request, warehouse, path, content=None, editing=None)[source]

Return a string containing HTML to edit in a WYSIWYM manner.

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.

  • editing (dict) – (optional) Dictionary representing the editing.

Return type:

tuple

Returns:

A tuple such as (form, original, frame, class).

edit_mask(request, warehouse, path, content=None, editing=None, in_panel=False)[source]

Return a string containing HTML to edit the file with a mask.

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 (str, lxml.etree.ElementTree) – (optional) Content of the file.

  • editing (dict) – (optional) Dictionary representing the editing.

  • in_panel (bool) – (default=False) True if it is displayed in a panel.

Return type:

tuple

Returns:

A tuple such as (form, content, frame, class).

classmethod edit_xml(request, warehouse, path, content=None)[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:

tuple

Returns:

A tuple such as (form, original, frame).

save(request, warehouse, original, values, go_on)[source]

Save the XML file.

See: ciowarehouse.lib.handler.Handler.save()

xml2html(request, warehouse, path, content, rendering, mode, parser=None, file_url=False, in_panel=False)[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 (.lib.warehouse.Warehouse) – Object describing the warehouse containing the file.

  • path (str) – Relative path to the file.

  • content (str, lxml.etree.ElementTree, None) – Content of the file.

  • rendering (dict) – Dictionary defining the rendering.

  • mode (str) – Display mode (‘thumbnail’, ‘view’, ‘frame’ or ‘values’).

  • parser – (optional) Parser to load XML.

  • file_url (bool) – (default=False) If True, URLs of media gegin with file://.

  • in_panel (bool) – (default=False) True if it is displayed in a panel.

Return type:

tuple

Returns:

A tuple such as (html, class, content_as_tree).

See: handlers.xml.HandlerXml.view() and handlers.xml.HandlerXml.edit()

The handlers.handler_cioset Module

A file handler for Cioset XML files.

cioxml.handlers.handler_cioset.includeme(configurator)[source]

Function to include WBWarehouse a handler.

Parameters:

configurator (pyramid.config.Configurator) – Object used to do configuration declaration within the application.

class cioxml.handlers.handler_cioset.HandlerCioset[source]

Class to manage a Cioset XML file.

panel

alias of PanelCioset

The handlers.handler_ciomemo Module

A file handler for Ciomemo XML files.

cioxml.handlers.handler_ciomemo.includeme(configurator)[source]

Function to include WBWarehouse a handler.

Parameters:

configurator (pyramid.config.Configurator) – Object used to do configuration declaration within the application.

class cioxml.handlers.handler_ciomemo.HandlerCiomemo[source]

Class to manage a Ciomemo XML file.

The handlers.handler_cioarticle Module

A file handler for Cioarticle XML files.

cioxml.handlers.handler_cioarticle.includeme(configurator)[source]

Function to include WBWarehouse a handler.

Parameters:

configurator (pyramid.config.Configurator) – Object used to do configuration declaration within the application.

class cioxml.handlers.handler_cioarticle.HandlerCioarticle[source]

Class to manage a Cioarticle XML file.