Skip to main content

Uid product for the Zope Content Management Framework

Project description

https://github.com/zopefoundation/Products.CMFUid/actions/workflows/tests.yml/badge.svg https://coveralls.io/repos/github/zopefoundation/Products.CMFUid/badge.svg Current version on PyPI Supported Python versions

Products.CMFUid

CMFUid introduces a simple unique id implementation.

Implementation

The supplied tools attach the unique ids to the objects. The objects do not have to be aware of unique ids.

The current implementation depends on the portal catalog to find an object of a given unique id. The interfaces do not imply the use of the catalog (except the IUniqueIdBrainQuery).

Which Tool does What?

The ‘portal_uidgenerator’ tools responsibility is to generate unique ids. The ‘portal_uidannotation’ tool is responsible to attach unique ids to a content object, and enforce rules about what happens on object move/create/delete. The ‘portal_uidhandler’ manages registering and accessing unique ids.

This design was chosen to allow users replacing only parts of the functionality without having to understand the whole thing.

Unique Id API

‘portal_uidhandler’ implementing ‘IUniqueIdHandler’ is the main API for playing with unique ids.

Usage

‘portal_uidhandler’ fully implements IUniqueIdHandler (IUniqueIdSet for registering/unregistering unique ids, IUniqueIdQuery for queries and IUniqueIdBrainQuery for more efficient queries by returning catalog brains instead of objects).

The current implementation of get/queryBrain and get/queryObject do not return invisible objects (and brains of invisible objects). By invisible objects, we mean objects that would be filtered out by portal_catalog.searchResults due to expiry/effective date and/or user roles.

It is often necessary to avoid this filtering in an application. To do this, use the unrestrictedGet/QueryBrain and unrestrictedGet/QueryObject as this will avoid ‘None’ results.

Have a look at the interfaces.

CMFUid’s functionality is used by CMFDefault’s favorite content type to follow linked objects. The favorite content type works as before if CMFUid is not installed.

Update 2007-03-30

The annotation code has been updated to use events for assigning/removing uids. The settings for this live in the portal_uidannotation tool.

The default behaviour is:

  • uids are NOT assigned when an object is created (it is assumed that other code is responsible for this)

  • when an object is moved, a UID is not changed

  • when an object is imported, any EXISTING UID is removed (this can be controlled via the ‘remove_on_add’ property)

  • when an object is copied, any EXISTING UID is removed (this can be controlled via the ‘remove_on_clone’ property)

A more natural behaviour is for UIDs to be assigned automatically on creation. To enable this feature:

  • tick the ‘assign UIDs on add’ tickbox (uids will now be assigned when content is added or imported and any EXISTING uid will be replaced)

  • tick the ‘assign UIDs on copy’ tickbox (objects will get a NEW uid when they are copied which will replace any EXISTING uid)

In order to preserve the original behaviour of the tool, automatic assignment of uids is NOT enabled by default - it must be turned on in the uidannotation tool.

The behaviour is hooked in based on object creating/deletion/move events for any IContentish objects. The event handlers live in the UniqueIdAnnotation tool.


Products.CMFUid Changelog

3.3 (2022-07-13)

  • Add support for Python 3.10.

3.2.0 (2021-03-15)

  • Add support for Python 3.9.

  • Change package structure to move package code into a src subfolder.

3.1.0 (2020-09-28)

  • Fixed deprecation warning for zope.component.interfaces.IObjectEvent.

  • Drop support for python setup.py test which is broken in Python 3.7+.

3.0.2 (2020-06-24)

  • Clean up and sanitize package and tests configurations

  • Remove DeprecationWarning: “InitializeClass is deprecated. Please import from AccessControl.class_init.” Works now with Zope 5

3.0.1 (2018-11-07)

  • fix test isolation problems [petschki]

3.0 (2018-07-05)

2.3.0-beta (2012-03-21)

  • Made sure converted tools are used as utilities.

  • Require at least Zope 2.13.12.

2.2.1 (2010-07-04)

  • Deal with deprecation warnings for Zope 2.13.

  • Fix markup error (Chameleon compatibility)

2.2.0 (2010-01-04)

  • no changes from version 2.2.0-beta

2.2.0-beta (2009-12-06)

  • no changes from version 2.2.0-alpha

2.2.0-alpha (2009-11-13)

  • moved the Zope dependency to version 2.12.0b3dev

  • Cleaned up / normalized imports:

    o Don’t import from Globals; instead, use real locations.

    o Make other imports use the actual source module, rather than an

    intermediate (e.g., prefer importing ‘ClassSecurityInfo’ from ‘AccessControl.SecurityInfo’ rather than from ‘AccessControl’).

  • Add missing utility registration for IUniqueIdHandler. See https://bugs.launchpad.net/bugs/299058 .

  • UniqueIdHandlerTool: Call the reindexObject attribute of the object getting a uid, rather than portal_catalog’s reindexObject. This is needed to properly handle objects like the portal itself which shouldn’t get catalogued ever.

  • Removed redundant and unexpected code to auto-create catalog index and column for the UID handler tool. The index and column are already created by the default CMFUid GenericSetup profile. (http://www.zope.org/Collectors/CMF/472)

2.1.2 (2008-09-13)

  • no changes from 2.1.2-beta

2.1.2-beta (2008-08-26)

  • completed devolution from monolithic CMF package into its component products that are distributed as eggs from PyPI.

  • testing: Base UidEventZCMLLayer on ZopeTestCase.layer.ZopeLite.

  • UniqueIdHandlerTool: Use %r instead of %s in error messages, so we don’t trip over non-ASCII representations (e.g. File and Image).

2.1.1 (2008-01-06)

  • no changes

2.1.1-beta(2007-12/29)

  • Testing: Derive test layers from ZopeLite layer if available.

2.1.0 (2007-08-08)

  • Fixed all componentregistry.xml files to use plain object paths and strip and slashes. GenericSetup does only support registering objects which are in the site root.

2.1.0-beta2 (2007-07-12)

2.1.0-beta (2007-03-09)

2.1.0-alpha2 (2006-11-23)

  • moved the Zope dependency to version 2.10.1

  • Fixed test breakage induced by use of Z3 pagetemplates in Zope 2.10+.

  • browser views: Added some zope.formlib based forms.

  • testing: Added test layers for setting up ZCML.

2.1.0-alpha (2006-10-09)

  • skins: Changed encoding of translated portal_status_messages. Now getBrowserCharset is used to play nice with Five forms. Customized setRedirect and getMainGlobals scripts have to be updated.

  • Profiles: All profiles are now registered by ZCML.

  • ZClasses: Removed unmaintained support for ZClasses. Marked the ‘initializeBases*’ methods as deprecated.

  • Content: Added IFactory utilities for all content classes. They are now used by default instead of the old constructor methods.

  • Content: All content classes are now registered by ZCML. ContentInit is still used to register oldstyle constructors.

  • setup handlers: Removed support for CMF 1.5 CMFSetup profiles.

Earlier releases

For a complete list of changes before version 2.1.0-alpha, see the HISTORY.txt file on the CMF-2.1 branch: http://svn.zope.org/CMF/branches/2.1/HISTORY.txt?view=auto

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Products.CMFUid-3.3.tar.gz (23.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Products.CMFUid-3.3-py2.py3-none-any.whl (25.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file Products.CMFUid-3.3.tar.gz.

File metadata

  • Download URL: Products.CMFUid-3.3.tar.gz
  • Upload date:
  • Size: 23.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.13

File hashes

Hashes for Products.CMFUid-3.3.tar.gz
Algorithm Hash digest
SHA256 7716f8ca3c2b3a67c4afd8492ddb89858d4ca5a1e4c37288b266be3dcaeb9004
MD5 6a0ee2733c07c0ab3cc0707db1939e31
BLAKE2b-256 1daf61e7aaa546fe6e82f5f6cae514f1810644964732b245f2eaa6dbd04d7e07

See more details on using hashes here.

File details

Details for the file Products.CMFUid-3.3-py2.py3-none-any.whl.

File metadata

  • Download URL: Products.CMFUid-3.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 25.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.13

File hashes

Hashes for Products.CMFUid-3.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 bb6d6af85ef73681ddd3c4e8f37329f64479f1c427ea31b81af4c2a84e0a1cfb
MD5 757f8024123b125350ddb3655e3f3aa6
BLAKE2b-256 7916c74947f3f043871f93074e1b03736e632718e3896420d6408d75bdbb585f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page