Main Reference

The ciowarehouse2 Module

CioWarehouse2 module: a Chrysalio add-on to manage digital warehouses.

ciowarehouse2.includeme(configurator: Configurator | ScriptRegistry)[source]

Function to include CioWarehouse module.

Parameters:

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

class ciowarehouse2.SubnavWarehouses[source]

Sub-entry to display the index of warehouses.

class ciowarehouse2.NavWarehouses[source]

Entry for warehouses.

nav_button(request: Request, class_: str | None = None) str[source]

Return the HTML of the button to navigate warehouses.

class ciowarehouse2.SubnavSeeds[source]

Entry for seeds.

class ciowarehouse2.ModuleCioWarehouse2(config_ini: str)[source]

Class for CioWarehouse2 module.

Parameters:

config_ini (str) – Absolute path to the configuration file (e.g. development.ini).

This module has the following attributes:

  • backend: object to communicate with CioTantivy backend

  • locations: a dictionary of absolute paths of warehouse locations

  • homes: a dictionary of absolute paths of homes (icons, thumbnails)

  • restful: a dictionary defining the RESTful parameters

populate(args: Namespace, registry: Registry, dbsession: Session)[source]

Method called by populate script to complete the operation.

See: chrysalio.modules.Module.populate()

activate(registry: Registry, dbsession: Session)[source]

Method to activate the module.

Parameters:
deactivate(registry: Registry, dbsession: Session)[source]

Method to deactivate the module.

Parameters:
configuration_route(request: Request) str[source]

Return the route to configure this module.

Parameters:

request (pyramid.request.Request) – Current request.

Return type:

str

warehouse_access(request, item, *args, **kwargs)

Use of user cache.

warehouse(request, item_id, *args, **kwargs)

Use of global cache.

warehouse_admin(request: Request, warehouse: Warehouse, access: tuple | None = None) bool[source]

Return True if the user administrates the warehouse.

Parameters:
Return type:

bool

warehouse_file_writer(request: Request, warehouse: Warehouse, access: tuple | None = None) bool[source]

Return True if the user can write files in this warehouse.

Parameters:
Return type:

bool

warehouse_meta_writer(request: Request, warehouse: Warehouse, access: tuple | None = None) bool[source]

Return True if the user can write metadata in this warehouse.

Parameters:
Return type:

bool

warehouse_root(request: Request, warehouse_id: str | None) str | None[source]

Return the root directory of the warehouse with ID warehouse_id or None.

Parameters:
Return type:

str

warehouse_forget(request: Request, warehouse_id: str | None = None)[source]

Remove warehouse from list.

Parameters:
classmethod cache_clear(request: Request, warehouse_id: str)[source]

Clear file and metadata cache for a warehouse.

Parameters:
classmethod manager(request: Request, ciotype: CioType) Manager | None[source]

Return the best file manager for the given CioType.

Parameters:
Return type:

.lib.manager.Manager

register_seeds(registry: Registry, dbsession: Session)[source]

Fill the registry with a dictionary defining seeders and another defining seeds.

Parameters:

The ciowarehouse2.routes Module

CioWarehouse2 route definitions.

ciowarehouse2.routes.includeme(configurator: Configurator)[source]

Function to include routes.

Parameters:

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

ciowarehouse2.routes.route_thumbnail(request: Request, ciopath: CioPath, ciotype: CioType, icon: str, thumbnail_ext: str | None, size: str = 'medium') str[source]

Return the route path to the thumbnail of the given CioPath.

Parameters:
  • request (pyramid.request.Request) – Current request.

  • ciopath (.lib.ciopath.CioPath) – The CioPath representing the file.

  • ciotype (.lib.ciotype.CioType) – The CioType representing the file.

  • icon (str) – File name of the icon.

  • thumbnail_ext (str) – Thumnbnail extension.

  • size (str) – ('medium' [default] or 'large') The wanted size.

Return type:

str

ciowarehouse2.routes.route_icon(icon: str, size: str = 'medium') str[source]

Return the route path to the icon.

Parameters:
  • icon (str) – File name of the icon.

  • size (str) – ('medium' [default] or 'small' ) The wanted size.

The ciowarehouse2.security Module

CioWarehouse2 secutity functionalities.

ciowarehouse2.security.includeme(configurator: Configurator)[source]

Function to include security.

Parameters:

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