class documentation

class ConfManager(_multilangmanager.MultiLanguageManager): (source)

Implements interfaces: Products.zms.IZMSFormatProvider.IZMSFormatProvider, Products.zms.IZMSMetamodelProvider.IZMSMetamodelProvider

View In Hierarchy

Provide helpers for ConfManager.

Method customize_manage_options Build and return the ordered list of ZMI management tab descriptors for this ZMS instance.
Method delConfProperty Removes property from configuration.
Method get_conf_properties Return conf properties.
Method get_conf_property Return a configuration value, resolving local and inherited defaults.
Method getCatalogAdapter Return the catalog adapter.
Method getCharFormats Return the set of character formats.
Method getConfFiles Retrieve configuration files from the ZMS distribution code:
Method getConfManager Return confmanager.
Method getConfProperties Returns properties from configuration.
Method getConfPropertiesDefaults Return configuration properties defaults. The method returns a list of dicts, each describing a configuration property with keys.
Method getConfProperty Returns property from configuration.
Method getConfXmlFile Resolve a configuration reference to a (filename, xmlfile) pair.
Method getFilterManager Return the filter manager.
Method getFormatManager Return the format manager.
Method getLLMConnector Return the LLM connector.
Method getMediaDb Return the MediaDb storage object attached to the document element, or None if no MediaDb has been configured.
Method getMetaCmd Return metacmd.
Method getMetaCmdDescription getMetaCmdDescription
Method getMetaCmdIds Return metacmdids.
Method getMetacmdManager Return the metacmd manager.
Method getMetaCmds Return metacmds.
Method getMetaobj Return meta-object.
Method getMetaobjAttr Return meta-object attribute.
Method getMetaobjAttrIdentifierId Return meta-object attribute identifier id.
Method getMetaobjAttrIds Return meta-object attribute ids.
Method getMetaobjAttrs Return meta-object attributes.
Method getMetaobjId Return meta-object id.
Method getMetaobjIds Return meta-object ids.
Method getMetaobjManager Return the metaobj manager.
Method getMetaobjRevision Return meta-object revision. It delegates the retrieval of the meta-object revision to the meta-object manager. If the metaobj manager is not available, it returns None.
Method getPluginIds Return the IDs of installed ZMS plug-ins located under the product's plugins/ subdirectory.
Method getReqProperty Returns property from request (used to get zope-request-properties, e.g. SERVER_URL oder AUTHENTICATED_USER).
Method getResourceFolders Return the ordered list of resource-container folders used by the current theme.
Method getSequence Return the site-wide sequence counter object used for generating unique numeric IDs.
Method getStylesheet Return a single stylesheet object from the available stylesheets.
Method getStylesheets Return the ordered list of all CSS stylesheet objects found in the configured resource folders.
Method getTextFormat Return the text format for the given ID.
Method getTextFormatDefault Return the default text format.
Method getTextFormats Return the set of text formats.
Method getThemes Return the list of theme folder objects available at the site home.
Method getWfActivities Return the workflow activities.
Method getWfActivitiesIds Return the workflow activities IDs. It delegates the retrieval of workflow activity IDs to the workflow manager. If the workflow manager is not available, it returns an empty list.
Method getWfActivity Return a specific workflow activity by its ID. It delegates the retrieval of a specific workflow activity to the workflow manager.
Method getWfTransition Return a specific workflow transition by its ID. It delegates the retrieval of a specific workflow transition to the workflow manager. If the workflow manager is not available, it returns None.
Method getWfTransitions Return the workflow transitions. It delegates the retrieval of workflow transitions to the workflow manager. If the workflow manager is not available, it returns an empty list.
Method getWorkflowManager Return the workflow manager.
Method getZMSIndex Return the ZMSIndex object, creating and initializing it if it does not already exist.
Method getZMSSysConf Return the ZMSSysConf object, creating and initializing it if it does not already exist.
Method importConf Imports configuration from the given file and processes it in the context according to its filename.
Method importConfPackage Import a zipped configuration package and delegate each contained file to importConf.
Method manage_customizeDesign Customize design properties.
Method manage_customizeSystem Manage the system customization.
Method notifyMetaobjAttrAboutValue Notify meta-object attribute definition about (a new) value. It delegates the notification of a meta-object attribute about a value to the meta-object manager. If the meta-object manager is not available, it returns None.
Method setConfProperty Sets property into configuration.
Class Variable customize_manage_options__roles__ Undocumented
Class Variable manage_customize Undocumented
Class Variable manage_customize_diff Undocumented
Class Variable manage_customizeDesignForm Undocumented
Class Variable manage_customizeInstalledProducts Undocumented
Class Variable manage_customizeLanguagesForm Undocumented
Class Variable manage_main_diff Undocumented
Class Variable security Undocumented
Instance Variable __attr_conf_dict__ Undocumented
def customize_manage_options(self): (source)

Build and return the ordered list of ZMI management tab descriptors for this ZMS instance.

Each descriptor is a dict with 'label' and 'action' keys compatible with Zope's manage_options convention. The list always starts with the main view and user tab, followed by any tabs contributed by installed IZMSConfigurationProvider sub-objects, and ends with the design tab. When the current request is a management request, tabs that cannot be traversed are filtered out.

Returns
listList of tab descriptor dicts with 'label' and 'action'.
def delConfProperty(self, key): (source)

Removes property from configuration.

Parameters
key:string @return NoneThe key.
def get_conf_properties(self): (source)

Return conf properties.

def get_conf_property(self, *args, **kwargs): (source)

Return a configuration value, resolving local and inherited defaults.

Positional arguments are mapped in order to key, default, and REQUEST. Keyword arguments are supported with the same names.

Parameters
*argsUndocumented
key:strConfiguration key to resolve.
default:anyFallback value when the key is not configured.
REQUEST:ZPublisher.HTTPRequestTriggering request used for optional base64 decoding of key.
Returns
anyResolved configuration value.
def getCatalogAdapter(self): (source)

Return the catalog adapter.

It delegates the retrieval of the catalog adapter to the catalog adapter object. If the catalog adapter is not available, it returns a default catalog adapter.

Returns
IZMSCatalogAdapterThe catalog adapter object.
def getCharFormats(self): (source)

Return the set of character formats.

It delegates the retrieval of the character formats to the format manager object. If the format manager is not available, it returns a default set of character formats.

Returns
list of character formatsThe set of character format objects.
def getConfFiles(self, pattern=None, REQUEST=None, RESPONSE=None): (source)

Retrieve configuration files from the ZMS distribution code:

  1. Product/zms/conf: Sets of singular configuration files (repository-manager style, pattern-prefix 'conf:').
  2. Product/zms/import: Classical zipped XML packages, e.g. for importing as single file via web-frontend.
Parameters
patternstring, optional, pattern to filter filenames.
REQUESTZPublisher.HTTPResponse, optional.
RESPONSEZPublisher.HTTPRequest, optional, if provided, the method will return a JSON response.
def getConfManager(self): (source)

Return confmanager.

def getConfProperties(self, prefix=None, inherited=False, REQUEST=None): (source)

Returns properties from configuration.

Returns
dictA dictionary of configuration properties, optionally filtered by a prefix and including inherited properties from the portal master if specified.
def getConfPropertiesDefaults(self): (source)

Return configuration properties defaults. The method returns a list of dicts, each describing a configuration property with keys.

  • 'key': The unique identifier for the configuration property, used for retrieval and storage.
  • 'title': A human-readable title for the configuration property, used in the management interface.
  • 'desc': A description of the configuration property, providing context and usage information for administrators.
  • 'datatype': The data type of the configuration property, indicating how the value should be interpreted and validated (e.g., 'string', 'boolean', 'text').
  • 'default': The default value of the configuration property, used when no explicit value is set.
  • 'options': A list of valid options for the configuration property, used for validation and selection in the management interface.
Returns
listA list of dictionaries, each representing a configuration property with its metadata and default value.
def getConfProperty(self, key, default=_NO_DEFAULT, REQUEST=None): (source)

Returns property from configuration.

Parameters
key:stringThe key.
default:anyThe default-value.
REQUEST:ZPublisher.HTTPRequestUndocumented
Returns
anyUndocumented
def getConfXmlFile(self, file): (source)

Resolve a configuration reference to a (filename, xmlfile) pair.

Three input forms are handled:

  • dict — the dict has 'filename' and 'data' keys (e.g. entry from a ZIP archive); the data is wrapped in a StringIO.
  • str starting with 'conf:' — the remainder is treated as a repository path inside the ZMS conf base directory. The repository model is read and translated to XML by the matching container object.
  • Any other str — treated as a plain filesystem path; the file is opened in binary mode.
Parameters
file:dict or strConfiguration reference — dict entry, 'conf:'-prefixed path, or a plain filesystem path string.
Returns
tupleTuple of (filename, xmlfile) where filename is the bare filename and xmlfile is a readable file-like object.
def getFilterManager(self): (source)

Return the filter manager.

It delegates the retrieval of the filter manager to the filter manager object. If the filter manager is not available, it returns a default filter manager.

Returns
ZMSFilterManagerThe filter manager object.
def getFormatManager(self): (source)

Return the format manager.

It delegates the retrieval of the format manager to the format manager object. If the format manager is not available, it returns a default format manager.

Returns
DefaultFormatManagerThe format manager object.
def getLLMConnector(self): (source)

Return the LLM connector.

Walks the breadcrumb path upward to find a ``ZMSLLMConnector`` object. Returns ``None`` if no connector has been added — it must be added manually like other ZMS components (e.g. workflow_manager, ZMSLog).

Returns
IZMSLLMConnector or NoneThe LLM connector object, or None.
def getMediaDb(self): (source)

Return the MediaDb storage object attached to the document element, or None if no MediaDb has been configured.

Returns
_mediadb.MediaDb or NoneThe MediaDb object, or None.
def getMetaCmd(self, id): (source)

Return metacmd.

def getMetaCmdDescription(self, id): (source)

getMetaCmdDescription

def getMetaCmdIds(self, sort=1): (source)

Return metacmdids.

def getMetacmdManager(self): (source)

Return the metacmd manager.

It delegates the retrieval of the metacmd manager to the metacmd manager object. If the metacmd manager is not available, it returns a default metacmd manager.

Returns
DefaultMetacmdManagerThe metacmd manager object.
def getMetaCmds(self, context=None, stereotype='', sort=True): (source)

Return metacmds.

def getMetaobj(self, id): (source)

Return meta-object.

def getMetaobjAttr(self, id, attr_id, sync=True): (source)

Return meta-object attribute.

def getMetaobjAttrIdentifierId(self, meta_id): (source)

Return meta-object attribute identifier id.

def getMetaobjAttrIds(self, meta_id, types=[]): (source)

Return meta-object attribute ids.

def getMetaobjAttrs(self, meta_id, types=[]): (source)

Return meta-object attributes.

def getMetaobjId(self, name): (source)

Return meta-object id.

def getMetaobjIds(self, sort=None, excl_ids=[]): (source)

Return meta-object ids.

def getMetaobjManager(self): (source)

Return the metaobj manager.

It delegates the retrieval of the metaobj manager to the metaobj manager object. If the metaobj manager is not available, it returns a default metaobj manager.

Returns
DefaultMetaobjManagerThe metaobj manager object.
def getMetaobjRevision(self, id): (source)

Return meta-object revision. It delegates the retrieval of the meta-object revision to the meta-object manager. If the metaobj manager is not available, it returns None.

def getPluginIds(self, path=[]): (source)

Return the IDs of installed ZMS plug-ins located under the product's plugins/ subdirectory.

Only non-empty sub-directories are included. The optional path argument descends into a sub-directory of plugins/ first, enabling discovery of plug-in sub-categories such as ['rte'] for rich-text editor plug-ins.

Parameters
path:listPath segments appended below plugins/ before scanning.
Returns
listList of plug-in directory names.
def getReqProperty(self, key, default=None, REQUEST=None): (source)

Returns property from request (used to get zope-request-properties, e.g. SERVER_URL oder AUTHENTICATED_USER).

Parameters
key:stringThe key.
default:anyThe default-value.
REQUESTUndocumented
Returns
anyUndocumented
def getResourceFolders(self): (source)

Return the ordered list of resource-container folders used by the current theme.

The folder IDs to include are read from the 'ZMS.resourceFolders' configuration property (comma-separated, default 'instance,common'). A wildcard '*' entry expands to all sub-folders of the theme home. Folders that contain ZMS content nodes are excluded so that only pure resource containers are returned.

Returns
listList of Zope folder objects serving as resource containers.
def getSequence(self): (source)

Return the site-wide sequence counter object used for generating unique numeric IDs.

If a portal master is configured the sequence counter is kept on the master node so that all client portals draw from a single shared counter. In that case any local counter is removed and its current value is transferred to the master to avoid gaps. If no master exists the local counter is created on demand.

Returns
_sequence.SequenceThe Sequence object whose .value attribute is the next ID.
def getStylesheet(self, id=None): (source)

Return a single stylesheet object from the available stylesheets.

If id is None the first (primary) stylesheet is returned. Otherwise the stylesheet whose getId() matches id is returned, or None if no match is found.

Parameters
id:str or NoneStylesheet object ID to look up, or None for the primary.
Returns
file-like Zope object or NoneThe matching stylesheet file object, or None.
def getStylesheets(self): (source)

Return the ordered list of all CSS stylesheet objects found in the configured resource folders.

The method walks each resource folder's optional css sub-folder and then the folder itself, collecting File and DTML objects whose path contains a .css component. The stylesheet configured as 'ZMS.stylesheet' (default 'style.css') is promoted to the front.

Returns
listOrdered list of stylesheet objects, primary stylesheet first.
def getTextFormat(self, id, REQUEST): (source)

Return the text format for the given ID.

It delegates the retrieval of the text format to the format manager object. If the format manager is not available, it returns a default text format.

Parameters
id:strThe ID of the text format.
REQUEST:ZopeRequestThe request object.
Returns
TextFormatThe text format object.
def getTextFormatDefault(self): (source)

Return the default text format.

It delegates the retrieval of the default text format to the format manager object. If the format manager is not available, it returns a default text format.

Returns
stringThe default text format object.
def getTextFormats(self, REQUEST): (source)

Return the set of text formats.

It delegates the retrieval of the text formats to the format manager object. If the format manager is not available, it returns a default set of text formats.

Parameters
REQUEST:ZopeRequestThe request object.
Returns
list of text formatsThe set of text format objects.
def getThemes(self): (source)

Return the list of theme folder objects available at the site home.

A folder qualifies as a theme when it contains a standard_html object. Both the direct home and the absolute home are scanned; duplicates (same ID) are excluded.

Returns
listDistinct list of Zope folder objects that serve as theme folders.
def getWfActivities(self): (source)

Return the workflow activities.

It delegates the retrieval of workflow activities to the workflow manager. If the workflow manager is not available, it returns an empty list.

Returns
listA list of workflow activities.
def getWfActivitiesIds(self): (source)

Return the workflow activities IDs. It delegates the retrieval of workflow activity IDs to the workflow manager. If the workflow manager is not available, it returns an empty list.

Returns
listA list of workflow activities IDs.
def getWfActivity(self, id): (source)

Return a specific workflow activity by its ID. It delegates the retrieval of a specific workflow activity to the workflow manager.

Parameters
id:strThe ID of the workflow activity.
Returns
dict or NoneThe workflow activity associated with the given ID.
def getWfTransition(self, id): (source)

Return a specific workflow transition by its ID. It delegates the retrieval of a specific workflow transition to the workflow manager. If the workflow manager is not available, it returns None.

Parameters
id:strThe ID of the workflow transition.
Returns
dict or NoneThe workflow transition associated with the given ID.
def getWfTransitions(self): (source)

Return the workflow transitions. It delegates the retrieval of workflow transitions to the workflow manager. If the workflow manager is not available, it returns an empty list.

Returns
listA list of workflow transitions.
def getWorkflowManager(self): (source)

Return the workflow manager.

It delegates the retrieval of the workflow manager to the workflow manager object. If the workflow manager is not available, it returns a default workflow manager.

Returns
DefaultWorkflowManagerThe workflow manager object.
def getZMSIndex(self): (source)

Return the ZMSIndex object, creating and initializing it if it does not already exist.

Returns
ZMSIndexThe ZMSIndex object associated with the root element.
def getZMSSysConf(self): (source)

Return the ZMSSysConf object, creating and initializing it if it does not already exist.

The method checks if the ZMSSysConf object is already present as an attribute of the current instance. If it is not found, a new ZMSSysConf object is created, added to the current instance using _setObject, and then initialized. Finally, the method returns the ZMSSysConf object.

Returns
ZMSSysConfThe ZMSSysConf object associated with the current instance.
def importConf(self, file, syncIfNecessary=True): (source)

Imports configuration from the given file and processes it in the context according to its filename.

Parameters
file:strThe path to the configuration file to be imported.
syncIfNecessary:bool, optionalFlag indicating whether to synchronize object attributes if necessary. Defaults to True.
Returns

str

Notes:

  • The method identifies the type of configuration file based on its filename and processes it accordingly.
  • Hidden files created by MacOSX (starting with '._') are ignored.
  • If the filename contains specific substrings (e.g., '.charfmt.', '.filter.', etc.), the corresponding import method is called.
  • If synchronization is necessary and the syncIfNecessary flag is True, the object's attributes are synchronized.
A message indicating the result of the import operation.
def importConfPackage(self, file): (source)

Import a zipped configuration package and delegate each contained file to importConf.

If file is a string starting with http:// or https://, the archive is fetched via HTTP first. Otherwise the string is treated as a local filesystem path. Every non-directory entry in the ZIP archive is passed to importConf one by one.

Parameters
file:str or file-like objectLocal file path, HTTP(S) URL, or file-like object of the ZIP archive to import.
def manage_customizeDesign(self, btn, lang, REQUEST, RESPONSE): (source)

Customize design properties.

The method handles various design customization actions based on the provided button parameter. It processes actions related to saving CSS, saving themes, deleting themes, copying themes, importing themes, and inserting new themes. The method also constructs appropriate messages based on the actions performed and redirects the user to the design customization form with the relevant message.

Parameters
btn:stringThe button that was clicked to trigger the action.
lang:stringThe language code for localization purposes.
REQUEST:ZPublisher.HTTPRequestThe HTTP request object containing form data and other request information.
RESPONSE:ZPublisher.HTTPResponseThe HTTP response object for sending responses.
Returns
stringA message indicating the result of the design customization action.
def manage_customizeSystem(self, btn, key, lang, REQUEST, RESPONSE=None): (source)

Manage the system customization.

The method handles various system customization actions based on the provided key and button parameters. It processes configuration changes, imports, history management, client management, media database operations, and custom configuration properties.

Parameters
btn:stringThe button that was clicked to trigger the action.
key:stringThe key indicating the type of action to perform (e.g., 'Import', 'History', 'Clients', 'MediaDb', 'Custom', 'Configuration', 'Manager').
lang:stringThe language code for localization purposes.
REQUEST:ZPublisher.HTTPRequestThe HTTP request object containing form data and other request information.
RESPONSE:ZPublisher.HTTPResponseThe HTTP response object for sending responses.
Returns
stringA message indicating the result of the customization action.
def notifyMetaobjAttrAboutValue(self, meta_id, key, value): (source)

Notify meta-object attribute definition about (a new) value. It delegates the notification of a meta-object attribute about a value to the meta-object manager. If the meta-object manager is not available, it returns None.

Parameters
meta_id:strThe ID of the meta-object.
key:strThe key of the attribute to notify.
value:anyThe value to notify the attribute about.
Returns
anyThe result of the notification, or None if the meta-object manager is not available.
def setConfProperty(self, key, value): (source)

Sets property into configuration.

Parameters
key:stringThe key.
value:any @return NoneThe value.
customize_manage_options__roles__ = (source)

Undocumented

manage_customize = (source)

Undocumented

manage_customize_diff = (source)

Undocumented

manage_customizeDesignForm = (source)

Undocumented

manage_customizeInstalledProducts = (source)

Undocumented

manage_customizeLanguagesForm = (source)

Undocumented

manage_main_diff = (source)

Undocumented

security = (source)

Undocumented

__attr_conf_dict__ = (source)

Undocumented