module documentation

zms.py - ZMS Root Object and Lifecycle Management

This module provides the core ZMS (Zope Management System) root content object and lifecycle event handling for the ZMS publishing platform. The module encapsulates:

  • Root Content Object: The ZMS class serves as the top-level content container combining configuration management, content editing capabilities, and search indexing functionality.
  • Lifecycle Event Handling: The subscriber function dispatches Zope container lifecycle events (object addition, movement, removal) to the internal ZMS event framework, enabling custom business logic triggers throughout the object hierarchy.
  • Site Initialization: The initZMS function handles creation and configuration of new ZMS sites, supporting both standalone master sites and client sites that acquire their content model from a portal master.
  • Theme Management: The importTheme function imports or acquires configured themes for newly created sites.
  • Content Import: The init_content function imports initial site content from bundled archive files.
  • Management Interface: The manage_addZMS function provides the factory method for creating top-level ZMS installations through the Zope add form.

The ZMS class inherits from multiple managers providing specific functionality:

  • ZMSCustom: Custom user extensions
  • AccessManager: Permission and role management
  • Builder: XML content model building
  • ConfManager: Configuration property management
  • ObjAttrsManager: Object attribute management
  • ZCatalogManager: Search catalog integration

This module also includes a workaround for zope.browserresource compatibility to provide ETag adapter functionality required by zope.browserresource 3.11.0+.

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

Class NoETagAdapter Undocumented
Class ZMS Root ZMS content object that combines configuration, editing, and indexing.
Function containerFilter Restrict add-dialog containers to plain folders.
Function createZMS Undocumented
Function importTheme Import or acquire the configured theme for a newly created site.
Function init_content Import initial site content from a bundled archive.
Function init_multisite Initialize a multisite content structure with the given depth and number of clients.
Function initZMS Create and initialize a new ZMS site below the given container.
Function manage_addZMS Create the top-level home folder and initial ZMS site from the add form.
Function subscriber Dispatch ZMS object lifecycle events to the internal event framework.
Variable manage_addZMSForm Undocumented
def containerFilter(container): (source)

Restrict add-dialog containers to plain folders.

Parameters
container:objectCandidate container displayed by the add dialog.
Returns
boolTrue when the container is a folder.
def createZMS(context, id, name, REQUEST): (source)

Undocumented

def importTheme(self, theme): (source)

Import or acquire the configured theme for a newly created site.

Parameters
self:ZMSZMS site that receives the theme configuration.
theme:strTheme package identifier or import source.
Returns
str | NoneIdentifier of the imported theme, or None when the theme is acquired from a portal master.
def init_content(self, filename, REQUEST): (source)

Import initial site content from a bundled archive.

Parameters
self:ZMSZMS site that receives the imported content.
filename:strName of the import archive below the product import folder.
REQUEST:ZPublisher.HTTPRequest.HTTPRequestActive HTTP request.
def init_multisite(zms, depth, clients, prefix='client', REQUEST=None): (source)

Initialize a multisite content structure with the given depth and number of clients.

Parameters
zmsZMS site that receives the multisite content structure.
depthDepth of the multisite folder hierarchy.
clientsNumber of client folders at each level.
prefixUndocumented
REQUESTActive HTTP request.
def initZMS(self, id, titlealt, title, lang, manage_lang, REQUEST, minimal_init=False): (source)

Create and initialize a new ZMS site below the given container.

A new site can either be initialized as a standalone master site or as a client that acquires its content model from a portal master when the request variable acquire is set.

Parameters
self:OFS.ObjectManager.ObjectManagerContainer that receives the new ZMS site.
id:strIdentifier of the created ZMS object.
titlealt:strAlternative title shown in the management interface.
title:strHuman readable title of the site.
lang:strPrimary content language.
manage_lang:strManagement interface language.
REQUEST:ZPublisher.HTTPRequest.HTTPRequestHTTP request with initialization options.
minimal_init:boolInitialize only the minimal default configuration.
Returns
ZMSNewly created and initialized ZMS site.
def manage_addZMS(self, lang, manage_lang, REQUEST, RESPONSE): (source)

Create the top-level home folder and initial ZMS site from the add form.

Parameters
self:OFS.ObjectManager.ObjectManagerContainer in which the home folder is created.
lang:strPrimary content language.
manage_lang:strManagement interface language.
REQUEST:ZPublisher.HTTPRequest.HTTPRequestHTTP request containing form input.
RESPONSE:ZPublisher.HTTPResponse.HTTPResponseHTTP response used for redirects.
def subscriber(event): (source)

Dispatch ZMS object lifecycle events to the internal event framework.

Parameters
event:zope.lifecycleevent.interfaces.IObjectEventZope container lifecycle event.
manage_addZMSForm = (source)

Undocumented