[CMF-checkins] CVS: CMF - CatalogTool.py:1.8 CookieCrumbler.py:1.2 DirectoryView.py:1.4 FSDTMLMethod.py:1.2 FSImage.py:1.2 MemberDataTool.py:1.3 MembershipTool.py:1.3 PortalContent.py:1.10 PortalFolder.py:1.7 TypesTool.py:1.8 utils.py:1.7

Martijn Pieters mj@digicool.com
Sun, 8 Apr 2001 15:18:49 -0400 (EDT)


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

Modified Files:
	CatalogTool.py CookieCrumbler.py DirectoryView.py 
	FSDTMLMethod.py FSImage.py MemberDataTool.py MembershipTool.py 
	PortalContent.py PortalFolder.py TypesTool.py utils.py 
Log Message:
Fix for issue PTK(241)[]: use of .id instead of getId().

- Replace all usage of SimpleItem.id with SimpleItem.getId(). Hold on to
  your butts! I am pretty sure that I didn't miss anything and that I didn't
  break anything, but you never know.

- Remove surplus > from CMFDefault/dtml/discussionEdit.dtml.

- Add missing > to CMFTopic/skins/topic/topic_edit.dtml, this fixes the ugly
  layout.



--- Updated File CatalogTool.py in package CMF --
--- CatalogTool.py	2001/04/06 17:07:32	1.7
+++ CatalogTool.py	2001/04/08 19:18:09	1.8
@@ -143,7 +143,7 @@
     security = ClassSecurityInfo()
 
     def __init__(self):
-        ZCatalog.__init__(self, self.id)
+        ZCatalog.__init__(self, self.getId())
         self._initIndexes()
 
     def _initIndexes(self):

--- Updated File CookieCrumbler.py in package CMF --
--- CookieCrumbler.py	2001/02/23 14:24:11	1.1
+++ CookieCrumbler.py	2001/04/08 19:18:09	1.2
@@ -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/04/07 22:59:53	1.3
+++ DirectoryView.py	2001/04/08 19:18:09	1.4
@@ -323,9 +323,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)

--- Updated File FSDTMLMethod.py in package CMF --
--- FSDTMLMethod.py	2001/02/23 14:24:11	1.1
+++ FSDTMLMethod.py	2001/04/08 19:18:09	1.2
@@ -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/08 19:18:09	1.2
@@ -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/08 19:18:09	1.3
@@ -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/08 19:18:09	1.3
@@ -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/08 19:18:09	1.10
@@ -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/08 19:18:09	1.7
@@ -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 TypesTool.py in package CMF --
--- TypesTool.py	2001/04/07 22:58:36	1.7
+++ TypesTool.py	2001/04/08 19:18:09	1.8
@@ -198,7 +198,7 @@
         if self.title:
             return self.title
         else:
-            return self.id
+            return self.getId()
     
     security.declareProtected(View, 'Description')
     def Description(self):
@@ -267,7 +267,7 @@
                 if string.lower(action['name']) == id:
                     return action['action']
         if default is _marker:
-            raise TypeError, 'No action "%s" for type "%s"' % ( id, self.id )
+            raise TypeError, 'No action "%s" for type "%s"' % ( id, self.getId() )
         else:
             return default
 
@@ -468,12 +468,12 @@
         # in the process.
         m = self._getFactoryMethod(container, raise_exc=1)
         if m is None:
-            raise 'Unauthorized', ('Cannot create %s' % self.id)
+            raise 'Unauthorized', ('Cannot create %s' % self.getId())
         id = str(id)
         apply(m, (id,) + args, kw)
         ob = container._getOb(id)
         if hasattr(ob, '_setPortalTypeName'):
-            ob._setPortalTypeName(self.id)
+            ob._setPortalTypeName(self.getId())
         return '%s/%s' % ( ob.absolute_url(), self.immediate_view )
 
 InitializeClass( FactoryTypeInformation )
@@ -528,7 +528,7 @@
         id = str(id)
         ob = apply(constructor, (container, id) + args, kw)
         if hasattr(ob, '_setPortalTypeName'):
-            ob._setPortalTypeName(self.id)
+            ob._setPortalTypeName(self.getId())
         return '%s/%s' % ( ob.absolute_url(), self.immediate_view )
 
 InitializeClass( ScriptableTypeInformation )
@@ -586,7 +586,7 @@
             if hasattr(aq_base(product), 'factory_type_information'):
                 ftis = product.factory_type_information
             else:
-                package = getattr(Products, product.id, None)
+                package = getattr(Products, product.getId(), None)
                 dispatcher = getattr(package, '__FactoryDispatcher__', None)
                 ftis = getattr(dispatcher, 'factory_type_information', None)
             if ftis is not None:
@@ -595,7 +595,7 @@
                 for fti in ftis:
                     mt = fti.get('meta_type', None)
                     if mt:
-                        res.append((product.id + ': ' + mt, fti))
+                        res.append((product.getId() + ': ' + mt, fti))
         return res
 
     _addTIForm = HTMLFile( 'addTypeInfo', _dtmldir )

--- Updated File utils.py in package CMF --
--- utils.py	2001/04/07 22:56:47	1.6
+++ utils.py	2001/04/08 19:18:09	1.7
@@ -123,7 +123,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',
@@ -306,7 +306,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)