class ZReferableItem(object): (source)
Mixin for internal reference handling in ZMS objects.
This mixin resolves internal link tokens, collects outgoing references, maintains incoming backlinks in ref_by, and validates stored references.
| Method | change |
Changes all internal references TO a new target object. |
| Method | find |
Quickly finds and returns an object based on an internal URL. Assumes the object exists as a recently calculated uid in ZMSIndex or as a object path. |
| Method | get |
Resolves internal or external links and returns the corresponding object. |
| Method | get |
Combines internal/external link resolution and returns the final URL string, handling anchors and mailto obfuscation. |
| Method | get |
Returns a list of references FROM other objects to this object. |
| Method | get |
Returns the internal reference path for a given object. |
| Method | get |
Returns a list of references from this object TO other objects. |
| Method | get |
Computes a relative URL from a source path to a destination URL. |
| Method | prepare |
Prepares the refresh of references TO other objects by storing the current references. This method stores the current outgoing references in self.ref_to for later comparison by refreshRefToObjs. |
| Method | refresh |
Synchronizes references TO other objects, updating registrations as needed. |
| Method | register |
Registers a reference FROM another object to this object. |
| Method | synchronize |
Synchronizes the list of references FROM other objects. |
| Method | tal |
Generate an HTML anchor (<a>) tag. |
| Method | unregister |
Unregisters a reference FROM another object to this object. |
| Method | validate |
Validates internal links within inline HTML content. |
| Method | validate |
Validates a single internal link. |
| Method | validate |
Validates internal object-references. |
| Class Variable | __ac |
Undocumented |
| Class Variable | __administrator |
Undocumented |
| Class Variable | __author |
Undocumented |
| Class Variable | manage |
Undocumented |
| Class Variable | manage |
Undocumented |
| Class Variable | manage_ |
Undocumented |
| Instance Variable | ref |
Undocumented |
| Instance Variable | ref |
Undocumented |
Changes all internal references TO a new target object.
| Parameters | |
| ref | The target reference to which all selected references should point. |
| Returns | |
| dict or None | A result dictionary with changed and unchanged references, or None if no update could be performed. |
Quickly finds and returns an object based on an internal URL. Assumes the object exists as a recently calculated uid in ZMSIndex or as a object path.
| Parameters | |
| url:str | Internal URL string in the format {$...}. |
| Returns | |
| object or None | The resolved object if found, otherwise None. |
Resolves internal or external links and returns the corresponding object.
| Parameters | |
| url:str | The link to resolve. It can be internal or external. |
| REQUEST:object | The request object. |
| Returns | |
| object or None | The resolved object if found, otherwise None. |
Combines internal/external link resolution and returns the final URL string, handling anchors and mailto obfuscation.
| Parameters | |
| url:str | The link to resolve. It can be internal or external. |
| REQUEST:object | The request object. |
| Returns | |
str This method differs from | The resolved URL as a string. |
Returns a list of references FROM other objects to this object.
| Parameters | |
| REQUEST:object | The request object. |
| Returns | |
| list | References from other objects to this object. |
Returns the internal reference path for a given object.
| Parameters | |
| ob:object | The object to reference. |
| anchor:str | Anchor string to append. |
| Returns | |
| str | The internal reference path in {$...} format. |
Returns a list of references from this object TO other objects.
| Returns | |
| list | References from this object to other objects. |
Computes a relative URL from a source path to a destination URL.
| Parameters | |
| path:str | The source path. |
| url:str | The destination URL. |
| Returns | |
| str | The relative URL if both URLs share the same base, otherwise the original destination URL. |
Prepares the refresh of references TO other objects by storing the current references. This method stores the current outgoing references in self.ref_to for later comparison by refreshRefToObjs.
Synchronizes references TO other objects, updating registrations as needed.
The method unregisters obsolete backlinks and registers newly created backlinks.
Registers a reference FROM another object to this object.
| Parameters | |
| ob:object | The object referencing this object. |
Synchronizes the list of references FROM other objects.
| Parameters | |
| strict:int | Flag kept for API compatibility. |
| Returns | |
| list | The updated list of references from other objects. |
Generate an HTML anchor (<a>) tag.
| Parameters | |
| href:str | The URL for the anchor's href attribute. |
| target:str | The target attribute for the anchor, for example _blank. |
| attrs:dict | Additional HTML attributes for the anchor tag. |
| content:str | The inner HTML or text content of the anchor. |
| Returns | |
| str | The formatted HTML anchor tag as a string. |
Unregisters a reference FROM another object to this object.
| Parameters | |
| ob:object | The object referencing this object. |
Validates internal links within inline HTML content.
| Parameters | |
| text:str | The HTML content to validate. |
| Returns | |
| str | The validated HTML content with updated internal links. |
Validates a single internal link.
| Parameters | |
| url:str | The internal link to validate. |
| Returns | |
| str | The validated internal link. |