module documentation

ZMSRepositoryManager.py - ZMS Repository Manager

The ZMSRepositoryManager Module is comprehensive repository management system for ZMS that handles synchronization, configuration management, and bi-directional data exchange between ZODB (Zope Object Database) and the (versioning) file system (e.g., Git).

Core Responsibilities:

  • Repository Synchronization: Manages bidirectional synchronization between ZODB and file system repositories, allowing ZMS to maintain consistency across storage backends.
  • Configuration Management: Handles reading, writing, and validation of ZMS configuration files stored in the repository with support for environment variable substitution ($INSTANCE_HOME, $HOME_ID).
  • Import/Export Operations: Facilitates exporting ZMS objects and configurations to the file system (ZODB -> repository) and importing updates back into ZODB (repository -> ZODB).
  • Model Exchange: Provides mechanisms to exchange model definitions and configurations between multiple providers/repositories, supporting distributed ZMS deployments.
  • Multi-Provider Support: Supports multiple repository providers, allowing organizations to manage different configuration sets across separate storage locations.

Key Features:

  • Directional Control: Configurable update direction determines whether changes are highlighted from the file system (Loading mode) or the ZODB (Saving mode).
  • Orphan Management: Optional handling of orphaned configuration files to maintain clean repository states.
  • Event Triggering: Emits repository lifecycle events (beforeCommitRepositoryEvt, afterCommitRepositoryEvt, beforeUpdateRepositoryEvt, afterUpdateRepositoryEvt) for integration with other ZMS plugins.
  • Transaction Safety: Provides rollback capability through success/failure tracking during batch operations.

Use Cases in ZMS:

  • Configuration Backup and Recovery
  • Multi-environment Deployment (development, staging, production)
  • Team Collaboration on ZMS Models and Content Structures
  • Version Control Integration for ZMS Configurations
  • Migration and Data Exchange Between ZMS Instances

Implements:

  • IZMSConfigurationProvider: Configuration retrieval and management
  • IZMSRepositoryManager: Repository operations and synchronization

License: GNU General Public License v2 or later, Organization: ZMS Publishing

Class ZMSRepositoryManager No class docstring; 0/3 instance variable, 0/8 class variable, 11/11 methods documented