class CopySupport(object): (source)
Provides copy and move support for ZMS objects, including clipboard operations, BLOB field handling, and normalization of object IDs after paste.
| Method | cp |
Get the list of objects from the clipboard for the current request. |
| Method | manage_copy |
Put a reference to the objects named in ids in the clipboard. |
| Method | manage_cut |
Put a reference to the objects named in ids in the clipboard for cutting. |
| Method | manage_paste |
Paste previously copied or cut objects into the current object. |
| Instance Variable | blobfields |
Undocumented |
| Method | _copy |
If source and target have different mediadb folder settings, then the data of blob fields is copied as well to avoid missing images and files due to invalid references. |
| Method | _get |
Retrieve and decode clipboard copy data from the request or argument. |
| Method | _get |
Generate a new ID for a copied object. Allow containers to override the generation of object copy id by attempting to call its _get_id method, if it exists. |
| Method | _get |
Decode clipboard data and return the list of objects to be pasted. |
| Method | _set |
Group all objects to be copied / moved at new position (given by _sort_id) in correct sort-order. |
Get the list of objects from the clipboard for the current request.
| Parameters | |
| REQUEST:ZPublisher.HTTPRequest | Zope request object |
| Returns | |
| list | List of objects to paste |
Put a reference to the objects named in ids in the clipboard.
| Parameters | |
| ids:list | List of object IDs to copy (optional) |
| REQUEST:ZPublisher.HTTPRequest | Zope request object (optional) |
| RESPONSE:ZPublisher.HTTPResponse | Zope response object (optional) |
Put a reference to the objects named in ids in the clipboard for cutting.
| Parameters | |
| ids:list | List of object IDs to cut (optional) |
| REQUEST:ZPublisher.HTTPRequest | Zope request object (optional) |
| RESPONSE:ZPublisher.HTTPResponse | Zope response object (optional) |
Paste previously copied or cut objects into the current object.
Handles both copy and move operations, manages BLOB data if necessary, triggers before/after events, normalizes object IDs, and ensures correct sort order after the paste.
| Parameters | |
| REQUEST:ZPublisher.HTTPRequest | The current Zope request object. |
| RESPONSE:ZPublisher.HTTPResponse or None | Optional Zope response object. |
| Returns | |
| None. Redirects to the management interface with a status message. | |
If source and target have different mediadb folder settings, then the data of blob fields is copied as well to avoid missing images and files due to invalid references.
| Parameters | |
| **kwargs:dict | mode ('read_from_source' or 'copy_to_target'), oblist (list of objects) |
Retrieve and decode clipboard copy data from the request or argument.
| Parameters | |
| cb | Encoded clipboard data (optional) |
| REQUEST:ZPublisher.HTTPRequest | Zope request object (optional) |
| Returns | |
| tuple | Decoded clipboard data |
| Raises | |
CopyError | If no data or invalid data is found |
Generate a new ID for a copied object. Allow containers to override the generation of object copy id by attempting to call its _get_id method, if it exists.
| Parameters | |
| id:str | Original object ID |
| Returns | |
| str | New object ID with 'copy_of_' prefix |