class ZMSMetaobjManager(object): (source)
Manage ZMS meta-object definitions, attributes, and related artefacts.
| Method | __get |
Return one meta-object record by id. |
| Method | __get |
Return all meta-objects, including acquired entries from portal master. |
| Method | acquire |
Mark a meta-object as acquired from portal master. |
| Method | del |
Delete one meta-object and its managed attribute artefacts. |
| Method | del |
Delete one attribute from a meta-object definition. |
| Method | eval |
Evaluate one computed meta-object attribute and return its runtime value. |
| Method | export |
Export selected meta-objects to XML. |
| Method | get |
Return one meta-object and optionally overlay acquired configuration. |
| Method | get |
Return one attribute mapping for a given meta-object and attribute id. |
| Method | get |
Return the preferred identifier attribute id for a record-like meta-object. |
| Method | get |
Return attribute ids for one meta-object, optionally filtered by type. |
| Method | get |
Return attribute mappings for one meta-object. |
| Method | get |
Resolve one meta-object id by its display name. |
| Method | get |
Return available meta-object ids with optional sorting and exclusion. |
| Method | get |
Return the effective revision string for a meta-object. |
| Method | get |
Expand type-selector entries into concrete meta-object ids. |
| Method | import |
Import one or many meta-object records from XML content. |
| Method | import |
Import a theme folder structure into a ZMSLibrary meta-object. |
| Method | manage_ajax |
Update editable object properties from AJAX form values. |
| Method | manage_change |
Handle meta-object manager actions from the ZMI properties form. |
| Method | manage |
Create and optionally return default standard_html ZPT code. |
| Method | move |
Move one attribute to a new position in the meta-object attribute list. |
| Method | notify |
Notify one meta-object attribute about a newly observed runtime value. |
| Method | provide |
Export meta-object model records into repository payload structure. |
| Method | render |
Render the first matching template source for the given meta-object. |
| Method | set |
Insert or update one meta-object definition in the model. |
| Method | set |
Create or update one meta-object attribute definition. |
| Method | translate |
Translate repository payload into import-friendly key/value records. |
| Method | update |
Import one repository record into the local meta-object model. |
| Class Variable | deprecated |
Undocumented |
| Class Variable | valid |
Undocumented |
| Class Variable | valid |
Undocumented |
| Class Variable | valid |
Undocumented |
| Class Variable | valid |
Undocumented |
| Class Variable | valid |
Undocumented |
| Class Variable | valid |
Undocumented |
| Class Variable | valid |
Undocumented |
| Instance Variable | model |
Undocumented |
| Method | _import |
Import one meta-object XML item into the local model. |
Return one meta-object record by id.
| Parameters | |
| id:str | Meta-object id. |
| Returns | |
| dict | None | Meta-object mapping or None. |
Return all meta-objects, including acquired entries from portal master.
The result is request-buffered to avoid repeated recomputation during one request cycle.
| Returns | |
| dict | Mapping {meta_id: meta_object_dict}. |
Mark a meta-object as acquired from portal master.
| Parameters | |
| id:str | Meta-object id. |
| subobjects:int | If 1, package subobjects are also acquired. |
| Returns | |
| None | None |
Delete one meta-object and its managed attribute artefacts.
| Parameters | |
| id:str | Meta-object id. |
| acquire:bool | If true, keep native Zope artefacts used by acquisition. |
| Returns | |
| None | None |
Delete one attribute from a meta-object definition.
| Parameters | |
| id:str | Meta-object id. |
| attr | Attribute id to remove. |
| acquire:bool | If true, avoid removing acquired native artefacts. |
| Returns | |
| None | None |
Evaluate one computed meta-object attribute and return its runtime value.
| Parameters | |
| id:str | Meta-object id or '*' for all meta-objects. |
| attr | Attribute id to evaluate. |
| zmscontext:object | None | Optional context passed to callable attributes. |
| options:dict | Optional call options for executable attributes. |
| Returns | |
| any | Evaluated value or None when unresolved. |
Export selected meta-objects to XML.
| Parameters | |
| ids:list | Meta-object ids to export. Empty list exports all effective ids. |
| REQUEST:ZPublisher.HTTPRequest | None | Optional request context controlling export key pruning. |
| RESPONSE:ZPublisher.HTTPResponse | None | Optional response to receive download headers. |
| Returns | |
| str | XML payload string. |
Return one meta-object and optionally overlay acquired configuration.
| Parameters | |
| id:str | Meta-object id. |
| aq | Attribute names to read from local configuration when the object is acquired from portal master. |
| Returns | |
| dict | Meta-object mapping. |
Return one attribute mapping for a given meta-object and attribute id.
| Parameters | |
| id:str | Meta-object id. |
| attr | Attribute id. |
| sync:bool | If true, attach backing Zope artefact reference when applicable. |
| Returns | |
| dict | None | Attribute mapping or None. |
Return the preferred identifier attribute id for a record-like meta-object.
Candidate types are checked in order: identifier, string, int.
| Parameters | |
| meta | Meta-object id. |
| Returns | |
| str | None | First matching attribute id or None. |
Return attribute ids for one meta-object, optionally filtered by type.
| Parameters | |
| id:str | Meta-object id. |
| types:list | Optional list of accepted attribute types. |
| Returns | |
| list | Attribute id list. |
Return attribute mappings for one meta-object.
| Parameters | |
| id:str | Meta-object id. |
| types:list | Optional list of accepted attribute types. |
| Returns | |
| list | List of attribute mappings. |
Resolve one meta-object id by its display name.
| Parameters | |
| name:str | Display name as returned by display_type. |
| Returns | |
| str | None | Matching meta-object id or None. |
Return available meta-object ids with optional sorting and exclusion.
| Parameters | |
| sort:bool | None | True sorts by display type, False by name, None keeps model iteration order. |
| excl | Ids to exclude from the result. |
| Returns | |
| list | Meta-object id list. |
Return the effective revision string for a meta-object.
For package objects this also considers child objects that belong to the same package and returns the highest semantic version.
| Parameters | |
| id:str | Meta-object id. |
| Returns | |
| str | Revision string, for example '0.0.0'. |
Expand type-selector entries into concrete meta-object ids.
Selectors use the form type(<meta_type>) and are resolved against enabled meta-objects.
| Parameters | |
| meta | Mixed list of meta ids and type selectors. |
| Returns | |
| list | Concrete list of matching meta-object ids. |
Import one or many meta-object records from XML content.
| Parameters | |
| xml:str | bytes | file | XML string, bytes, or file-like content. |
| create | Optional whitelist of ids to import. |
| Returns | |
| str | list | Imported id or list of imported ids. |
Import a theme folder structure into a ZMSLibrary meta-object.
| Parameters | |
| id:str | Theme container id. |
| Returns | |
| None | None |
Update editable object properties from AJAX form values.
| Parameters | |
| id:str | Meta-object id. |
| REQUEST:ZPublisher.HTTPRequest | HTTP request containing set* form fields. |
| RESPONSE:ZPublisher.HTTPResponse | None | Optional HTTP response for XML output headers. |
| Returns | |
| str | None | XML result payload when RESPONSE is passed. |
Handle meta-object manager actions from the ZMI properties form.
Supported actions include insert/update/delete, import/export, acquisition handling, and attribute reordering.
| Parameters | |
| lang:str | Active UI language id. |
| btn:str | Submitted action button id. |
| key:str | Edited section key (for example 'obj' or 'attr'). |
| REQUEST:ZPublisher.HTTPRequest | Incoming request carrying form payload. |
| RESPONSE:ZPublisher.HTTPResponse | None | Optional response used for redirects and downloads. |
| Returns | |
| object | str | Redirect response or localized status message. |
Create and optionally return default standard_html ZPT code.
| Parameters | |
| id:str | Meta-object id. |
| target | Target template id (default standard_html). |
| attrs:list | None | Optional list of attribute dicts to use instead of fetching from meta-object definition. |
| REQUEST:ZPublisher.HTTPRequest | None | Optional request for language and context (used in template code generation). |
| RESPONSE:ZPublisher.HTTPResponse | None | Optional response for XML output headers (not used). |
| Returns | |
| str | Generated default ZPT code for the specified template. |
Move one attribute to a new position in the meta-object attribute list.
| Parameters | |
| id:str | Meta-object id. |
| attr | Attribute id to move. |
| pos:int | Zero-based target position. |
| Returns | |
| None | None |
Notify one meta-object attribute about a newly observed runtime value.
For auto-complete attribute types ('autocomplete' and 'multiautocomplete') this method extends the static key list when the attribute keys are not executable snippets.
| Parameters | |
| meta | Meta-object id that owns the attribute. |
| key:str | Attribute id. |
| value:str | int | float | list | Observed value. Expected value is either a single scalar or a list of scalar values. |
| Returns | |
| None | None |
Export meta-object model records into repository payload structure.
| Parameters | |
| r:dict | Repository accumulator mapping to be filled in-place. |
| ids:list | None | Optional subset of meta-object ids. None exports all ids. |
| Returns | |
| None | None. The payload is written into r. |
Render the first matching template source for the given meta-object.
Resolution order prefers skin/extension specific templates, then standard_html, then bodyContentZMSCustom_<meta_id>.
| Parameters | |
| obj:object | Content object providing meta_id, request, and attr access. |
| Returns | |
| str | Rendered HTML fragment or empty string. |
Insert or update one meta-object definition in the model.
The method normalizes optional fields and forces persistence by copying the model mapping.
| Parameters | |
| ob:dict | Meta-object definition. |
| Returns | |
| None | None |
Create or update one meta-object attribute definition.
This method also manages dependent Zope objects for executable/native attribute types and preserves ordering constraints in the attribute list.
| Parameters | |
| id:str | Meta-object id. |
| old | Previous attribute id, or None for insertion. |
| new | New attribute id. |
| new | Attribute display name. |
| new | Mandatory flag (expected values: 0 or 1). |
| new | Multilang flag (expected values: 0 or 1). |
| new | Repetitive flag (expected values: 0 or 1). |
| new | Attribute type identifier. |
| new | Optional key list for select-like attributes. |
| new | Optional custom payload/content. |
| new | Optional default value. |
| Returns | |
| str | Message fragment generated during update. |
Translate repository payload into import-friendly key/value records.
| Parameters | |
| r:dict | Repository model payload keyed by meta-object id. |
| Returns | |
| list | List of {'key': id, 'value': record} mappings. |