[CMF-checkins] CVS: CMF/CMFUid - UniqueIdAnnotationTool.py:1.3
interfaces.py:1.5
Grégoire Weber
zope.org at incept.ch
Thu Jul 22 18:46:13 EDT 2004
Update of /cvs-repository/CMF/CMFUid
In directory cvs.zope.org:/tmp/cvs-serv29305
Modified Files:
UniqueIdAnnotationTool.py interfaces.py
Log Message:
- forgot to update interface after previous rfactoring, tests now use verifyObject to avoid mistakes of this type in the future
- added interface for uid annotation management
=== CMF/CMFUid/UniqueIdAnnotationTool.py 1.2 => 1.3 ===
--- CMF/CMFUid/UniqueIdAnnotationTool.py:1.2 Thu Jul 22 10:15:02 2004
+++ CMF/CMFUid/UniqueIdAnnotationTool.py Thu Jul 22 18:45:43 2004
@@ -29,6 +29,7 @@
from Products.CMFCore.permissions import ManagePortal
from Products.CMFUid.interfaces import IUniqueIdAnnotation
+from Products.CMFUid.interfaces import IUniqueIdAnnotationManagement
class UniqueIdAnnotation(Persistent, Implicit):
"""Unique id object used as annotation on (content) objects.
@@ -109,17 +110,21 @@
__implements__ = (
SimpleItem.__implements__,
+ IUniqueIdAnnotationManagement,
)
id = 'portal_uidannotation'
alternative_id = "portal_standard_uidannotation"
meta_type = 'Unique Id Annotation Tool'
+ security = ClassSecurityInfo()
+
# XXX make Zope properties out of those:
remove_on_add = True
remove_on_clone = True # caution when setting this to False!!!
+ security.declareProtected(ManagePortal, '__call__')
def __call__(self, obj, id):
- """return an empty unique id annotation
+ """See IUniqueIdAnnotationManagement.
"""
return UniqueIdAnnotation(obj, id)
=== CMF/CMFUid/interfaces.py 1.4 => 1.5 ===
--- CMF/CMFUid/interfaces.py:1.4 Thu Jul 22 10:15:02 2004
+++ CMF/CMFUid/interfaces.py Thu Jul 22 18:45:43 2004
@@ -117,7 +117,7 @@
"""
def __call__():
- """Return a unique id object implementing 'IAnnotatedUid'.
+ """Return a unique id value.
"""
@@ -125,13 +125,17 @@
"""Opaque unique id item handling adding, copying, and deletion events.
"""
- def __init__(uid):
- """Generate the unique id object returning 'uid' on '__call__'.
+ def setUid(uid):
+ """Set the uid value the unique id annotation shall return.
"""
- def setId(id):
- """Set the id of the annotated object.
+
+class IUniqueIdAnnotationManagement(Interface):
+ """Manage unique id annotations.
+ """
+
+ def __call__(obj, id):
+ """Attach an unique id attribute of 'id' to the passed object.
- (Unfortunately) the id of the attribute has to be passed for CMF
- internal reasons.
+ Return a unique id object implementing 'IUniqueIdAnnotation'.
"""
More information about the CMF-checkins
mailing list