class ZMSObject(ZMSItem.ZMSItem, _accessmanager.AccessableObject, _versionmanager.VersionItem, ZMSWorkflowItem.ZMSWorkflowItem, _copysupport.CopySupport, _cachemanager.ReqBuff, _deprecatedapi.DeprecatedAPI, _multilangmanager.MultiLanguageObject, _exportable.Exportable, _objattrs.ObjAttrs, _objchildren.ObjChildren, _objinputs.ObjInputs, _objtypes.ObjTypes, _pathhandler.PathHandler, _textformatmanager.TextFormatObject, _zreferableitem.ZReferableItem): (source)
Constructor: ZMSObject(id, sort_id)
Full-featured ZMS content management object extending ZMSItem with comprehensive capabilities.
ZMSObject is the primary content class providing extensive content management features through multiple mixin classes:
Core Management:
- Version control and history tracking (VersionItem)
- Workflow state management (ZMSWorkflowItem)
- Access control and permissions (AccessableObject)
Content Features:
- Multilingual/localization support (MultiLanguageObject)
- Object attributes and metadata (ObjAttrs)
- Child object management (ObjChildren)
- Input validation and processing (ObjInputs)
- Object type management (ObjTypes)
Technical Features:
- Copy/paste and cloning support (CopySupport)
- Request-level caching (ReqBuff)
- URL path handling (PathHandler)
- Text format conversion (TextFormatObject)
- Reference/link management (ZReferableItem)
- XML import/export (Exportable)
- Backward compatibility layer (DeprecatedAPI)
ZMSObject instances represent pages, page elements, resources, and other content types with full versioning, workflow, and multilingual capabilities.
| Method | __init__ |
Initialize a ZMS object with its persistent id and sort order. |
| Method | __proxy__ |
Return the acquisition-wrapped object proxy. |
| Method | ajax |
Return body content for AJAX requests. |
| Method | aq |
Return the absolute URL adjusted for acquisition-aware container context. |
| Method | breadcrumbs |
Return the object chain used for ZMI breadcrumb rendering. |
| Method | change |
Apply request values to the object's editable properties. |
| Method | clear |
Remove request-scoped context values for the current object. |
| Method | display |
Return the HTML icon markup for a meta object. |
| Method | display |
Return the localized display label for a meta object. |
| Method | f |
Return CSS defaults for the current object. |
| Method | |
Creates a new instance of a file from given data. |
| Method | get |
Return the ZODB object id in a stable printable form. |
| Method | get |
Read an object-scoped value from the request with fallback to a plain key. |
| Method | get |
Calculate the approximate size of the object's stored attribute values. |
| Method | get |
Return the persistent uid of the object, generating one if needed. |
| Method | get |
Rewrite an absolute URL so it stays in the configured context domain. |
| Method | get |
Return the rendered body content when the object is visible. |
| Method | get |
Return the Dublin Core coverage value for the current object. |
| Method | get |
Return the Dublin Core description for the current object. |
| Method | get |
Return the declarative id used for path-handler based URLs. |
| Method | get |
Return the declarative URL assembled from path-handler ids. |
| Method | get |
Build an HTML href for the object or the owning page. |
| Method | get |
Return the default public URL for the object in the current request. |
| Method | get |
Rewrite an index URL so it matches the current context and domain rules. |
| Method | get |
Return the hierarchical level relative to the document element. |
| Method | get |
Return the configured page extension for the current object. |
| Method | get |
Return the ancestor reached by walking up a fixed number of levels. |
| Method | get |
Return the ancestor located at the requested tree level. |
| Method | get |
Return the logical parent node of this object. |
| Method | get |
Return the physical path without duplicate trailing `content` ids. |
| Method | get |
Return this object or the nearest ancestor matching the requested type. |
| Method | get |
Return the numeric sort id extracted from the stored format. |
| Method | get |
Return the localized title used for navigation and rendering. |
| Method | get |
Return the alternate localized title used in URLs and exports. |
| Method | get |
Return a depth-first list of subtree nodes matching the optional filter. |
| Method | get |
Return the semantic content type declared by the meta object. |
| Method | |
Create an image blob field instance from binary data. |
| Method | is |
Return whether this object is a descendant of the given object. |
| Method | is |
Compatibility alias for isResource using the current request. |
| Method | is |
Compatibility alias for isTranslated using the current request. |
| Method | is |
Compatibility alias for isVisible using the current request. |
| Method | is |
Return whether this object is an ancestor of the given object. |
| Method | is |
Check whether the object matches the requested meta type selector. |
| Method | is |
Return whether the current language version is newer than its parent language. |
| Method | is |
Return whether the object represents a page node. |
| Method | is |
Return whether the object behaves as a page container. |
| Method | is |
Return whether the object represents a page element node. |
| Method | is |
Return whether the object is treated as a resource node. |
| Method | is |
Return whether the object contains data for the requested language. |
| Method | is |
Return whether the object is visible in the current request context. |
| Method | manage_change |
Persist edited properties and redirect back to the management UI. |
| Method | manage_execute |
Execute a meta-object attribute or configured meta command. |
| Method | manage_move |
Move the object down within its parent's sort order. |
| Method | manage_move |
Move the object to a specific position within its siblings. |
| Method | manage_move |
Move the object up within its parent's sort order. |
| Method | print |
Render a printable HTML representation of the object subtree. |
| Method | render |
Render a short management or content preview of the object. |
| Method | set |
Store a set of request-scoped context values for the object. |
| Method | set |
Set the persistent uid of the object. |
| Method | set |
Store the sort id in the canonical prefixed internal format. |
| Method | title |
Return the basic title attribute or a fallback product label. |
| Method | xml |
Return the temporary parent stored for XML builder object creation. |
| Method | xml |
Delegate character-data handling to the shared XML helper. |
| Method | xml |
Finalize XML builder state after the current element closes. |
| Method | xml |
Initialize XML builder state for a new element. |
| Method | xml |
Delegate unknown end-tag handling to the shared XML helper. |
| Method | xml |
Delegate unknown start-tag handling to the shared XML helper. |
| Method | zmi |
Build the generated CSS import list for this object. |
| Method | zmi |
Return the CSS icon class used for the object in the management UI. |
| Constant | FORM |
Undocumented |
| Constant | MISC |
Undocumented |
| Constant | QUOT |
Undocumented |
| Class Variable | f |
Undocumented |
| Class Variable | f |
Undocumented |
| Class Variable | f |
Undocumented |
| Class Variable | obj |
Undocumented |
| Class Variable | obj |
Undocumented |
| Class Variable | preview |
Undocumented |
| Class Variable | preview |
Undocumented |
| Class Variable | security |
Undocumented |
| Class Variable | spacer |
Undocumented |
| Class Variable | zmi |
Undocumented |
| Class Variable | zmi |
Undocumented |
| Class Variable | zmi |
Undocumented |
| Class Variable | zmi |
Undocumented |
| Class Variable | zmi |
Undocumented |
| Class Variable | zmi |
Undocumented |
| Class Variable | zmi |
Undocumented |
| Class Variable | zmi |
Undocumented |
| Class Variable | zmi |
Undocumented |
| Class Variable | zmi |
Undocumented |
| Class Variable | zmi |
Undocumented |
| Class Variable | zmi |
Undocumented |
| Instance Variable | d |
Undocumented |
| Instance Variable | d |
Undocumented |
| Instance Variable | id |
Undocumented |
| Instance Variable | o |
Undocumented |
| Instance Variable | ref |
Undocumented |
| Instance Variable | sort |
Undocumented |
| Method | _get |
Render the raw body content template for the object. |
| Method | _get |
Wrap rendered body content with editable markup when preview mode allows it. |
| Instance Variable | _uid |
Undocumented |
Initialize a ZMS object with its persistent id and sort order.
| Parameters | |
| id:str | Object id. |
| sort | Initial sort position. |
Return body content for AJAX requests.
| Parameters | |
| REQUEST:ZPublisher.HTTPRequest | Current request. |
| forced:bool | Ignore visibility checks. |
| Returns | |
| str | Rendered body content. |
Return the absolute URL adjusted for acquisition-aware container context.
| Parameters | |
| relative:bool | Return a relative URL when true. |
| Returns | |
| str | Absolute or relative URL. |
Return the object chain used for ZMI breadcrumb rendering.
| Parameters | |
| portal | Include portal master ancestors when configured. |
| Returns | |
| list | Breadcrumb object path. |
Apply request values to the object's editable properties.
| Parameters | |
| lang:str | Active language for the update. |
Remove request-scoped context values for the current object.
| Parameters | |
| REQUEST:ZPublisher.HTTPRequest | Current request. |
| prefix:str | Key prefix used for stored values. |
Return the HTML icon markup for a meta object.
Optional identifiers may be passed positionally or via keyword arguments. The legacy meta_type keyword is still accepted.
| Parameters | |
| *args | Undocumented |
| meta | Optional meta object id. |
| meta | Legacy alias for meta_id. |
| Returns | |
| str | HTML fragment containing the icon element. |
Return the localized display label for a meta object.
Optional identifiers may be passed positionally or via keyword arguments. The legacy meta_type keyword is still accepted.
| Parameters | |
| *args | Undocumented |
| meta | Optional meta object id. |
| meta | Legacy alias for meta_id. |
| Returns | |
| str | Localized type label. |
Return CSS defaults for the current object.
Deprecated: use zmi_css_defaults instead.
| Parameters | |
| REQUEST:ZPublisher.HTTPRequest | Optional request to use for rendering. |
| Returns | |
| str | CSS imports for matching meta-object defaults. |
Creates a new instance of a file from given data.
| Parameters | |
| data:string | File-data (binary) |
| filename:string | Filename |
| content | Undocumented |
| Returns | |
MyFile | New instance of file. |
Read an object-scoped value from the request with fallback to a plain key.
| Parameters | |
| REQUEST:ZPublisher.HTTPRequest | Current request. |
| key:str | Context key. |
| default | Value returned when no context key exists. |
| Returns | |
| any | Stored request context value or fallback. |
Calculate the approximate size of the object's stored attribute values.
| Parameters | |
| REQUEST:dict | Optional request context. |
| Returns | |
| int | Estimated object size. |
Return the persistent uid of the object, generating one if needed.
| Parameters | |
| forced:bool | Force generation of a new uid. |
| Returns | |
| str | Object uid prefixed with uid:. |
Rewrite an absolute URL so it stays in the configured context domain.
| Parameters | |
| context:zmsobject.ZMSObject | Current context object. |
| abs | Absolute URL to contextualize. |
| forced:bool | Force contextualization rules. |
| Returns | |
| str | Context-aware absolute URL. |
Return the rendered body content when the object is visible.
| Parameters | |
| REQUEST:ZPublisher.HTTPRequest | Current request. |
| forced:bool | Ignore visibility checks. |
| Returns | |
| str | Rendered body content. |
Return the Dublin Core coverage value for the current object.
| Parameters | |
| REQUEST:dict | Optional request context. |
| Returns | |
| str | Coverage value. |
Return the Dublin Core description for the current object.
| Parameters | |
| REQUEST:ZPublisher.HTTPRequest | Current request. |
| Returns | |
| str | Description value. |
Return the declarative id used for path-handler based URLs.
| Parameters | |
| REQUEST:dict | Optional request context. |
| Returns | |
| str | Declarative id. |
Return the declarative URL assembled from path-handler ids.
| Parameters | |
| REQUEST:dict | Optional request context. |
| Returns | |
| str | Declarative URL. |
Build an HTML href for the object or the owning page.
| Parameters | |
| fct:str | Target page function name. |
| pageext:str | File extension used for generated pages. |
| REQUEST:ZPublisher.HTTPRequest | Current request. |
| Returns | |
| str | Context-aware href. |
Return the default public URL for the object in the current request.
| Parameters | |
| REQUEST:ZPublisher.HTTPRequest | Current request. |
| deep:int | Traverse into descendant pages when needed. |
| Returns | |
| str | Public object URL. |
Rewrite an index URL so it matches the current context and domain rules.
| Parameters | |
| context:zmsobject.ZMSObject | Current context object. |
| index | Existing index URL. |
| REQUEST:ZPublisher.HTTPRequest | Current request. |
| deep:int | Fallback depth for generated URLs. |
| Returns | |
| str | Context-aware index URL. |
Return the configured page extension for the current object.
| Parameters | |
| REQUEST:ZPublisher.HTTPRequest | Current request. |
| Returns | |
| str | Page extension. |
Return the ancestor reached by walking up a fixed number of levels.
| Parameters | |
| deep:int | Number of parent steps. |
| Returns | |
| zmsobject.ZMSObject | Ancestor object. |
Return the ancestor located at the requested tree level.
| Parameters | |
| level:int | Target level. |
| Returns | |
| zmsobject.ZMSObject | Ancestor object. |
Return this object or the nearest ancestor matching the requested type.
| Parameters | |
| meta | Optional meta-type selector. |
| Returns | |
| zmsobject.ZMSObject | Matching object. |
Return the localized title used for navigation and rendering.
| Parameters | |
| REQUEST:ZPublisher.HTTPRequest | Current request. |
| Returns | |
| str | Display title. |
Return the alternate localized title used in URLs and exports.
| Parameters | |
| REQUEST:ZPublisher.HTTPRequest | Current request. |
| Returns | |
| str | Alternate display title. |
Return a depth-first list of subtree nodes matching the optional filter.
| Parameters | |
| REQUEST:dict | Optional request context. |
| meta | Optional meta-type filter. |
| Returns | |
| list | Matching subtree nodes. |
Return the semantic content type declared by the meta object.
| Returns | |
| str | One of the configured ZMS content type identifiers. |
Create an image blob field instance from binary data.
| Parameters | |
| data:bytes or str | Image payload. |
| filename:str | Original filename. |
| content | Optional MIME type. |
| Returns | |
MyImage | New image blob wrapper. |
Return whether this object is a descendant of the given object.
| Parameters | |
| ob:zmsobject.ZMSObject | Potential ancestor object. |
| Returns | |
| bool | True if this object is below ob. |
Return whether this object is an ancestor of the given object.
| Parameters | |
| ob:zmsobject.ZMSObject | Potential descendant object. |
| Returns | |
| bool | True if this object contains ob in its subtree. |
Check whether the object matches the requested meta type selector.
| Parameters | |
| meta | Single selector or list of selectors. |
| REQUEST:dict | Optional request context. |
| Returns | |
| bool | True if the object matches. |
Return whether the current language version is newer than its parent language.
| Parameters | |
| lang:str | Language id to compare. |
| REQUEST:ZPublisher.HTTPRequest | Current request. |
| Returns | |
| bool | True if the current language is newer. |
Return whether the object is treated as a resource node.
| Parameters | |
| REQUEST:ZPublisher.HTTPRequest | Current request. |
| Returns | |
| bool | True if the object is a resource. |
Return whether the object contains data for the requested language.
| Parameters | |
| lang:str | Language id to check. |
| REQUEST:ZPublisher.HTTPRequest | Current request. |
| Returns | |
| bool | True if translated content exists. |
Return whether the object is visible in the current request context.
| Parameters | |
| REQUEST:ZPublisher.HTTPRequest | Current request. |
| Returns | |
| bool | True if the object is visible. |
Persist edited properties and redirect back to the management UI.
| Parameters | |
| lang:str | Active language. |
| REQUEST:ZPublisher.HTTPRequest | Current request. |
| RESPONSE:ZPublisher.HTTPResponse | Optional response used for redirect handling. |
| Returns | |
| object | Redirect response when RESPONSE is provided. |
Execute a meta-object attribute or configured meta command.
| Parameters | |
| id:str | Meta attribute or meta command id. |
| REQUEST:ZPublisher.HTTPRequest | Current request. |
| RESPONSE:ZPublisher.HTTPResponse | Optional response used for redirects. |
| context:zmsobject.ZMSObject | Optional execution context. |
| Returns | |
| object | Meta command result when executed directly. |
Move the object down within its parent's sort order.
| Parameters | |
| lang:str | Active language. |
| REQUEST:ZPublisher.HTTPRequest | Current request. |
| RESPONSE:ZPublisher.HTTPResponse | Current response. |
Move the object to a specific position within its siblings.
| Parameters | |
| lang:str | Active language. |
| pos:int | Target one-based position. |
| fmt:str | Optional response format. |
| REQUEST:ZPublisher.HTTPRequest | Current request. |
| RESPONSE:ZPublisher.HTTPResponse | Optional response for redirect handling. |
| Returns | |
| str | JSON message when fmt == 'json'. |
Move the object up within its parent's sort order.
| Parameters | |
| lang:str | Active language. |
| REQUEST:ZPublisher.HTTPRequest | Current request. |
| RESPONSE:ZPublisher.HTTPResponse | Current response. |
Render a printable HTML representation of the object subtree.
| Parameters | |
| level:int | Current heading level. |
| sectionizer:object | Section numbering helper. |
| REQUEST:ZPublisher.HTTPRequest | Current request. |
| deep:bool | Include child pages recursively. |
| Returns | |
| str | Printable HTML. |
Render a short management or content preview of the object.
| Parameters | |
| REQUEST:ZPublisher.HTTPRequest | Current request. |
| manage | Render the management-main variant. |
| Returns | |
| str | Short HTML fragment. |
Store a set of request-scoped context values for the object.
| Parameters | |
| REQUEST:ZPublisher.HTTPRequest | Current request. |
| d:dict | Mapping of context keys to values. |
Store the sort id in the canonical prefixed internal format.
| Parameters | |
| sort | Numeric sort value. |
Initialize XML builder state for a new element.
| Parameters | |
| s | Tag name. |
| d | Tag attributes. |
| o | Parent node during XML object creation. |
Build the generated CSS import list for this object.
| Parameters | |
| REQUEST:ZPublisher.HTTPRequest | Current request. |
| Returns | |
| str | CSS source text. |
Return the CSS icon class used for the object in the management UI.
| Returns | |
| str | Font Awesome class string. |