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.
Sub-entry to display the index of warehouses.
Entry for warehouses.
Return the HTML of the button to navigate warehouses.
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 backendlocations
: a dictionary of absolute paths of warehouse locationshomes
: 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.
- activate(registry: Registry, dbsession: Session)[source]
Method to activate the module.
- Parameters:
registry (pyramid.registry.Registry) – Application registry.
dbsession (sqlalchemy.orm.session.Session) – SQLAlchemy session.
- deactivate(registry: Registry, dbsession: Session)[source]
Method to deactivate the module.
- Parameters:
registry (pyramid.registry.Registry) – Application registry.
dbsession (sqlalchemy.orm.session.Session) – SQLAlchemy session.
- configuration_route(request: Request) str [source]
Return the route to configure this module.
- Parameters:
request (pyramid.request.Request) – Current request.
- Return type:
- 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:
request (pyramid.request.Request) – Current request.
warehouse (lib.warehouse.Warehouse) – Current warehouse object..
access (tuple) – (optional) Already retrieved access tuple.
- Return type:
- 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:
request (pyramid.request.Request) – Current request.
warehouse (lib.warehouse.Warehouse) – Current warehouse object.
access (tuple) – (optional) Already retrieved access tuple.
- Return type:
- 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:
request (pyramid.request.Request) – Current request.
warehouse (lib.warehouse.Warehouse) – Current warehouse object.
access (tuple) – (optional) Already retrieved access tuple.
- Return type:
- warehouse_root(request: Request, warehouse_id: str | None) str | None [source]
Return the root directory of the warehouse with ID
warehouse_id
orNone
.- Parameters:
request (pyramid.request.Request) – Current request.
warehouse_id (str) – ID of the warehouse to return.
- Return type:
- warehouse_forget(request: Request, warehouse_id: str | None = None)[source]
Remove warehouse from list.
- Parameters:
request (pyramid.request.Request) – Current request.
warehouse_id (str) – (optional) ID of the warehouse to forget.
- classmethod cache_clear(request: Request, warehouse_id: str)[source]
Clear file and metadata cache for a warehouse.
- Parameters:
request (pyramid.request.Request) – Current request.
warehouse_id (str) – ID of the warehouse.
- classmethod manager(request: Request, ciotype: CioType) Manager | None [source]
Return the best file manager for the given CioType.
- Parameters:
request (pyramid.request.Request) – Current request.
ciotype (.lib.ciotype.CioType) – CioType of the file.
- 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:
registry (pyramid.registry.Registry) – Application registry.
dbsession (sqlalchemy.orm.session.Session)
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:
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.