class ZMSLinkElement(zmscustom.ZMSCustom): (source)
Represent a link element that can resolve, embed, or proxy other content.
Link elements can either behave like a normal local content node or expose another object inline by reference. Depending on attr_type/_embed_type they may:
- link to another object without embedding it,
- embed the referenced object directly,
- recursively proxy the referenced subtree,
- or retrieve remote content through the REST API.
| Method | __proxy__ |
Build the proxy object used for recursive embedded traversal. |
| Method | breadcrumbs |
Return the breadcrumb path for this element. |
| Method | breadcrumbs_obj_path |
Return the breadcrumb path resolved through the current proxy context. |
| Method | display |
Return the icon markup for this element or its referenced target. |
| Method | embed |
Retrieve rendered body content from a remote reference. |
| Method | get |
Return child nodes visible for this link element. |
| Method | get |
Return child nodes for the active proxy or referenced object. |
| Method | get |
Return the configured embedding mode for this link element. |
| Method | get |
Return the index HTML URL for this link element. |
| Method | get |
Return the index HTML URL resolved through the current proxy context. |
| Method | get |
Return the effective hierarchy level of this element. |
| Method | get |
Return the level resolved through the active proxy context. For recursively embedded elements the level is delegated to the proxy. For directly embedded elements the level is calculated based on the parent node level unless the parent is the same as the proxy, in which case it is treated as the root of the embedding context and assigned level 0. |
| Method | get |
Return navigation elements for this link element. |
| Method | get |
Return navigation elements for the current proxy context. |
| Method | get |
Return navigation items for this element. |
| Method | get |
Return navigation items for the current proxy context. Overrides getNavItems of zmscontainerobject.ZMSContainerObject. |
| Method | get |
Return a property value from this element, its proxy, or its reference. |
| Method | get |
Read an object property directly from the supplied proxy object. Overrides getObjProperty of _objattrs.ObjAttrs. |
| Method | get |
The parent of this node. All nodes except root may have a parent. |
| Method | get |
Return the parent node visible through the current proxy context. |
| Method | get |
Return the cached proxy object for this (embedding) link element. |
| Method | get |
Return the stored link target reference. |
| Method | get |
Resolve and cache the referenced object for this link element. |
| Method | get |
Fetch remote metadata for a link element with embed type 'remote'. |
| Method | get |
Return the effective object for this link element. |
| Method | get |
Resolve the effective object for the proxy context. |
| Method | get |
Return the display title for this element. |
| Method | get |
Return the alternate title for this element. |
| Method | get |
Resolve the alternate title through the proxy or reference chain. |
| Method | get |
Resolve the title through the proxy or reference chain. |
| Method | get |
Return an empty tree node list for link elements. |
| Method | get |
Return the effective type for this link element. |
| Method | get |
Return the effective type resolved through embedding or proxying. Overrides getType of zmscustom.ZMSCustom. |
| Method | init |
Create a ZMSProxyObject for a resolved embedded target. |
| Method | is |
Return whether the element is active in the current request context. |
| Method | is |
Return whether this element renders another object inline. |
| Method | is |
Return whether this element uses recursive embedding. |
| Method | is |
Return whether this element matches the requested meta type. |
| Method | is |
Check whether this element or its resolved target matches a meta type. |
| Method | is |
Return whether this element resolves to a page-like target. Embedded and remote link elements are treated as pages when their resolved target has the corresponding flag set. |
| Method | is |
Return False because link elements are never page containers. |
| Method | is |
Return whether this element behaves like a page element. Embedded and remote link elements are treated as page elements when their resolved target has the corresponding flag set. |
| Method | manage_change |
Update link element properties from the ZMI form submission. |
| Method | manage |
Handle the ZMI action 'manage_options'. |
| Method | print |
Return the printable HTML for this link element. |
| Method | print |
Render the printable HTML through the current proxy or reference. |
| Method | render |
Render the compact presentation of the link element. |
| Method | set |
Persist the requested embedding mode on the raw _embed_type attribute. |
| Class Variable | __ac |
Undocumented |
| Class Variable | __author |
Undocumented |
| Class Variable | get |
Undocumented |
| Class Variable | meta |
Undocumented |
| Class Variable | meta |
Undocumented |
| Class Variable | security |
Undocumented |
| Method | _get |
Render the body content for the link element (as HTML). |
| Instance Variable | _embed |
Undocumented |
Build the proxy object used for recursive embedded traversal.
| Returns | |
| object | This element itself or a proxy wrapping the referenced object. |
Return the breadcrumb path for this element.
| Parameters | |
| portal | Include the portal master in the breadcrumb path. |
| Returns | |
| list | Breadcrumb object path. |
Return the breadcrumb path resolved through the current proxy context.
| Parameters | |
| proxy:object | Active proxy object. |
| portal | Include the portal master in the breadcrumb path. |
| Returns | |
| list | Breadcrumb object path. |
Return the icon markup for this element or its referenced target.
| Parameters | |
| *args:tuple | Positional arguments for the icon display. |
| **kwargs:dict | Keyword arguments for the icon display. |
| Returns | |
| str | Icon markup for this element or its referenced target. |
Retrieve rendered body content from a remote reference.
The remote endpoint is only contacted when the embed type is 'remote'.
| Parameters | |
| REQUEST:ZPublisher.HTTPRequest | Current request context. |
| Returns | |
| str | None | Remote HTML fragment or None when remote embedding is not active. |
Return child nodes visible for this link element.
| Parameters | |
| REQUEST:dict | Current request context. |
| meta | Optional meta type filter. |
| reid:str | None | Optional regular-expression id filter. |
| Returns | |
| list | Resolved child node list. |
Return child nodes for the active proxy or referenced object.
Recursively embedded elements expose proxied child nodes. Direct embedded elements expose non-page children of the referenced object. Overrides original method of zmscontainerobject.ZMSContainerObject.
| Parameters | |
| proxy:object | Active proxy object. |
| REQUEST:dict | Current request context. |
| meta | Optional meta type filter. |
| reid:str | None | Optional regular-expression id filter. |
| Returns | |
| list | Child nodes visible through the embedding context. |
Return the configured embedding mode for this link element.
Special handling for _embed_type, because it is a raw attribute and not a property. The value is stored as the raw attribute _embed_type. If it is not set, the method falls back to the legacy object property attr_type.
| Returns | |
| str | None | Embedding mode such as 'embed', 'recursive', 'remote', or an empty value. |
Return the index HTML URL for this link element.
| Parameters | |
| REQUEST:ZPublisher.HTTPRequest | Current request context. |
| deep:int | Depth flag forwarded to the proxy lookup. |
| Returns | |
| str | Resolved index HTML URL. |
Return the index HTML URL resolved through the current proxy context.
| Parameters | |
| proxy:object | Active proxy object. |
| REQUEST:ZPublisher.HTTPRequest | Current request context. |
| deep:int | Depth flag forwarded to the base implementation. |
| Returns | |
| str | Resolved index HTML URL. |
Return the level resolved through the active proxy context. For recursively embedded elements the level is delegated to the proxy. For directly embedded elements the level is calculated based on the parent node level unless the parent is the same as the proxy, in which case it is treated as the root of the embedding context and assigned level 0.
| Parameters | |
| proxy:object | Active proxy object. |
| Returns | |
| int | Effective hierarchy level for this element. |
Return navigation elements for this link element.
| Parameters | |
| REQUEST:ZPublisher.HTTPRequest | Current request context. |
| expand | Flag controlling tree expansion. |
| current | Currently selected child node. |
| sub | Accumulator for nested elements. |
| Returns | |
| list | Navigation elements visible for this element. |
Return navigation elements for the current proxy context.
| Parameters | |
| proxy:object | Active proxy object. |
| REQUEST:ZPublisher.HTTPRequest | Current request context. |
| expand | Flag controlling tree expansion. |
| current | Currently selected child node. |
| sub | Accumulator for nested elements. |
| Returns | |
| list | Navigation elements visible through the embedding context. |
Return navigation items for this element.
| Parameters | |
| current:object | Current navigation node. |
| REQUEST:ZPublisher.HTTPRequest | Current request context. |
| opt:dict | Navigation options. |
| depth:int | Current navigation depth. |
| Returns | |
| list | Navigation items visible for this element. |
Return navigation items for the current proxy context. Overrides getNavItems of zmscontainerobject.ZMSContainerObject.
| Parameters | |
| proxy:object | Active proxy object. |
| current:object | Current navigation node. |
| REQUEST:ZPublisher.HTTPRequest | Current request context. |
| opt:dict | Navigation options. |
| depth:int | Current navigation depth. |
| Returns | |
| list | Navigation items visible through the embedding context. |
Return a property value from this element, its proxy, or its reference.
The method first checks the link element itself, then falls back to the local base implementation, recursive proxies, or the referenced object, depending on the embedding mode.
| Parameters | |
| key:str | Attribute identifier. |
| REQUEST:dict | Request context used for multilingual and preview values. |
| default:any | Default value when no property can be resolved. |
| Returns | |
| any | Resolved property value. |
Read an object property directly from the supplied proxy object. Overrides getObjProperty of _objattrs.ObjAttrs.
| Parameters | |
| proxy:object | Object or proxy that owns the attribute. |
| key:str | Attribute identifier. |
| REQUEST:dict | Request context used for multilingual values. |
| default:any | Unused compatibility parameter. |
| Returns | |
| any | Attribute value resolved from the proxy. |
Return the cached proxy object for this (embedding) link element.
The proxy is stored in the request so repeated rendering and traversal use the same resolved object.
| Returns | |
| object | This element or its request-cached proxy. |
Return the stored link target reference.
The reference is read from attr_ref in the language derived from the current coverage value.
| Returns | |
| str | Link target reference string. |
Resolve and cache the referenced object for this link element.
The lookup result is buffered in the request to avoid repeated traversal and link resolution while rendering a page.
| Returns | |
| object | None | Referenced object or None if the target cannot be resolved. |
Fetch remote metadata for a link element with embed type 'remote'.
The returned mapping is expected to be JSON produced by the remote REST API endpoint for the current language.
| Returns | |
| dict | Parsed JSON payload from the remote object, or an empty mapping on failure. |
Return the effective object for this link element.
| Parameters | |
| meta | Optional meta type constraint. |
| Returns | |
| object | The resolved object for this element or its proxy. |
Resolve the effective object for the proxy context.
| Parameters | |
| proxy:object | Proxy or referenced object to resolve against. |
| meta | Optional meta type constraint. |
| Returns | |
| object | The resolved object for the current proxy context. |
Return the display title for this element.
| Parameters | |
| REQUEST:ZPublisher.HTTPRequest | Current request context. |
| Returns | |
| str | Resolved title or a fallback display type label. |
Return the alternate title for this element.
Remote embeddings read the value from the remote payload; other modes use the local proxy or referenced object and fall back to the display type.
| Parameters | |
| REQUEST:ZPublisher.HTTPRequest | Current request context. |
| Returns | |
| str | Alternate title string. |
Resolve the alternate title through the proxy or reference chain.
| Parameters | |
| proxy:object | Active proxy object. |
| REQUEST:ZPublisher.HTTPRequest | Current request context. |
| Returns | |
| str | Alternate title resolved for the current embedding context. |
Resolve the title through the proxy or reference chain.
| Parameters | |
| proxy:object | Active proxy object. |
| REQUEST:ZPublisher.HTTPRequest | Current request context. |
| Returns | |
| str | Title resolved for the current embedding context. |
Return an empty tree node list for link elements.
Link elements do not contribute their own tree structure here. If none, this is a empty node list.
| Parameters | |
| REQUEST:dict | Current request context. |
| meta | Optional meta type filter. |
| Returns | |
| list | Empty node list. |
Return the effective type resolved through embedding or proxying. Overrides getType of zmscustom.ZMSCustom.
| Parameters | |
| proxy:object | Active proxy object. |
| Returns | |
| str | Effective type. |
Create a ZMSProxyObject for a resolved embedded target.
| Parameters | |
| base:object | Acquisition base for the proxy. |
| url | Absolute URL base for the proxy. |
| proxy:object | Referenced object that should be exposed as proxy. |
| recursive:bool | Flag indicating recursive embedding. |
| Returns | |
| ZMSProxyObject | Proxy object wrapping the referenced node. |
Return whether the element is active in the current request context.
Embedded and remote link elements additionally respect the resolved target activity state.
| Parameters | |
| REQUEST:ZPublisher.HTTPRequest | Current request context. |
| Returns | |
| bool | True if the element should be treated as active. |
Return whether this element matches the requested meta type.
| Parameters | |
| meta | Meta type or list of meta types to test. |
| REQUEST:dict | Request context used by downstream checks. |
| Returns | |
| bool | True if this element or its resolved target matches. |
Check whether this element or its resolved target matches a meta type.
For recursively embedded elements the check is delegated to the proxy. For directly embedded elements it also checks the referenced object unless the special NOREF or NORESOLVEREF markers suppress resolution.
| Parameters | |
| proxy:object | Active proxy object. |
| meta | Meta type or list of meta types to test. |
| REQUEST:dict | Request context used by downstream checks. |
| Returns | |
| bool | True if the element or resolved target matches. |
Return whether this element resolves to a page-like target. Embedded and remote link elements are treated as pages when their resolved target has the corresponding flag set.
| Returns | |
| bool | True if this element should be treated as a page-like target. |
Return False because link elements are never page containers.
| Returns | |
| bool | False because link elements are never page containers. |
Return whether this element behaves like a page element. Embedded and remote link elements are treated as page elements when their resolved target has the corresponding flag set.
| Returns | |
| bool | True if this element should be treated as a page element. |
Update link element properties from the ZMI form submission.
The method stores XML-backed properties, marks the object as modified, recalculates the raw embed type, and redirects back to the management UI with a status message.
| Parameters | |
| lang:str | Active management language, usually a three-letter ZMS language id such as 'eng' or 'ger'. |
| REQUEST:ZPublisher.HTTPRequest | Current ZMI request containing edited attribute values (especially XML-backed object attributes and attr_type). |
| RESPONSE:ZPublisher.HTTPResponse | Response used for the redirect back to the management UI. |
| Returns | |
| ZPublisher.HTTPResponse | Redirect response pointing back to the management form. |
Return the printable HTML for this link element.
| Parameters | |
| level:int | Current print depth. |
| sectionizer:any | Helper used to build printable section numbering. |
| REQUEST:ZPublisher.HTTPRequest | Current rendering request. |
| deep:bool | If true, render nested content recursively. |
| Returns | |
| str | Printable HTML fragment. |
Render the printable HTML through the current proxy or reference.
Recursive embeddings delegate to the proxy tree, while direct embeddings delegate to the referenced object.
| Parameters | |
| proxy:object | Active proxy object for recursive rendering. |
| level:int | Current print depth. |
| sectionizer:any | Helper used to build printable section numbering. |
| REQUEST:ZPublisher.HTTPRequest | Current rendering request. |
| deep:bool | If true, render nested content recursively. |
| Returns | |
| str | Printable HTML fragment. |
Render the compact presentation of the link element.
Embedded links delegate to the referenced object when possible, while non-embedded links fall back to the regular body rendering.
| Parameters | |
| REQUEST:ZPublisher.HTTPRequest | Current rendering request. |
| Returns | |
| str | Short HTML rendering for the element. |
Persist the requested embedding mode on the raw _embed_type attribute.
Special handling for _embed_type, because it is a raw attribute and not a property. If the selected mode would recursively embed an ancestor, the value is replaced with 'cyclic' so callers can react to the invalid state.
Expected values for REQUEST['attr_type'] are for example 'embed', 'recursive', 'remote', or an empty string for a plain non-embedded link. Cyclic recursive references are normalized to 'cyclic'.
| Parameters | |
| REQUEST:ZPublisher.HTTPRequest | Request carrying the submitted attr_type value. |
| Returns | |
| None | None |
Render the body content for the link element (as HTML).
Depending on the embedding mode this may use remote content, a recursive proxy, the referenced object, or the local template output.
| Parameters | |
| REQUEST:ZPublisher.HTTPRequest | Current rendering request. |
| Returns | |
| str | Rendered HTML body for the element. |