[CMF-checkins] CVS: CMF - CookieCrumbler.py:1.1.2.1 DirectoryView.py:1.2.2.1 FSDTMLMethod.py:1.1.2.1 FSImage.py:1.1.2.1 MemberDataTool.py:1.2.2.1 MembershipTool.py:1.2.2.1 PortalContent.py:1.9.2.1 PortalFolder.py:1.6.2.1 utils.py:1.5.2.1

Martijn Pieters mj@digicool.com
Mon, 9 Apr 2001 11:48:32 -0400 (EDT)


Update of /cvs-repository/CMF/CMFCore
In directory korak:/tmp/cvs-serv5396/CMFCore

Modified Files:
      Tag: CMF-1_0-branch
	CookieCrumbler.py DirectoryView.py FSDTMLMethod.py FSImage.py 
	MemberDataTool.py MembershipTool.py PortalContent.py 
	PortalFolder.py utils.py 
Log Message:
Merge 'getId()' fix from trunk.



--- Updated File CookieCrumbler.py in package CMF --
--- CookieCrumbler.py	2001/02/23 14:24:11	1.1
+++ CookieCrumbler.py	2001/04/09 15:48:00	1.1.2.1
@@ -286,14 +286,14 @@
 
     def manage_beforeDelete(self, item, container):
         if item is self:
-            handle = self.meta_type + '/' + self.id
+            handle = self.meta_type + '/' + self.getId()
             BeforeTraverse.unregisterBeforeTraverse(container, handle)
 
     def manage_afterAdd(self, item, container):
         if item is self:
-            handle = self.meta_type + '/' + self.id
+            handle = self.meta_type + '/' + self.getId()
             container = container.this()
-            nc = BeforeTraverse.NameCaller(self.id)
+            nc = BeforeTraverse.NameCaller(self.getId())
             BeforeTraverse.registerBeforeTraverse(container, nc, handle)
 
 Globals.InitializeClass(CookieCrumbler)

--- Updated File DirectoryView.py in package CMF --
--- DirectoryView.py	2001/02/28 22:30:52	1.2
+++ DirectoryView.py	2001/04/09 15:48:00	1.2.2.1
@@ -319,9 +319,9 @@
                     continue
 
             if path:
-                subpath = path + '/' + subob.id
+                subpath = path + '/' + subob.getId()
             else:
-                subpath = subob.id
+                subpath = subob.getId()
             title = getattr(subob, 'title', None)
             if title:
                 name = '%s (%s)' % (subpath, title)
@@ -387,7 +387,7 @@
         rval.sort()
         return rval
 
-    security.declarePublic('getid')
+    security.declarePublic('getId')
     def getId(self):
         return self.id
 

--- Updated File FSDTMLMethod.py in package CMF --
--- FSDTMLMethod.py	2001/02/23 14:24:11	1.1
+++ FSDTMLMethod.py	2001/04/09 15:48:00	1.1.2.1
@@ -147,7 +147,7 @@
         folder = self.restrictedTraverse(fpath)
         if data is None:
             data = self.read()
-        id = self.id()
+        id = self.getId()
         obj = DTMLMethod(data, __name__=id)
         folder._verifyObjectPaste(obj, validate_src=0)
         folder._setObject(id, obj)

--- Updated File FSImage.py in package CMF --
--- FSImage.py	2001/02/23 14:24:11	1.1
+++ FSImage.py	2001/04/09 15:48:00	1.1.2.1
@@ -206,7 +206,7 @@
         folder = self.restrictedTraverse(fpath)
         if data is None:
             data = self._readFile()
-        id = self.id()
+        id = self.getId()
         obj = Image(id, '', data)
         folder._verifyObjectPaste(obj, validate_src=0)
         folder._setObject(id, obj)

--- Updated File MemberDataTool.py in package CMF --
--- MemberDataTool.py	2001/02/26 17:34:32	1.2
+++ MemberDataTool.py	2001/04/09 15:48:00	1.2.2.1
@@ -229,7 +229,7 @@
         tool = getattr(self, '_tool', None)
         if tool is not None:
             del self._tool
-            tool.registerMemberData(self, self.id)
+            tool.registerMemberData(self, self.getId())
 
     security.declarePublic('getUser')
     def getUser(self):

--- Updated File MembershipTool.py in package CMF --
--- MembershipTool.py	2001/02/26 17:34:32	1.2
+++ MembershipTool.py	2001/04/09 15:48:00	1.2.2.1
@@ -174,8 +174,8 @@
                 # Check for the member area creation flag and
                 # take appropriate (non-) action
                 if getattr(self, 'memberareaCreationFlag', 0) != 0:
-                    if self.getHomeUrl(portal_user.id) is None:
-                        self.createMemberarea(portal_user.id)
+                    if self.getHomeUrl(portal_user.getId()) is None:
+                        self.createMemberarea(portal_user.getId())
 
                 return portal_user
 

--- Updated File PortalContent.py in package CMF --
--- PortalContent.py	2001/03/23 01:24:42	1.9
+++ PortalContent.py	2001/04/09 15:48:00	1.9.2.1
@@ -178,7 +178,7 @@
                 view = self.restrictedTraverse(path)
                 return view
             raise 'Not Found', ('No default view defined for type "%s"'
-                                % ti.id)
+                                % ti.getId())
         else:
             raise 'Not Found', ('Cannot find default view for "%s"'
                                 % string.join( self.getPhysicalPath() ) )

--- Updated File PortalFolder.py in package CMF --
--- PortalFolder.py	2001/03/04 22:29:04	1.6
+++ PortalFolder.py	2001/04/09 15:48:00	1.6.2.1
@@ -415,7 +415,7 @@
                                                      None, object):
                         # validation succeeded
                         return
-                    raise 'Unauthorized', absattr(object.id)
+                    raise 'Unauthorized', object.getId()
                 else:
                     raise 'Unauthorized', permission_name
             #
@@ -439,8 +439,7 @@
                     if getSecurityManager().validate(None, parent,
                                                      None, object):
                         return
-                    id = object.id
-                    if callable(id): id = id()
+                    id = object.getId()
                     raise 'Unauthorized', id
                 else:
                     raise 'Unauthorized', method_name
@@ -539,10 +538,6 @@
         """
         return "Subject: %s; Type: %s" % ( self.filterSubject,
                                            self.filterType )
-
-def absattr(attr):
-    if callable(attr): return attr()
-    else: return attr
 
 manage_addPortalFolder = PortalFolder.manage_addPortalFolder
 manage_addPortalFolderForm = HTMLFile( 'folderAdd', globals() )

--- Updated File utils.py in package CMF --
--- utils.py	2001/03/01 22:43:38	1.5
+++ utils.py	2001/04/09 15:48:00	1.5.2.1
@@ -120,7 +120,7 @@
 
 class ImmutableId (Base):
     def _setId(self, id):
-        if id != self.id:
+        if id != self.getId():
             raise Globals.MessageDialog(
                 title='Invalid Id',
                 message='Cannot change the id of this object',
@@ -303,7 +303,7 @@
             break
     if obj is None:
         raise 'NotFound', type
-    self._setObject(obj.id, obj)
+    self._setObject(obj.getId(), obj)
     if REQUEST is not None:
         return self.manage_main(self, REQUEST)