class documentation

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)

View In Hierarchy

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 ajaxGetBodyContent Return body content for AJAX requests.
Method aq_absolute_url Return the absolute URL adjusted for acquisition-aware container context.
Method breadcrumbs_obj_path Return the object chain used for ZMI breadcrumb rendering.
Method changeProperties Apply request values to the object's editable properties.
Method clear_request_context Remove request-scoped context values for the current object.
Method display_icon Return the HTML icon markup for a meta object.
Method display_type Return the localized display label for a meta object.
Method f_css_defaults Return CSS defaults for the current object.
Method FileFromData Creates a new instance of a file from given data.
Method get_oid Return the ZODB object id in a stable printable form.
Method get_request_context Read an object-scoped value from the request with fallback to a plain key.
Method get_size Calculate the approximate size of the object's stored attribute values.
Method get_uid Return the persistent uid of the object, generating one if needed.
Method getAbsoluteUrlInContext Rewrite an absolute URL so it stays in the configured context domain.
Method getBodyContent Return the rendered body content when the object is visible.
Method getDCCoverage Return the Dublin Core coverage value for the current object.
Method getDCDescription Return the Dublin Core description for the current object.
Method getDeclId Return the declarative id used for path-handler based URLs.
Method getDeclUrl Return the declarative URL assembled from path-handler ids.
Method getHref2Html Build an HTML href for the object or the owning page.
Method getHref2IndexHtml Return the default public URL for the object in the current request.
Method getHref2IndexHtmlInContext Rewrite an index URL so it matches the current context and domain rules.
Method getLevel Return the hierarchical level relative to the document element.
Method getPageExt Return the configured page extension for the current object.
Method getParentByDepth Return the ancestor reached by walking up a fixed number of levels.
Method getParentByLevel Return the ancestor located at the requested tree level.
Method getParentNode Return the logical parent node of this object.
Method getPath Return the physical path without duplicate trailing `content` ids.
Method getSelf Return this object or the nearest ancestor matching the requested type.
Method getSortId Return the numeric sort id extracted from the stored format.
Method getTitle Return the localized title used for navigation and rendering.
Method getTitlealt Return the alternate localized title used in URLs and exports.
Method getTreeNodes Return a depth-first list of subtree nodes matching the optional filter.
Method getType Return the semantic content type declared by the meta object.
Method ImageFromData Create an image blob field instance from binary data.
Method is_child_of Return whether this object is a descendant of the given object.
Method is_resource Compatibility alias for isResource using the current request.
Method is_translated Compatibility alias for isTranslated using the current request.
Method is_visible Compatibility alias for isVisible using the current request.
Method isAncestor Return whether this object is an ancestor of the given object.
Method isMetaType Check whether the object matches the requested meta type selector.
Method isModifiedInParentLanguage Return whether the current language version is newer than its parent language.
Method isPage Return whether the object represents a page node.
Method isPageContainer Return whether the object behaves as a page container.
Method isPageElement Return whether the object represents a page element node.
Method isResource Return whether the object is treated as a resource node.
Method isTranslated Return whether the object contains data for the requested language.
Method isVisible Return whether the object is visible in the current request context.
Method manage_changeProperties Persist edited properties and redirect back to the management UI.
Method manage_executeMetacmd Execute a meta-object attribute or configured meta command.
Method manage_moveObjDown Move the object down within its parent's sort order.
Method manage_moveObjToPos Move the object to a specific position within its siblings.
Method manage_moveObjUp Move the object up within its parent's sort order.
Method printHtml Render a printable HTML representation of the object subtree.
Method renderShort Render a short management or content preview of the object.
Method set_request_context Store a set of request-scoped context values for the object.
Method set_uid Set the persistent uid of the object.
Method setSortId Store the sort id in the canonical prefixed internal format.
Method title Return the basic title attribute or a fallback product label.
Method xmlGetParent Return the temporary parent stored for XML builder object creation.
Method xmlOnCharacterData Delegate character-data handling to the shared XML helper.
Method xmlOnEndElement Finalize XML builder state after the current element closes.
Method xmlOnStartElement Initialize XML builder state for a new element.
Method xmlOnUnknownEndTag Delegate unknown end-tag handling to the shared XML helper.
Method xmlOnUnknownStartTag Delegate unknown start-tag handling to the shared XML helper.
Method zmi_css_defaults Build the generated CSS import list for this object.
Method zmi_icon Return the CSS icon class used for the object in the management UI.
Constant FORM_LABEL_MANDATORY Undocumented
Constant MISC_ZMS Undocumented
Constant QUOT Undocumented
Class Variable f_api_html Undocumented
Class Variable f_api_top_html Undocumented
Class Variable f_recordset_grid Undocumented
Class Variable obj_input_elements Undocumented
Class Variable obj_input_fields Undocumented
Class Variable preview_html Undocumented
Class Variable preview_top_html Undocumented
Class Variable security Undocumented
Class Variable spacer_gif Undocumented
Class Variable zmi_ace_editor Undocumented
Class Variable zmi_body_footer Undocumented
Class Variable zmi_body_header Undocumented
Class Variable zmi_breadcrumbs Undocumented
Class Variable zmi_breadcrumbs_obj_path Undocumented
Class Variable zmi_html_foot Undocumented
Class Variable zmi_html_head Undocumented
Class Variable zmi_manage_tabs_message Undocumented
Class Variable zmi_navbar_brand Undocumented
Class Variable zmi_pagination Undocumented
Class Variable zmi_tabs Undocumented
Class Variable zmi_tabs_sub Undocumented
Instance Variable dTagStack Undocumented
Instance Variable dValueStack Undocumented
Instance Variable id Undocumented
Instance Variable oParent Undocumented
Instance Variable ref_by Undocumented
Instance Variable sort_id Undocumented
Method _getBodyContent Render the raw body content template for the object.
Method _getBodyContentContentEditable Wrap rendered body content with editable markup when preview mode allows it.
Instance Variable _uid Undocumented
def __init__(self, id='', sort_id=0): (source)

Initialize a ZMS object with its persistent id and sort order.

Parameters
id:strObject id.
sort_id:intInitial sort position.
def __proxy__(self): (source)

Return the acquisition-wrapped object proxy.

def ajaxGetBodyContent(self, REQUEST, forced=False): (source)

Return body content for AJAX requests.

Parameters
REQUEST:ZPublisher.HTTPRequestCurrent request.
forced:boolIgnore visibility checks.
Returns
strRendered body content.
def aq_absolute_url(self, relative=0): (source)

Return the absolute URL adjusted for acquisition-aware container context.

Parameters
relative:boolReturn a relative URL when true.
Returns
strAbsolute or relative URL.
def breadcrumbs_obj_path(self, portalMaster=True): (source)

Return the object chain used for ZMI breadcrumb rendering.

Parameters
portalMaster:boolInclude portal master ancestors when configured.
Returns
listBreadcrumb object path.
def changeProperties(self, lang): (source)

Apply request values to the object's editable properties.

Parameters
lang:strActive language for the update.
def clear_request_context(self, REQUEST, prefix='oid'): (source)

Remove request-scoped context values for the current object.

Parameters
REQUEST:ZPublisher.HTTPRequestCurrent request.
prefix:strKey prefix used for stored values.
def display_icon(self, *args, **kwargs): (source)

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
*argsUndocumented
meta_id:strOptional meta object id.
meta_type:strLegacy alias for meta_id.
Returns
strHTML fragment containing the icon element.
def display_type(self, *args, **kwargs): (source)

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
*argsUndocumented
meta_id:strOptional meta object id.
meta_type:strLegacy alias for meta_id.
Returns
strLocalized type label.
def f_css_defaults(self, REQUEST=None): (source)

Return CSS defaults for the current object.

Deprecated: use zmi_css_defaults instead.

Parameters
REQUEST:ZPublisher.HTTPRequestOptional request to use for rendering.
Returns
strCSS imports for matching meta-object defaults.
def FileFromData(self, data, filename='', content_type=None): (source)

Creates a new instance of a file from given data.

Parameters
data:stringFile-data (binary)
filename:stringFilename
content_typeUndocumented
Returns
MyFileNew instance of file.
def get_oid(self): (source)

Return the ZODB object id in a stable printable form.

Returns
strObject id prefixed with oid:.
def get_request_context(self, REQUEST, key, defaultValue=None): (source)

Read an object-scoped value from the request with fallback to a plain key.

Parameters
REQUEST:ZPublisher.HTTPRequestCurrent request.
key:strContext key.
defaultValue:anyValue returned when no context key exists.
Returns
anyStored request context value or fallback.
def get_size(self, REQUEST={}): (source)

Calculate the approximate size of the object's stored attribute values.

Parameters
REQUEST:dictOptional request context.
Returns
intEstimated object size.
def get_uid(self, forced=False): (source)

Return the persistent uid of the object, generating one if needed.

Parameters
forced:boolForce generation of a new uid.
Returns
strObject uid prefixed with uid:.
def getAbsoluteUrlInContext(self, context, abs_url=None, forced=False): (source)

Rewrite an absolute URL so it stays in the configured context domain.

Parameters
context:zmsobject.ZMSObjectCurrent context object.
abs_url:strAbsolute URL to contextualize.
forced:boolForce contextualization rules.
Returns
strContext-aware absolute URL.
def getBodyContent(self, REQUEST, forced=False): (source)

Return the rendered body content when the object is visible.

Parameters
REQUEST:ZPublisher.HTTPRequestCurrent request.
forced:boolIgnore visibility checks.
Returns
strRendered body content.
def getDCCoverage(self, REQUEST={}): (source)

Return the Dublin Core coverage value for the current object.

Parameters
REQUEST:dictOptional request context.
Returns
strCoverage value.
def getDCDescription(self, REQUEST): (source)

Return the Dublin Core description for the current object.

Parameters
REQUEST:ZPublisher.HTTPRequestCurrent request.
Returns
strDescription value.
def getDeclId(self, REQUEST={}): (source)

Return the declarative id used for path-handler based URLs.

Parameters
REQUEST:dictOptional request context.
Returns
strDeclarative id.
def getDeclUrl(self, REQUEST={}): (source)

Return the declarative URL assembled from path-handler ids.

Parameters
REQUEST:dictOptional request context.
Returns
strDeclarative URL.
def getHref2Html(self, fct, pageext, REQUEST): (source)

Build an HTML href for the object or the owning page.

Parameters
fct:strTarget page function name.
pageext:strFile extension used for generated pages.
REQUEST:ZPublisher.HTTPRequestCurrent request.
Returns
strContext-aware href.
def getHref2IndexHtml(self, REQUEST, deep=1): (source)

Return the default public URL for the object in the current request.

Parameters
REQUEST:ZPublisher.HTTPRequestCurrent request.
deep:intTraverse into descendant pages when needed.
Returns
strPublic object URL.
def getHref2IndexHtmlInContext(self, context, index_html=None, REQUEST=None, deep=1): (source)

Rewrite an index URL so it matches the current context and domain rules.

Parameters
context:zmsobject.ZMSObjectCurrent context object.
index_html:strExisting index URL.
REQUEST:ZPublisher.HTTPRequestCurrent request.
deep:intFallback depth for generated URLs.
Returns
strContext-aware index URL.
def getLevel(self): (source)

Return the hierarchical level relative to the document element.

Returns
intTree level.
def getPageExt(self, REQUEST): (source)

Return the configured page extension for the current object.

Parameters
REQUEST:ZPublisher.HTTPRequestCurrent request.
Returns
strPage extension.
def getParentByDepth(self, deep): (source)

Return the ancestor reached by walking up a fixed number of levels.

Parameters
deep:intNumber of parent steps.
Returns
zmsobject.ZMSObjectAncestor object.
def getParentByLevel(self, level): (source)

Return the ancestor located at the requested tree level.

Parameters
level:intTarget level.
Returns
zmsobject.ZMSObjectAncestor object.
def getParentNode(self): (source)

Return the logical parent node of this object.

Returns
zmsobject.ZMSObjectParent object or None.
def getPath(self, *args, **kwargs): (source)

Return the physical path without duplicate trailing `content` ids.

def getSelf(self, meta_type=None): (source)

Return this object or the nearest ancestor matching the requested type.

Parameters
meta_type:str or listOptional meta-type selector.
Returns
zmsobject.ZMSObjectMatching object.
def getSortId(self): (source)

Return the numeric sort id extracted from the stored format.

Returns
intNumeric sort id.
def getTitle(self, REQUEST): (source)

Return the localized title used for navigation and rendering.

Parameters
REQUEST:ZPublisher.HTTPRequestCurrent request.
Returns
strDisplay title.
def getTitlealt(self, REQUEST): (source)

Return the alternate localized title used in URLs and exports.

Parameters
REQUEST:ZPublisher.HTTPRequestCurrent request.
Returns
strAlternate display title.
def getTreeNodes(self, REQUEST={}, meta_types=None): (source)

Return a depth-first list of subtree nodes matching the optional filter.

Parameters
REQUEST:dictOptional request context.
meta_types:str or listOptional meta-type filter.
Returns
listMatching subtree nodes.
def getType(self): (source)

Return the semantic content type declared by the meta object.

Returns
strOne of the configured ZMS content type identifiers.
def ImageFromData(self, data, filename='', content_type=None): (source)

Create an image blob field instance from binary data.

Parameters
data:bytes or strImage payload.
filename:strOriginal filename.
content_type:strOptional MIME type.
Returns
MyImageNew image blob wrapper.
def is_child_of(self, ob): (source)

Return whether this object is a descendant of the given object.

Parameters
ob:zmsobject.ZMSObjectPotential ancestor object.
Returns
boolTrue if this object is below ob.
def is_resource(self): (source)

Compatibility alias for isResource using the current request.

def is_translated(self, lang): (source)

Compatibility alias for isTranslated using the current request.

def is_visible(self): (source)

Compatibility alias for isVisible using the current request.

def isAncestor(self, ob): (source)

Return whether this object is an ancestor of the given object.

Parameters
ob:zmsobject.ZMSObjectPotential descendant object.
Returns
boolTrue if this object contains ob in its subtree.
def isMetaType(self, meta_type, REQUEST={}): (source)

Check whether the object matches the requested meta type selector.

Parameters
meta_type:str or listSingle selector or list of selectors.
REQUEST:dictOptional request context.
Returns
boolTrue if the object matches.
def isModifiedInParentLanguage(self, lang, REQUEST): (source)

Return whether the current language version is newer than its parent language.

Parameters
lang:strLanguage id to compare.
REQUEST:ZPublisher.HTTPRequestCurrent request.
Returns
boolTrue if the current language is newer.
def isPage(self): (source)

Return whether the object represents a page node.

def isPageContainer(self): (source)

Return whether the object behaves as a page container.

def isPageElement(self): (source)

Return whether the object represents a page element node.

def isResource(self, REQUEST): (source)

Return whether the object is treated as a resource node.

Parameters
REQUEST:ZPublisher.HTTPRequestCurrent request.
Returns
boolTrue if the object is a resource.
def isTranslated(self, lang, REQUEST): (source)

Return whether the object contains data for the requested language.

Parameters
lang:strLanguage id to check.
REQUEST:ZPublisher.HTTPRequestCurrent request.
Returns
boolTrue if translated content exists.
def isVisible(self, REQUEST): (source)

Return whether the object is visible in the current request context.

Parameters
REQUEST:ZPublisher.HTTPRequestCurrent request.
Returns
boolTrue if the object is visible.
def manage_changeProperties(self, lang, REQUEST, RESPONSE=None): (source)

Persist edited properties and redirect back to the management UI.

Parameters
lang:strActive language.
REQUEST:ZPublisher.HTTPRequestCurrent request.
RESPONSE:ZPublisher.HTTPResponseOptional response used for redirect handling.
Returns
objectRedirect response when RESPONSE is provided.
def manage_executeMetacmd(self, id, REQUEST, RESPONSE=None, context=None): (source)

Execute a meta-object attribute or configured meta command.

Parameters
id:strMeta attribute or meta command id.
REQUEST:ZPublisher.HTTPRequestCurrent request.
RESPONSE:ZPublisher.HTTPResponseOptional response used for redirects.
context:zmsobject.ZMSObjectOptional execution context.
Returns
objectMeta command result when executed directly.
def manage_moveObjDown(self, lang, REQUEST, RESPONSE): (source)

Move the object down within its parent's sort order.

Parameters
lang:strActive language.
REQUEST:ZPublisher.HTTPRequestCurrent request.
RESPONSE:ZPublisher.HTTPResponseCurrent response.
def manage_moveObjToPos(self, lang, pos, fmt=None, REQUEST=None, RESPONSE=None): (source)

Move the object to a specific position within its siblings.

Parameters
lang:strActive language.
pos:intTarget one-based position.
fmt:strOptional response format.
REQUEST:ZPublisher.HTTPRequestCurrent request.
RESPONSE:ZPublisher.HTTPResponseOptional response for redirect handling.
Returns
strJSON message when fmt == 'json'.
def manage_moveObjUp(self, lang, REQUEST, RESPONSE): (source)

Move the object up within its parent's sort order.

Parameters
lang:strActive language.
REQUEST:ZPublisher.HTTPRequestCurrent request.
RESPONSE:ZPublisher.HTTPResponseCurrent response.
def printHtml(self, level, sectionizer, REQUEST, deep=True): (source)

Render a printable HTML representation of the object subtree.

Parameters
level:intCurrent heading level.
sectionizer:objectSection numbering helper.
REQUEST:ZPublisher.HTTPRequestCurrent request.
deep:boolInclude child pages recursively.
Returns
strPrintable HTML.
def renderShort(self, REQUEST, manage_main=False): (source)

Render a short management or content preview of the object.

Parameters
REQUEST:ZPublisher.HTTPRequestCurrent request.
manage_main:boolRender the management-main variant.
Returns
strShort HTML fragment.
def set_request_context(self, REQUEST, d): (source)

Store a set of request-scoped context values for the object.

Parameters
REQUEST:ZPublisher.HTTPRequestCurrent request.
d:dictMapping of context keys to values.
def set_uid(self, uid): (source)

Set the persistent uid of the object.

Parameters
uid:strRaw or prefixed uid.
def setSortId(self, sort_id): (source)

Store the sort id in the canonical prefixed internal format.

Parameters
sort_id:intNumeric sort value.
def title(self): (source)

Return the basic title attribute or a fallback product label.

def xmlGetParent(self): (source)

Return the temporary parent stored for XML builder object creation.

def xmlOnCharacterData(self, sData, bInCData): (source)

Delegate character-data handling to the shared XML helper.

def xmlOnEndElement(self): (source)

Finalize XML builder state after the current element closes.

def xmlOnStartElement(self, sTagName, dTagAttrs, oParentNode): (source)

Initialize XML builder state for a new element.

Parameters
sTagName:strTag name.
dTagAttrs:dictTag attributes.
oParentNode:zmsobject.ZMSObjectParent node during XML object creation.
def xmlOnUnknownEndTag(self, sTagName): (source)

Delegate unknown end-tag handling to the shared XML helper.

def xmlOnUnknownStartTag(self, sTagName, dTagAttrs): (source)

Delegate unknown start-tag handling to the shared XML helper.

def zmi_css_defaults(self, REQUEST): (source)

Build the generated CSS import list for this object.

Parameters
REQUEST:ZPublisher.HTTPRequestCurrent request.
Returns
strCSS source text.
def zmi_icon(self, *args, **kwargs): (source)

Return the CSS icon class used for the object in the management UI.

Returns
strFont Awesome class string.
FORM_LABEL_MANDATORY: str = (source)

Undocumented

Value
'<sup style="color:red">*</sup>'
MISC_ZMS: str = (source)

Undocumented

Value
'/++resource++zms_/img/'

Undocumented

Value
chr(34)
f_api_html = (source)

Undocumented

f_api_top_html = (source)

Undocumented

f_recordset_grid = (source)

Undocumented

obj_input_elements = (source)

Undocumented

obj_input_fields = (source)

Undocumented

preview_html = (source)

Undocumented

preview_top_html = (source)

Undocumented

security = (source)

Undocumented

spacer_gif: str = (source)

Undocumented

zmi_ace_editor = (source)

Undocumented

zmi_body_footer = (source)

Undocumented

zmi_body_header = (source)

Undocumented

zmi_breadcrumbs = (source)

Undocumented

zmi_breadcrumbs_obj_path = (source)

Undocumented

zmi_html_foot = (source)

Undocumented

zmi_html_head = (source)

Undocumented

zmi_manage_tabs_message = (source)

Undocumented

zmi_navbar_brand = (source)

Undocumented

zmi_pagination = (source)

Undocumented

zmi_tabs = (source)

Undocumented

zmi_tabs_sub = (source)

Undocumented

dTagStack = (source)

Undocumented

dValueStack = (source)

Undocumented

Undocumented

Undocumented

ref_by: list = (source)

Undocumented

Undocumented

def _getBodyContent(self, REQUEST): (source)

Render the raw body content template for the object.

def _getBodyContentContentEditable(self, html): (source)

Wrap rendered body content with editable markup when preview mode allows it.

Undocumented