class documentation

class ZMSFilterManager(ZMSItem.ZMSItem): (source)

Constructor: ZMSFilterManager(filters, processes)

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

View In Hierarchy

Manage reusable content filters and their executable process chains.

The filter manager persists local filter definitions, optional uploaded process assets, and repository import/export payloads used for sync.

Method __init__ Initialize the manager from serialized filters and processes.
Method delFilter Delete a filter definition and its uploaded assets.
Method delFilterProcess Remove a process from a filter and renumber stored assets.
Method delProcess Delete a process definition and its backing Zope object.
Method exportXml Export selected filters and processes as an XML download.
Method getFilter Return a filter definition, falling back to the portal master.
Method getFilterIds Return the available filter ids, including acquired ones.
Method getFilterProcesses Return process definitions attached to a filter.
Method getProcess Return a process definition, falling back to the portal master.
Method getProcessIds Return the available process ids, including acquired ones.
Method importXml Import one or more filter manager entries from XML data.
Method manage_changeFilter Handle ZMI actions for filters and filter-process assignments.
Method manage_changeProcess Handle ZMI actions for creating, editing, and deleting processes.
Method manage_options Return parent management tabs with local relative actions.
Method manage_sub_options Return the filter manager sub tabs shown in the ZMI.
Method moveFilterProcess Move a filter process to a new position in the pipeline.
Method provideRepository Build a repository export mapping for filters and processes.
Method setFilter Create or update a filter definition.
Method setFilterProcess Append a process to a filter and persist its optional file asset.
Method setProcess Create or update an executable process definition.
Method updateRepository Apply one repository item to the local filter manager state.
Class Variable __ac_permissions__ Undocumented
Class Variable __administratorPermissions__ Undocumented
Class Variable manage Undocumented
Class Variable manage_main 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 filters Undocumented
Instance Variable id Undocumented
Instance Variable processes Undocumented
Method _importXml Import a single parsed XML item.
def __init__(self, filters={}, processes={}): (source)

Initialize the manager from serialized filters and processes.

Parameters
filters:listPersisted filter definitions.
processes:listPersisted process definitions.
def delFilter(self, id): (source)

Delete a filter definition and its uploaded assets.

Parameters
id:strFilter identifier.
Returns
strEmpty string for legacy callers.
def delFilterProcess(self, id, index): (source)

Remove a process from a filter and renumber stored assets.

Parameters
id:strFilter identifier.
index:intProcess position to remove.
Returns
intLegacy sentinel value.
def delProcess(self, id): (source)

Delete a process definition and its backing Zope object.

Parameters
id:strProcess identifier.
Returns
strEmpty string for legacy callers.
def exportXml(self, REQUEST, RESPONSE): (source)

Export selected filters and processes as an XML download.

Parameters
REQUEST:ZPublisher.HTTPRequestThe active HTTP request.
RESPONSE:ZPublisher.HTTPResponseThe active HTTP response.
Returns
strSerialized XML export data.
def getFilter(self, id): (source)

Return a filter definition, falling back to the portal master.

Parameters
id:strFilter identifier.
Returns
dictFilter metadata.
def getFilterIds(self, sort=True): (source)

Return the available filter ids, including acquired ones.

Parameters
sort:boolSort by display name when true.
Returns
listFilter ids.
def getFilterProcesses(self, id): (source)

Return process definitions attached to a filter.

Parameters
id:strFilter identifier.
Returns
listFilter process descriptors with optional uploaded files.
def getProcess(self, id): (source)

Return a process definition, falling back to the portal master.

Parameters
id:strProcess identifier.
Returns
dictProcess metadata and synchronized command data.
def getProcessIds(self, sort=True): (source)

Return the available process ids, including acquired ones.

Parameters
sort:boolSort by display name when true.
Returns
listProcess ids.
def importXml(self, xml): (source)

Import one or more filter manager entries from XML data.

Parameters
xml:strXML string or uploaded file-like object.
def manage_changeFilter(self, lang, btn='', key='', REQUEST=None, RESPONSE=None): (source)

Handle ZMI actions for filters and filter-process assignments.

Parameters
lang:strActive UI language.
btn:strSubmitted button id.
key:strSecondary action key.
REQUEST:ZPublisher.HTTPRequestThe active HTTP request.
RESPONSE:ZPublisher.HTTPResponseThe active HTTP response.
Returns
objectRedirect response or export payload.
def manage_changeProcess(self, lang, btn='', key='', REQUEST=None, RESPONSE=None): (source)

Handle ZMI actions for creating, editing, and deleting processes.

Parameters
lang:strActive UI language.
btn:strSubmitted button id.
key:strSecondary action key.
REQUEST:ZPublisher.HTTPRequestThe active HTTP request.
RESPONSE:ZPublisher.HTTPResponseThe active HTTP response.
Returns
objectRedirect response or export payload.
def manage_options(self): (source)

Return parent management tabs with local relative actions.

def manage_sub_options(self): (source)

Return the filter manager sub tabs shown in the ZMI.

def moveFilterProcess(self, id, index, pos): (source)

Move a filter process to a new position in the pipeline.

Parameters
id:strFilter identifier.
index:intCurrent process position.
pos:intTarget process position.
Returns
intThe new position.
def provideRepository(self, r, ids=None): (source)

Build a repository export mapping for filters and processes.

Parameters
r:dictRepository accumulator passed by the caller.
ids:listOptional subset of ids to export.
Returns
dictRepository data keyed by object id.
def setFilter(self, oldId, newId, newAcquired=0, newName='', newFormat='', newContentType='', newDescription='', newRoles=[], newMetaTypes=[]): (source)

Create or update a filter definition.

Parameters
oldId:strExisting filter id to replace.
newId:strTarget filter id.
newAcquired:intWhether the filter is acquired from a master portal.
newName:strDisplay name.
newFormat:strFilter input format.
newContentType:strFilter output content type.
newDescription:strDescriptive help text.
newRoles:listAllowed roles.
newMetaTypes:listSupported content meta types.
Returns
strThe persisted filter id.
def setFilterProcess(self, id, index, newProcessId, newProcessFile=None): (source)

Append a process to a filter and persist its optional file asset.

Parameters
id:strFilter identifier.
index:intProcess position inside the filter pipeline.
newProcessId:strLinked process id.
newProcessFile:_blobfields.MyBlobOptional uploaded process file.
Returns
intThe appended process index.
def setProcess(self, oldId, newId, newAcquired=0, newName='', newType='process', newCommand=None): (source)

Create or update an executable process definition.

Parameters
oldId:strExisting process id to replace.
newId:strTarget process id.
newAcquired:intWhether the process is acquired from a master portal.
newName:strDisplay name.
newType:strBacking Zope object type.
newCommand:objectSource text or uploaded blob for the process.
Returns
strThe persisted process id.
def updateRepository(self, r): (source)

Apply one repository item to the local filter manager state.

Parameters
r:dictRepository item describing a filter or process.
Returns
strThe imported id.
__ac_permissions__ = (source)

Undocumented

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

Undocumented

Undocumented

manage_main = (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

Undocumented

Undocumented

processes = (source)

Undocumented

def _importXml(self, item): (source)

Import a single parsed XML item.

Parameters
item:dictParsed filter or process description.