class documentation

class ZMSMetacmdProvider(ZMSItem.ZMSItem): (source)

Constructor: ZMSMetacmdProvider(commands)

Implements interfaces: Products.zms.IZMSConfigurationProvider.IZMSConfigurationProvider, Products.zms.IZMSMetacmdProvider.IZMSMetacmdProvider, Products.zms.IZMSRepositoryProvider.IZMSRepositoryProvider

View In Hierarchy

Provider for configurable meta-commands and their repository/xml sync.

Method __get_metacmd__ Return the raw command dict from self.commands for the given id.
Method __init__ Initialise the manager with a persistent copy of command definitions.
Method delMetacmd Delete one meta-command definition and remove its underlying Zope object.
Method get_readme_path Resolve readme for ZMSItem.readme(): ZODB only for metacmd ids.
Method getMetaCmd Return one fully-resolved meta-command, including object metadata and code.
Method getMetaCmdDescription Returns description of meta-command specified by ID.
Method getMetaCmdIds Return all meta-command ids, optionally sorted by command name.
Method getMetaCmdReadmePath Return filesystem path to the readme.md of a meta-command folder.
Method getMetaCmds Return meta-commands filtered by stereotype and optionally executable context.
Method hasMetaCmdReadme Check whether a ZODB readme object exists for metacmd id.
Method importXml Import one or many command entries from XML text or file-like input.
Method manage_changeMetacmds Handle ZMI actions for meta-commands (acquire/save/copy/delete/export/import/insert).
Method manage_options Handle the ZMI action 'manage_options'.
Method manage_sub_options Handle the ZMI action 'manage_sub_options'.
Method provideRepository Build repository export data for selected meta-commands.
Method setMetacmd Create or update one meta-command and synchronise its implementation object.
Method translateRepositoryModel Translate repository records from Impl-based format into flat command maps.
Method updateRepository Import one command from repository payload and persist it locally.
Class Variable __ac_permissions__ Undocumented
Class Variable __administratorPermissions__ Undocumented
Class Variable manage Undocumented
Class Variable manage_main Undocumented
Class Variable manage_main_acquire Undocumented
Class Variable manage_options_default_action Undocumented
Class Variable manage_sub_options__roles__ Undocumented
Class Variable meta_type Undocumented
Class Variable zmi_icon Undocumented
Instance Variable commands Undocumented
Instance Variable id Undocumented
Method _get_metacmd_readme_container Return or lazily create the OFS.Folder 'metacmd_readme' inside metacmd_manager.
Method _get_metacmd_readme_object Return OFS.File for the metacmd readme, syncing from filesystem on first access.
Method _importXml Import one command entry from parsed XML payload.
Method _set_metacmd_readme_object Create or replace the OFS.File readme for metacmd id inside metacmd_readme/.
def __get_metacmd__(self, id): (source)

Return the raw command dict from self.commands for the given id.

def __init__(self, commands=[]): (source)

Initialise the manager with a persistent copy of command definitions.

def delMetacmd(self, id): (source)

Delete one meta-command definition and remove its underlying Zope object.

def get_readme_path(self, REQUEST=None): (source)

Resolve readme for ZMSItem.readme(): ZODB only for metacmd ids.

def getMetaCmd(self, id): (source)

Return one fully-resolved meta-command, including object metadata and code.

def getMetaCmdDescription(self, id): (source)

Returns description of meta-command specified by ID.

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

Return all meta-command ids, optionally sorted by command name.

def getMetaCmdReadmePath(self, id): (source)

Return filesystem path to the readme.md of a meta-command folder.

def getMetaCmds(self, context=None, stereotype='', sort=True): (source)

Return meta-commands filtered by stereotype and optionally executable context.

When context is provided, role/meta-type/node constraints are evaluated.

def hasMetaCmdReadme(self, id): (source)

Check whether a ZODB readme object exists for metacmd id.

def importXml(self, xml): (source)

Import one or many command entries from XML text or file-like input.

def manage_changeMetacmds(self, btn, lang, REQUEST, RESPONSE): (source)

Handle ZMI actions for meta-commands (acquire/save/copy/delete/export/import/insert).

def manage_options(self): (source)

Handle the ZMI action 'manage_options'.

def manage_sub_options(self): (source)

Handle the ZMI action 'manage_sub_options'.

def provideRepository(self, ids=None): (source)

Build repository export data for selected meta-commands.

Parameters
ids:list | NoneOptional list of command ids to export.
Returns
dictMapping keyed by command id.
def setMetacmd(self, id, newId, newAcquired, newPackage='', newRevision='0.0.0', newName='', newTitle='', newMethod=None, newData=None, newExecution=0, newDescription='', newIconClazz='', newMetaTypes=[], newRoles=['ZMSAdministrator'], newNodes='{$}'): (source)

Create or update one meta-command and synchronise its implementation object.

Returns
strEffective command id.
def translateRepositoryModel(self, r): (source)

Translate repository records from Impl-based format into flat command maps.

def updateRepository(self, r): (source)

Import one command from repository payload and persist it locally.

Parameters
r:dictRepository record for one command.
Returns
strImported command id.
__ac_permissions__ = (source)

Undocumented

__administratorPermissions__: tuple[str, ...] = (source)

Undocumented

Undocumented

manage_main = (source)

Undocumented

manage_main_acquire = (source)

Undocumented

manage_options_default_action: str = (source)

Undocumented

manage_sub_options__roles__ = (source)

Undocumented

meta_type: str = (source)

Undocumented

zmi_icon: str = (source)

Undocumented

commands = (source)

Undocumented

Undocumented

def _get_metacmd_readme_container(self): (source)

Return or lazily create the OFS.Folder 'metacmd_readme' inside metacmd_manager.

def _get_metacmd_readme_object(self, id): (source)

Return OFS.File for the metacmd readme, syncing from filesystem on first access.

Uses aq_base to prevent Zope acquisition from returning unrelated objects (e.g. RequestContainer) when the file does not yet exist in the container.

def _importXml(self, item): (source)

Import one command entry from parsed XML payload.

def _set_metacmd_readme_object(self, id, content): (source)

Create or replace the OFS.File readme for metacmd id inside metacmd_readme/.