[CMF-checkins] SVN: CMF/trunk/C merged changes from yuppie-setup_cleanup branch:

Yvo Schubbe y.2005- at wcm-solutions.de
Sun Oct 23 05:46:54 EDT 2005


Log message for revision 39562:
  merged changes from yuppie-setup_cleanup branch:
  - removed old install scripts
  - removed PortalGenerator, manage_addCMFSite and factory_type_information data
  - utils.ContentInit now ignores the 'fti' argument
  - removed obsolete TypesTool.listDefaultTypeInformation method
  - TypesTool.manage_addTypeInformation now ignores the 'typeinfo_name' argument
  - updated DEPENDENCIES.txt (CMFDefault no longer depends on CMFTopic!)
  - removed enumerateIndexes, enumerateLexicons, enumerateColumns and _initIndexes from CatalogTool
  - fixed unit tests

Changed:
  U   CMF/trunk/CHANGES.txt
  U   CMF/trunk/CMFActionIcons/DEPENDENCIES.txt
  D   CMF/trunk/CMFActionIcons/Extensions/
  U   CMF/trunk/CMFCalendar/Event.py
  D   CMF/trunk/CMFCalendar/Extensions/
  D   CMF/trunk/CMFCalendar/INSTALL.txt
  U   CMF/trunk/CMFCalendar/README.txt
  U   CMF/trunk/CMFCalendar/__init__.py
  U   CMF/trunk/CMFCore/CMFBTreeFolder.py
  U   CMF/trunk/CMFCore/CatalogTool.py
  U   CMF/trunk/CMFCore/PortalFolder.py
  U   CMF/trunk/CMFCore/TypesTool.py
  U   CMF/trunk/CMFCore/__init__.py
  U   CMF/trunk/CMFCore/tests/test_CatalogTool.py
  U   CMF/trunk/CMFCore/tests/test_PortalFolder.py
  U   CMF/trunk/CMFCore/tests/test_TypesTool.py
  U   CMF/trunk/CMFCore/utils.py
  U   CMF/trunk/CMFDefault/DEPENDENCIES.txt
  U   CMF/trunk/CMFDefault/DiscussionItem.py
  U   CMF/trunk/CMFDefault/Document.py
  U   CMF/trunk/CMFDefault/Favorite.py
  U   CMF/trunk/CMFDefault/File.py
  U   CMF/trunk/CMFDefault/Image.py
  U   CMF/trunk/CMFDefault/Link.py
  U   CMF/trunk/CMFDefault/NewsItem.py
  U   CMF/trunk/CMFDefault/Portal.py
  U   CMF/trunk/CMFDefault/SkinnedFolder.py
  U   CMF/trunk/CMFDefault/__init__.py
  U   CMF/trunk/CMFDefault/setuphandlers.py
  D   CMF/trunk/CMFTopic/Extensions/
  D   CMF/trunk/CMFTopic/README.txt
  U   CMF/trunk/CMFTopic/Topic.py
  U   CMF/trunk/CMFTopic/__init__.py
  U   CMF/trunk/CMFTopic/tests/test_DateC.py
  U   CMF/trunk/CMFTopic/tests/test_Topic.py
  U   CMF/trunk/CMFUid/tests/test_uidhandling.py

-=-
Modified: CMF/trunk/CHANGES.txt
===================================================================
--- CMF/trunk/CHANGES.txt	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CHANGES.txt	2005-10-23 09:46:52 UTC (rev 39562)
@@ -4,6 +4,7 @@
 
     - CMFDefault and CMFTopic: Split off CMFTopic profile.
       CMFTopic support is now configured by an optional extension profile.
+      CMFDefault no longer depends on CMFTopic.
 
     - TypesTool: Improved add form for type info objects.
       Presettings can now be loaded from type info settings in setup profiles.
@@ -130,6 +131,19 @@
 
   Others
 
+    - CMFDefault: Removed PortalGenerator and manage_addCMFSite.
+
+    - Portal Types: Removed factory_type_information data.
+      TypesTool.listDefaultTypeInformation was removed, the 'fti' argument of
+      utils.ContentInit and the 'typeinfo_name' argument of
+      TypesTool.manage_addTypeInformation are ignored.
+
+    - CatalogTool: A new portal_catalog is now empty.
+      Removed enumerateIndexes, enumerateLexicons, enumerateColumns and
+      _initIndexes. Please use the setup tool to populate the catalog.
+
+    - CMFActionIcons, CMFCalendar and CMFTopic: Removed old install scripts.
+
     - Refactored and extended CMFDefault.tests.test_join so it can be easily 
       subclassed and reused for alternative membership implementations. All
       that is needed is to ovverride _createPortal to return a portal with

Modified: CMF/trunk/CMFActionIcons/DEPENDENCIES.txt
===================================================================
--- CMF/trunk/CMFActionIcons/DEPENDENCIES.txt	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFActionIcons/DEPENDENCIES.txt	2005-10-23 09:46:52 UTC (rev 39562)
@@ -1,3 +1,4 @@
 Zope >= 2.8.2
 Five >= 1.2
 CMFCore
+GenericSetup

Modified: CMF/trunk/CMFCalendar/Event.py
===================================================================
--- CMF/trunk/CMFCalendar/Event.py	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFCalendar/Event.py	2005-10-23 09:46:52 UTC (rev 39562)
@@ -36,28 +36,6 @@
 from permissions import ModifyPortalContent
 from permissions import View
 
-# Factory type information -- makes Events objects play nicely
-# with the Types Tool (portal_types)
-factory_type_information = (
-    {'id': 'Event',
-     'icon': 'event_icon.gif',
-     'meta_type': 'CMF Event',
-     'description': ('Events are objects for use in Calendar topical '
-                     'queries on the catalog.'),
-     'product': 'CMFCalendar',
-     'factory': 'addEvent',
-     'immediate_view': 'event_edit_form',
-     'actions': ({'id': 'view',
-                  'name': 'View',
-                  'action': 'string:${object_url}/event_view',
-                  'permissions': (View,)},
-                 {'id': 'edit',
-                  'name': 'Edit',
-                  'action': 'string:${object_url}/event_edit_form',
-                  'permissions': (ChangeEvents,)},
-                 ),                     # End Actions
-     },
-    )
 
 def addEvent(self
              , id
@@ -73,9 +51,8 @@
              , contact_phone=''
              , event_url=''
              , REQUEST=None):
+    """Create an empty event.
     """
-    Create an empty event.
-    """
     event = Event(id
                   , title
                   , description
@@ -106,10 +83,12 @@
 
     return strings
 
+
 class Event(PortalContent, DefaultDublinCoreImpl):
+
+    """Events are objects for the Calendar topical query.
     """
-    Events are objects for the Calendar topical query.
-    """
+
     meta_type='CMF Event'
 
     # Declarative security
@@ -428,5 +407,4 @@
         """ Used for FTP and apparently the ZMI now too """
         return len(self.manage_FTPget())
 
-# Intialize the Event class, setting up security.
 InitializeClass(Event)

Deleted: CMF/trunk/CMFCalendar/INSTALL.txt
===================================================================
--- CMF/trunk/CMFCalendar/INSTALL.txt	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFCalendar/INSTALL.txt	2005-10-23 09:46:52 UTC (rev 39562)
@@ -1,28 +0,0 @@
-Installing CMFCalendar
-
-  To install CMFCalendar, uncompress the CMFCalendar product into
-  your zope/Products directory or link it there, e.g.::
-
-    ln -s /path/to/installation /path/to/zope/Products
-
-  In the root of your CMFSite installation (within the ZMI):
-
-      1.  Add an external method to the root of the CMF Site.
-
-      2.  Use the following configuration values for the external
-          method:
-
-          o id: install_events
-
-          o title: Install Events *optional*
-
-          o module name: CMFCalendar.Install
-
-          o function name: install
-
-      3. Go to the management screen for the newly added external
-         method and click the 'Try it' tab.
-
-  The install function will execute and give information about the
-  steps it took to register and install the CMF Events into the CMF
-  Site instance.

Modified: CMF/trunk/CMFCalendar/README.txt
===================================================================
--- CMF/trunk/CMFCalendar/README.txt	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFCalendar/README.txt	2005-10-23 09:46:52 UTC (rev 39562)
@@ -17,9 +17,9 @@
   now accompanyied by the CMFCalendar which is fully functional
   and tested.
 
+  For installing set the 'active site configuration' of your site's
+  setup tool to the CMFCalendar profile and import all steps.
+
   After installing the CMFCalendar you should notice a calendar
   appear in your CMF.  This is fully customisable to your portals
   needs.
-
-  See the INSTALL.txt file for how to get the product installed
-  within your CMF.

Modified: CMF/trunk/CMFCalendar/__init__.py
===================================================================
--- CMF/trunk/CMFCalendar/__init__.py	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFCalendar/__init__.py	2005-10-23 09:46:52 UTC (rev 39562)
@@ -55,7 +55,6 @@
                      , content_types = contentClasses
                      , permission = AddPortalContent
                      , extra_constructors = contentConstructors
-                     , fti = Event.factory_type_information
                      ).initialize( context )
 
     profile_registry.registerProfile('default',

Modified: CMF/trunk/CMFCore/CMFBTreeFolder.py
===================================================================
--- CMF/trunk/CMFCore/CMFBTreeFolder.py	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFCore/CMFBTreeFolder.py	2005-10-23 09:46:52 UTC (rev 39562)
@@ -21,24 +21,8 @@
 from Products.BTreeFolder2.BTreeFolder2 import BTreeFolder2Base
 
 from PortalFolder import PortalFolderBase
-from PortalFolder import factory_type_information as PortalFolder_FTI
 
-_actions = PortalFolder_FTI[0]['actions']
 
-factory_type_information = ( { 'id'             : 'CMF BTree Folder',
-                               'meta_type'      : 'CMF BTree Folder',
-                               'description'    : """\
-CMF folder designed to hold a lot of objects.""",
-                               'icon'           : 'folder_icon.gif',
-                               'product'        : 'CMFCore',
-                               'factory'        : 'manage_addCMFBTreeFolder',
-                               'filter_content_types' : 0,
-                               'immediate_view' : 'folder_edit_form',
-                               'actions'        : _actions,
-                               },
-                           )
-
-
 def manage_addCMFBTreeFolder(dispatcher, id, title='', REQUEST=None):
     """Adds a new BTreeFolder object with id *id*.
     """
@@ -52,8 +36,10 @@
 
 
 class CMFBTreeFolder(BTreeFolder2Base, PortalFolderBase):
+
     """BTree folder for CMF sites.
     """
+
     meta_type = 'CMF BTree Folder'
     security = ClassSecurityInfo()
 
@@ -65,5 +51,4 @@
         PortalFolderBase._checkId(self, id, allow_dup)
         BTreeFolder2Base._checkId(self, id, allow_dup)
 
-
 InitializeClass(CMFBTreeFolder)

Modified: CMF/trunk/CMFCore/CatalogTool.py
===================================================================
--- CMF/trunk/CMFCore/CatalogTool.py	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFCore/CatalogTool.py	2005-10-23 09:46:52 UTC (rev 39562)
@@ -21,11 +21,6 @@
 from Globals import DTMLFile
 from Globals import InitializeClass
 from Products.ZCatalog.ZCatalog import ZCatalog
-from Products.ZCTextIndex.HTMLSplitter import HTMLWordSplitter
-from Products.ZCTextIndex.Lexicon import CaseNormalizer
-from Products.ZCTextIndex.Lexicon import Splitter
-from Products.ZCTextIndex.Lexicon import StopWordRemover
-from Products.ZCTextIndex.ZCTextIndex import PLexicon
 from zope.interface import implements
 
 from ActionProviderBase import ActionProviderBase
@@ -42,7 +37,6 @@
 from utils import _getAuthenticatedUser
 from utils import _mergedLocalRoles
 from utils import getToolByName
-from utils import SimpleRecord
 from utils import UniqueObject
 
 
@@ -102,97 +96,8 @@
 
     def __init__(self):
         ZCatalog.__init__(self, self.getId())
-        self._initIndexes()
 
     #
-    #   Subclass extension interface
-    #
-    security.declarePublic('enumerateIndexes') # Subclass can call
-    def enumerateIndexes(self):
-        #   Return a list of ( index_name, type, extra ) tuples for the initial
-        #   index set.
-        plaintext_extra = SimpleRecord( lexicon_id='plaintext_lexicon'
-                                      , index_type='Okapi BM25 Rank'
-                                      )
-        htmltext_extra = SimpleRecord( lexicon_id='htmltext_lexicon'
-                                     , index_type='Okapi BM25 Rank'
-                                     )
-
-        return ( ('Title', 'ZCTextIndex', plaintext_extra)
-               , ('Subject', 'KeywordIndex', None)
-               , ('Description', 'ZCTextIndex', plaintext_extra)
-               , ('listCreators', 'KeywordIndex', None)
-               , ('SearchableText', 'ZCTextIndex', htmltext_extra)
-               , ('Date', 'DateIndex', None)
-               , ('Type', 'FieldIndex', None)
-               , ('created', 'DateIndex', None)
-               , ('effective', 'DateIndex', None)
-               , ('expires', 'DateIndex', None)
-               , ('modified', 'DateIndex', None)
-               , ('allowedRolesAndUsers', 'KeywordIndex', None)
-               , ('review_state', 'FieldIndex', None)
-               , ('in_reply_to', 'FieldIndex', None)
-               , ('getId', 'FieldIndex', None)
-               , ('path', 'PathIndex', None)
-               , ('portal_type', 'FieldIndex', None)
-               )
-
-    security.declarePublic('enumerateLexicons')
-    def enumerateLexicons(self):
-        return (
-                 ( 'plaintext_lexicon'
-                 , Splitter()
-                 , CaseNormalizer()
-                 , StopWordRemover()
-                 )
-               , ( 'htmltext_lexicon'
-                 , HTMLWordSplitter()
-                 , CaseNormalizer()
-                 , StopWordRemover()
-                 )
-               )
-
-    security.declarePublic('enumerateColumns')
-    def enumerateColumns(self):
-        #   Return a sequence of schema names to be cached.
-        return ( 'Subject'
-               , 'Title'
-               , 'Description'
-               , 'Type'
-               , 'review_state'
-               , 'listCreators'
-               , 'Date'
-               , 'getIcon'
-               , 'created'
-               , 'effective'
-               , 'expires'
-               , 'modified'
-               , 'CreationDate'
-               , 'EffectiveDate'
-               , 'ExpirationDate'
-               , 'ModificationDate'
-               , 'getId'
-               , 'portal_type'
-               )
-
-    def _initIndexes(self):
-        # ZCTextIndex lexicons
-        for id, splitter, normalizer, sw_remover in self.enumerateLexicons():
-            lexicon = PLexicon(id, '', splitter, normalizer, sw_remover)
-            self._setObject(id, lexicon)
-
-        # Content indexes
-        self._catalog.indexes.clear()
-        for index_name, index_type, extra in self.enumerateIndexes():
-            self.addIndex(index_name, index_type, extra=extra)
-
-        # Cached metadata
-        self._catalog.names = ()
-        self._catalog.schema.clear()
-        for column_name in self.enumerateColumns():
-            self.addColumn(column_name)
-
-    #
     #   ZMI methods
     #
     security.declareProtected(ManagePortal, 'manage_overview')

Modified: CMF/trunk/CMFCore/PortalFolder.py
===================================================================
--- CMF/trunk/CMFCore/PortalFolder.py	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFCore/PortalFolder.py	2005-10-23 09:46:52 UTC (rev 39562)
@@ -37,7 +37,6 @@
 from interfaces.Folderish import Folderish as z2IFolderish
 from permissions import AddPortalContent
 from permissions import AddPortalFolders
-from permissions import ChangeLocalRoles
 from permissions import DeleteObjects
 from permissions import ListFolderContents
 from permissions import ManagePortal
@@ -47,61 +46,11 @@
 from utils import getToolByName
 
 
-factory_type_information = (
-  { 'id'             : 'Folder'
-  , 'meta_type'      : 'Portal Folder'
-  , 'description'    : """ Use folders to put content in categories."""
-  , 'icon'           : 'folder_icon.gif'
-  , 'product'        : 'CMFCore'
-  , 'factory'        : 'manage_addPortalFolder'
-  , 'filter_content_types' : 0
-  , 'immediate_view' : 'folder_edit_form'
-  , 'aliases'        : {'(Default)': 'index_html',
-                        'view': 'index_html',
-                        'index.html':'index_html'}
-  , 'actions'        : ( { 'id'            : 'view'
-                         , 'name'          : 'View'
-                         , 'action': 'string:${object_url}'
-                         , 'permissions'   : (View,)
-                         }
-                       , { 'id'            : 'edit'
-                         , 'name'          : 'Edit'
-                         , 'action': 'string:${object_url}/folder_edit_form'
-                         , 'permissions'   : (ManageProperties,)
-                         }
-                       , { 'id'            : 'localroles'
-                         , 'name'          : 'Local Roles'
-                         , 'action':
-                                  'string:${object_url}/folder_localrole_form'
-                         , 'permissions'   : (ChangeLocalRoles,)
-                         }
-                       , { 'id'            : 'folderContents'
-                         , 'name'          : 'Folder contents'
-                         , 'action': 'string:${object_url}/folder_contents'
-                         , 'permissions'   : (ListFolderContents,)
-                         }
-                       , { 'id'            : 'new'
-                         , 'name'          : 'New...'
-                         , 'action': 'string:${object_url}/folder_factories'
-                         , 'permissions'   : (AddPortalContent,)
-                         , 'visible'       : 0
-                         }
-                       , { 'id'            : 'rename_items'
-                         , 'name'          : 'Rename items'
-                         , 'action': 'string:${object_url}/folder_rename_form'
-                         , 'permissions'   : (AddPortalContent,)
-                         , 'visible'       : 0
-                         }
-                       )
-  }
-,
-)
-
-
 class PortalFolderBase(DynamicType, CMFCatalogAware, Folder):
 
     """Base class for portal folder
     """
+
     meta_type = 'Portal Folder Base'
 
     implements(IFolderish)

Modified: CMF/trunk/CMFCore/TypesTool.py
===================================================================
--- CMF/trunk/CMFCore/TypesTool.py	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFCore/TypesTool.py	2005-10-23 09:46:52 UTC (rev 39562)
@@ -754,76 +754,12 @@
     #
     #   other methods
     #
-    security.declareProtected(ManagePortal, 'listDefaultTypeInformation')
-    def listDefaultTypeInformation(self):
-        # Scans for factory_type_information attributes
-        # of all products and factory dispatchers within products.
-        res = []
-        products = self.aq_acquire('_getProducts')()
-        for product in products.objectValues():
-            product_id = product.getId()
-
-            if hasattr(aq_base(product), 'factory_type_information'):
-                ftis = product.factory_type_information
-            else:
-                package = getattr(Products, product_id, None)
-                dispatcher = getattr(package, '__FactoryDispatcher__', None)
-                ftis = getattr(dispatcher, 'factory_type_information', None)
-
-            if ftis is not None:
-                if callable(ftis):
-                    ftis = ftis()
-
-                for fti in ftis:
-                    mt = fti.get('meta_type', None)
-                    id = fti.get('id', '')
-
-                    if mt:
-                        p_id = '%s: %s (%s)' % (product_id, id, mt)
-                        res.append( (p_id, fti) )
-
-        return res
-
     security.declareProtected(ManagePortal, 'manage_addTypeInformation')
     def manage_addTypeInformation(self, add_meta_type, id=None,
                                   typeinfo_name=None, RESPONSE=None):
+        """Create a TypeInformation in self.
         """
-        Create a TypeInformation in self.
-        """
-        fti = None
-        if typeinfo_name:
-            info = self.listDefaultTypeInformation()
-
-            # Nasty orkaround to stay backwards-compatible
-            # This workaround will disappear in CMF 1.7
-            if typeinfo_name.endswith(')'):
-                # This is a new-style name. Proceed normally.
-                for (name, ft) in info:
-                    if name == typeinfo_name:
-                        fti = ft
-                        break
-            else:
-                # Attempt to work around the old way
-                # This attempt harbors the problem that the first match on
-                # meta_type will be used. There could potentially be more
-                # than one TypeInformation sharing the same meta_type.
-                warn('Please switch to the new format for typeinfo names '
-                     '\"product_id: type_id (meta_type)\", the old '
-                     'spelling will disappear in CMF 1.7', DeprecationWarning,
-                     stacklevel=2)
-
-                ti_prod, ti_mt = [x.strip() for x in typeinfo_name.split(':')]
-
-                for name, ft in info:
-                    if ( name.startswith(ti_prod) and
-                         name.endswith('(%s)' % ti_mt) ):
-                        fti = ft
-                        break
-
-            if fti is None:
-                raise BadRequest('%s not found.' % typeinfo_name)
-            if not id:
-                id = fti.get('id', None)
+        # BBB: typeinfo_name is ignored
         if not id:
             raise BadRequest('An id is required.')
         for mt in Products.meta_types:
@@ -834,13 +770,7 @@
             raise ValueError, (
                 'Meta type %s is not a type class.' % add_meta_type)
         id = str(id)
-        if fti is not None:
-            fti = fti.copy()
-            if fti.has_key('id'):
-                del fti['id']
-            ob = klass(id, **fti)
-        else:
-            ob = klass(id)
+        ob = klass(id)
         self._setObject(id, ob)
         if RESPONSE is not None:
             RESPONSE.redirect('%s/manage_main' % self.absolute_url())

Modified: CMF/trunk/CMFCore/__init__.py
===================================================================
--- CMF/trunk/CMFCore/__init__.py	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFCore/__init__.py	2005-10-23 09:46:52 UTC (rev 39562)
@@ -81,11 +81,7 @@
                       ,  CMFBTreeFolder.manage_addCMFBTreeFolder
                       )
 
-_FTI = ( PortalFolder.factory_type_information
-       + CMFBTreeFolder.factory_type_information
-       )
 
-
 # Because persistent objects may be out there which were
 # created when the module was in that product, we need
 # __module_aliases__ . 
@@ -189,7 +185,6 @@
                      , content_types=_CONTENT_TYPES
                      , permission=AddPortalFolders
                      , extra_constructors=_EXTRA_CONSTRUCTORS
-                     , fti=_FTI
                      ).initialize( context )
 
     # make registerHelp work with 2 directories

Modified: CMF/trunk/CMFCore/tests/test_CatalogTool.py
===================================================================
--- CMF/trunk/CMFCore/tests/test_CatalogTool.py	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFCore/tests/test_CatalogTool.py	2005-10-23 09:46:52 UTC (rev 39562)
@@ -91,6 +91,7 @@
             argument, 'idxs', to 'catalog_object'.
         """
         tool = self._makeOne()
+        tool.addIndex('SearchableText', 'KeywordIndex')
         dummy = DummyContent(catalog=1)
 
         tool.catalog_object( dummy, '/dummy' )
@@ -98,6 +99,7 @@
 
     def test_search_anonymous(self):
         catalog = self._makeOne()
+        catalog.addIndex('allowedRolesAndUsers', 'KeywordIndex')
         dummy = DummyContent(catalog=1)
         catalog.catalog_object(dummy, '/dummy')
 
@@ -106,6 +108,9 @@
 
     def test_search_inactive(self):
         catalog = self._makeOne()
+        catalog.addIndex('allowedRolesAndUsers', 'KeywordIndex')
+        catalog.addIndex('effective', 'DateIndex')
+        catalog.addIndex('expires', 'DateIndex')
         now = DateTime()
         dummy = DummyContent(catalog=1)
         dummy._View_Permission = ('Blob',)
@@ -128,6 +133,9 @@
 
     def test_search_restrict_manager(self):
         catalog = self._makeOne()
+        catalog.addIndex('allowedRolesAndUsers', 'KeywordIndex')
+        catalog.addIndex('effective', 'DateIndex')
+        catalog.addIndex('expires', 'DateIndex')
         now = DateTime()
         dummy = DummyContent(catalog=1)
 
@@ -159,6 +167,9 @@
 
     def test_search_restrict_inactive(self):
         catalog = self._makeOne()
+        catalog.addIndex('allowedRolesAndUsers', 'KeywordIndex')
+        catalog.addIndex('effective', 'DateIndex')
+        catalog.addIndex('expires', 'DateIndex')
         now = DateTime()
         dummy = DummyContent(catalog=1)
         dummy._View_Permission = ('Blob',)
@@ -189,6 +200,9 @@
 
     def test_search_restrict_visible(self):
         catalog = self._makeOne()
+        catalog.addIndex('allowedRolesAndUsers', 'KeywordIndex')
+        catalog.addIndex('effective', 'DateIndex')
+        catalog.addIndex('expires', 'DateIndex')
         now = DateTime()
         dummy = DummyContent(catalog=1)
         dummy._View_Permission = ('Blob',)

Modified: CMF/trunk/CMFCore/tests/test_PortalFolder.py
===================================================================
--- CMF/trunk/CMFCore/tests/test_PortalFolder.py	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFCore/tests/test_PortalFolder.py	2005-10-23 09:46:52 UTC (rev 39562)
@@ -444,6 +444,7 @@
 
         ttool = self.site._setObject( 'portal_types', TypesTool() )
         ctool = self.site._setObject( 'portal_catalog', CatalogTool() )
+        ctool.addIndex('getId', 'FieldIndex')
         self.assertEqual( len(ctool), 0 )
 
         folder = self._makeOne('folder')

Modified: CMF/trunk/CMFCore/tests/test_TypesTool.py
===================================================================
--- CMF/trunk/CMFCore/tests/test_TypesTool.py	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFCore/tests/test_TypesTool.py	2005-10-23 09:46:52 UTC (rev 39562)
@@ -144,56 +144,7 @@
             self.fail('CMF Collector issue #165 (Ownership bug): '
                       'Unauthorized raised' )
 
-    def test_CMFCollector_49(self):
-        #http://www.zope.org/Collectors/CMF/49
 
-        #If you have two FTIs on the file system, both with the same meta_type
-        #but with different id values, the way listDefaultTypeInformation
-        #listed them in the dropdown list made it impossible to distinguish
-        #the two because the identifier string only contained the CMF package
-        #name and the meta_type
-
-        # Extreme nastiness: Fake out a /Control_Panel/Products registry
-        # inside the fake site by putting dummy objects with a
-        # factory_type_information attribute on them...
-        import copy
-        fti1 = copy.deepcopy(FTIDATA_DUMMY)
-        fti2 = copy.deepcopy(FTIDATA_DUMMY)
-        fti2[0]['id'] = 'Other Content'
-        product1 = DummyObject('product1')
-        product1.factory_type_information = fti1 + fti2
-        self.site._setObject('product1', product1)
-        def fakeGetProducts(*ign, **igntoo):
-            return self.site
-        def fakeObjectValues(*ign, **igntoo):
-            return (self.site.product1,)
-        self.ttool._getProducts = fakeGetProducts
-        self.site.objectValues = fakeObjectValues
-
-        types = self.ttool.listDefaultTypeInformation()
-        dropdown_representation = [x[0] for x in types]
-        self.failIf(dropdown_representation[0]==dropdown_representation[1])
-
-        # Backwards-compatibility tests
-        # Make sure the old representation still works, for now
-        ti_factory = self.ttool.manage_addTypeInformation
-        ti_type = 'Factory-based Type Information'
-        new_repr = 'product1: Dummy Content (Dummy)'
-        old_repr = 'product1: Dummy'
-
-        # This one uses the new representation. We do not expect an Exception
-        ti_factory(ti_type, id='NewType1', typeinfo_name=new_repr)
-        self.failUnless('NewType1' in self.ttool.objectIds())
-
-        # Now try with the old representation, which will throw a BadRequest
-        # unless the workaround in the code is used
-        self._trap_warning_output()
-        ti_factory(ti_type, id='NewType2', typeinfo_name=old_repr)
-        self.failUnless('NewType2' in self.ttool.objectIds())
-        self.failUnless('DeprecationWarning' in
-                            self._our_stderr_stream.getvalue())
-
-
 class TypeInfoTests(TestCase):
 
     def _makeTypesTool(self):

Modified: CMF/trunk/CMFCore/utils.py
===================================================================
--- CMF/trunk/CMFCore/utils.py	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFCore/utils.py	2005-10-23 09:46:52 UTC (rev 39562)
@@ -594,11 +594,11 @@
                 , extra_constructors=()
                 , fti=()
                 ):
+        # BBB: fti argument is ignored
         self.meta_type = meta_type
         self.content_types = content_types
         self.permission = permission
         self.extra_constructors = extra_constructors
-        self.fti = fti
 
     def initialize(self, context):
         # Add only one meta type to the folder add list.
@@ -609,9 +609,7 @@
             # manage_addContentType() can then grab it.
             , constructors = ( manage_addContentForm
                                , manage_addContent
-                               , self
-                               , ('factory_type_information', self.fti)
-                               ) + self.extra_constructors
+                               , self ) + self.extra_constructors
             , permission = self.permission
             )
 

Modified: CMF/trunk/CMFDefault/DEPENDENCIES.txt
===================================================================
--- CMF/trunk/CMFDefault/DEPENDENCIES.txt	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFDefault/DEPENDENCIES.txt	2005-10-23 09:46:52 UTC (rev 39562)
@@ -1,5 +1,4 @@
 Zope >= 2.8.2
 Five >= 1.2
 CMFCore
-CMFTopic
 GenericSetup

Modified: CMF/trunk/CMFDefault/DiscussionItem.py
===================================================================
--- CMF/trunk/CMFDefault/DiscussionItem.py	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFDefault/DiscussionItem.py	2005-10-23 09:46:52 UTC (rev 39562)
@@ -40,34 +40,8 @@
 from utils import scrubHTML
 
 
-factory_type_information = (
-  { 'id'             : 'Discussion Item'
-  , 'meta_type'      : 'Discussion Item'
-  , 'description'    : """\
-Discussion Items are documents which reply to other content.
-They should *not* be addable through the standard 'folder_factories' interface.
-"""
-  , 'icon'           : 'discussionitem_icon.gif'
-  , 'product'        : '' # leave blank to suppress
-  , 'factory'        : ''
-  , 'immediate_view' : ''
-  , 'aliases'        : {'(Default)':'discussionitem_view',
-                        'view':'discussionitem_view'}
-  , 'actions'        : ( { 'id'            : 'view'
-                         , 'name'          : 'View'
-                         , 'action': 'string:${object_url}/discussionitem_view'
-                         , 'permissions'   : (View,)
-                         }
-                       ,
-                       )
-  }
-,
-)
-
-
 def addDiscussionItem(self, id, title, description, text_format, text,
                       reply_to, RESPONSE=None):
-
     """ Add a discussion item
 
     'title' is also used as the subject header
@@ -442,4 +416,4 @@
 
         return [ x[0] for x in result ]
 
-InitializeClass( DiscussionItemContainer )
+InitializeClass(DiscussionItemContainer)

Modified: CMF/trunk/CMFDefault/Document.py
===================================================================
--- CMF/trunk/CMFDefault/Document.py	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFDefault/Document.py	2005-10-23 09:46:52 UTC (rev 39562)
@@ -45,50 +45,18 @@
 from utils import parseHeadersBody
 from utils import SimpleHTMLParser
 
-factory_type_information = (
-  { 'id'             : 'Document'
-  , 'meta_type'      : 'Document'
-  , 'description'    : """\
-Documents contain text that can be formatted using 'Structured Text.'
-They may also contain HTML, or "plain" text.
-"""
-  , 'icon'           : 'document_icon.gif'
-  , 'product'        : 'CMFDefault'
-  , 'factory'        : 'addDocument'
-  , 'immediate_view' : 'metadata_edit_form'
-  , 'aliases'        : {'(Default)':'document_view',
-                        'view':'document_view',
-                        'gethtml':'source_html'}
-  , 'actions'        : ( { 'id'            : 'view'
-                         , 'name'          : 'View'
-                         , 'action': 'string:${object_url}/document_view'
-                         , 'permissions'   : (View,)
-                         }
-                       , { 'id'            : 'edit'
-                         , 'name'          : 'Edit'
-                         , 'action': 'string:${object_url}/document_edit_form'
-                         , 'permissions'   : (ModifyPortalContent,)
-                         }
-                       , { 'id'            : 'metadata'
-                         , 'name'          : 'Metadata'
-                         , 'action': 'string:${object_url}/metadata_edit_form'
-                         , 'permissions'   : (ModifyPortalContent,)
-                         }
-                       )
-  }
-,
-)
 
-def addDocument(self, id, title='', description='', text_format='',
-                text=''):
-    """ Add a Document """
+def addDocument(self, id, title='', description='', text_format='', text=''):
+    """Add a Document.
+    """
     o = Document(id, title, description, text_format, text)
     self._setObject(id,o)
 
 
 class Document(PortalContent, DefaultDublinCoreImpl):
 
-    """ A Document - Handles both StructuredText and HTML """
+    """A Document - Handles both StructuredText and HTML.
+    """
 
     implements(IDocument, IMutableDocument)
     __implements__ = (z2IDocument, z2IMutableDocument,

Modified: CMF/trunk/CMFDefault/Favorite.py
===================================================================
--- CMF/trunk/CMFDefault/Favorite.py	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFDefault/Favorite.py	2005-10-23 09:46:52 UTC (rev 39562)
@@ -23,47 +23,14 @@
 
 from Products.CMFCore.utils import getToolByName
 
-from permissions import View
-from permissions import ModifyPortalContent
 from DublinCore import DefaultDublinCoreImpl
 from Link import Link
+from permissions import View
 
-factory_type_information = (
-  { 'id'             : 'Favorite'
-  , 'meta_type'      : 'Favorite'
-  , 'description'    : """\
-A Favorite is a Link to an intra-portal resource.
-"""
-  , 'icon'           : 'link_icon.gif'
-  , 'product'        : 'CMFDefault'
-  , 'factory'        : 'addFavorite'
-  , 'immediate_view' : 'metadata_edit_form'
-  , 'aliases'        : {'(Default)':'favorite_view',
-                        'view':'favorite_view'}
-  , 'actions'        : ( { 'id'            : 'view'
-                         , 'name'          : 'View'
-                         , 'action': 'string:${object_url}/favorite_view'
-                         , 'permissions'   : ( View, )
-                         }
-                       , { 'id'            : 'edit'
-                         , 'name'          : 'Edit'
-                         , 'action': 'string:${object_url}/link_edit_form'
-                         , 'permissions'   : ( ModifyPortalContent, )
-                         }
-                       , { 'id'            : 'metadata'
-                         , 'name'          : 'Metadata'
-                         , 'action': 'string:${object_url}/metadata_edit_form'
-                         , 'permissions'   : ( ModifyPortalContent, )
-                         }
-                       )
-  }
-,
-)
 
 def addFavorite(self, id, title='', remote_url='', description=''):
+    """Add a Favorite.
     """
-    Add a Favorite
-    """
     portal_url = getToolByName(self, 'portal_url')
     portal_obj = portal_url.getPortalObject()
     content_obj = portal_obj.restrictedTraverse( remote_url )
@@ -73,10 +40,10 @@
     self._setObject(id,o)
 
 
-class Favorite( Link ):
+class Favorite(Link):
+
+    """A Favorite (special kind of Link).
     """
-        A Favorite (special kind of Link)
-    """
 
     __implements__ = Link.__implements__ # redundant, but explicit
 
@@ -215,5 +182,4 @@
         # save unique id of favorite
         self.remote_uid = self._getUidByUrl()
 
-
 InitializeClass(Favorite)

Modified: CMF/trunk/CMFDefault/File.py
===================================================================
--- CMF/trunk/CMFDefault/File.py	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFDefault/File.py	2005-10-23 09:46:52 UTC (rev 39562)
@@ -17,55 +17,17 @@
 $Id$
 """
 
+import OFS.Image
 from Globals import InitializeClass
 from AccessControl import ClassSecurityInfo
 
 from Products.CMFCore.PortalContent import PortalContent
 
 from DublinCore import DefaultDublinCoreImpl
-from permissions import View
 from permissions import ModifyPortalContent
+from permissions import View
 
 
-factory_type_information = (
-  { 'id'             : 'File'
-  , 'meta_type'      : 'Portal File'
-  , 'description'    : """\
-File objects can contain arbitrary downloadable files.
-"""
-  , 'icon'           : 'file_icon.gif'
-  , 'product'        : 'CMFDefault'
-  , 'factory'        : 'addFile'
-  , 'immediate_view' : 'metadata_edit_form'
-  , 'aliases'        : {'(Default)':'index_html',
-                        'view':'file_view'}
-  , 'actions'        : ( { 'id'            : 'view'
-                         , 'name'          : 'View'
-                         , 'action': 'string:${object_url}/file_view'
-                         , 'permissions'   : (View,)
-                         }
-                       , { 'id'            : 'download'
-                         , 'name'          : 'Download'
-                         , 'action': 'string:${object_url}'
-                         , 'permissions'   : (View,)
-                         }
-                       , { 'id'            : 'edit'
-                         , 'name'          : 'Edit'
-                         , 'action': 'string:${object_url}/file_edit_form'
-                         , 'permissions'   : (ModifyPortalContent,)
-                         }
-                       , { 'id'            : 'metadata'
-                         , 'name'          : 'Metadata'
-                         , 'action': 'string:${object_url}/metadata_edit_form'
-                         , 'permissions'   : (ModifyPortalContent,)
-                         }
-                       )
-  }
-,
-)
-
-import OFS.Image
-
 def addFile( self
            , id
            , title=''
@@ -109,9 +71,9 @@
           , PortalContent
           , DefaultDublinCoreImpl
           ):
+
+    """A Portal-managed File.
     """
-        A Portal-managed File
-    """
 
     # The order of base classes is very significant in this case.
     # Image.File does not store it's id in it's 'id' attribute.
@@ -259,6 +221,4 @@
         OFS.Image.File.PUT( self, REQUEST, RESPONSE )
         self.reindexObject()
 
-
 InitializeClass(File)
-

Modified: CMF/trunk/CMFDefault/Image.py
===================================================================
--- CMF/trunk/CMFDefault/Image.py	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFDefault/Image.py	2005-10-23 09:46:52 UTC (rev 39562)
@@ -16,49 +16,17 @@
 $Id$
 """
 
+import OFS.Image
 from Globals import InitializeClass
 from AccessControl import ClassSecurityInfo
 
 from Products.CMFCore.PortalContent import PortalContent
 
 from DublinCore import DefaultDublinCoreImpl
-from permissions import View
 from permissions import ModifyPortalContent
+from permissions import View
 
-factory_type_information = (
-  { 'id'             : 'Image'
-  , 'meta_type'      : 'Portal Image'
-  , 'description'    : """\
-Image objects can be embedded in Portal documents.
-"""
-  , 'icon'           : 'image_icon.gif'
-  , 'product'        : 'CMFDefault'
-  , 'factory'        : 'addImage'
-  , 'immediate_view' : 'metadata_edit_form'
-  , 'aliases'        : {'(Default)':'index_html',
-                        'view':'image_view'}
-  , 'actions'        : ( { 'id'            : 'view'
-                         , 'name'          : 'View'
-                         , 'action': 'string:${object_url}/image_view'
-                         , 'permissions'   : (View,)
-                         }
-                       , { 'id'            : 'edit'
-                         , 'name'          : 'Edit'
-                         , 'action': 'string:${object_url}/image_edit_form'
-                         , 'permissions'   : (ModifyPortalContent,)
-                         }
-                       , { 'id'            : 'metadata'
-                         , 'name'          : 'Metadata'
-                         , 'action': 'string:${object_url}/metadata_edit_form'
-                         , 'permissions'   : (ModifyPortalContent,)
-                         }
-                       )
-  }
-,
-)
 
-import OFS.Image
-
 def addImage( self
             , id
             , title=''
@@ -242,5 +210,3 @@
         self.reindexObject()
 
 InitializeClass(Image)
-
-

Modified: CMF/trunk/CMFDefault/Link.py
===================================================================
--- CMF/trunk/CMFDefault/Link.py	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFDefault/Link.py	2005-10-23 09:46:52 UTC (rev 39562)
@@ -17,10 +17,10 @@
 
 import urlparse
 
+import transaction
 from AccessControl import ClassSecurityInfo
 from Globals import DTMLFile
 from Globals import InitializeClass
-import transaction
 
 from Products.CMFCore.PortalContent import PortalContent
 from Products.CMFCore.utils import contributorsplitter
@@ -34,37 +34,6 @@
 from utils import formatRFC822Headers
 from utils import parseHeadersBody
 
-factory_type_information = (
-  { 'id'             : 'Link'
-  , 'meta_type'      : 'Link'
-  , 'description'    : """\
-Link items are annotated URLs.
-"""
-  , 'icon'           : 'link_icon.gif'
-  , 'product'        : 'CMFDefault'
-  , 'factory'        : 'addLink'
-  , 'immediate_view' : 'metadata_edit_form'
-  , 'aliases'        : {'(Default)':'link_view',
-                        'view':'link_view'}
-  , 'actions'        : ( { 'id'            : 'view'
-                         , 'name'          : 'View'
-                         , 'action': 'string:${object_url}/link_view'
-                         , 'permissions'   : (View,)
-                         }
-                       , { 'id'            : 'edit'
-                         , 'name'          : 'Edit'
-                         , 'action': 'string:${object_url}/link_edit_form'
-                         , 'permissions'   : (ModifyPortalContent,)
-                         }
-                       , { 'id'            : 'metadata'
-                         , 'name'          : 'Metadata'
-                         , 'action': 'string:${object_url}/metadata_edit_form'
-                         , 'permissions'   : (ModifyPortalContent,)
-                         }
-                       )
-  }
-,
-)
 
 def addLink( self
            , id
@@ -72,19 +41,16 @@
            , remote_url=''
            , description=''
            ):
+    """Add a Link instance to 'self'.
     """
-        Add a Link instance to 'self'.
-    """
     o=Link( id, title, remote_url, description )
     self._setObject(id,o)
 
 
-class Link( PortalContent
-          , DefaultDublinCoreImpl
-          ):
+class Link(PortalContent, DefaultDublinCoreImpl):
+
+    """A Link.
     """
-        A Link
-    """
 
     __implements__ = ( PortalContent.__implements__
                      , DefaultDublinCoreImpl.__implements__
@@ -229,4 +195,4 @@
         """
         return len(self.manage_FTPget())
 
-InitializeClass( Link )
+InitializeClass(Link)

Modified: CMF/trunk/CMFDefault/NewsItem.py
===================================================================
--- CMF/trunk/CMFDefault/NewsItem.py	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFDefault/NewsItem.py	2005-10-23 09:46:52 UTC (rev 39562)
@@ -22,39 +22,6 @@
 from permissions import ModifyPortalContent
 from permissions import View
 
-factory_type_information = (
-  { 'id'             : 'News Item'
-  , 'meta_type'      : 'News Item'
-  , 'description'    : """\
-News Items contain short text articles and carry a title as well as
-an optional description.
-"""
-  , 'icon'           : 'newsitem_icon.gif'
-  , 'product'        : 'CMFDefault'
-  , 'factory'        : 'addNewsItem'
-  , 'immediate_view' : 'metadata_edit_form'
-  , 'aliases'        : {'(Default)':'newsitem_view',
-                        'view':'newsitem_view',
-                        'gethtml':'source_html'}
-  , 'actions'        : ( { 'id'            : 'view'
-                         , 'name'          : 'View'
-                         , 'action': 'string:${object_url}/newsitem_view'
-                         , 'permissions'   : (View,)
-                         }
-                       , { 'id'            : 'edit'
-                         , 'name'          : 'Edit'
-                         , 'action': 'string:${object_url}/newsitem_edit_form'
-                         , 'permissions'   : (ModifyPortalContent,)
-                         }
-                       , { 'id'            : 'metadata'
-                         , 'name'          : 'Metadata'
-                         , 'action': 'string:${object_url}/metadata_edit_form'
-                         , 'permissions'   : (ModifyPortalContent,)
-                         }
-                       )
-  }
-,
-)
 
 def addNewsItem( self
                , id
@@ -63,9 +30,8 @@
                , text=''
                , text_format=''
                ):
+    """Add a NewsItem.
     """
-        Add a NewsItem
-    """
     o=NewsItem( id=id
               , title=title
               , description=description
@@ -75,10 +41,10 @@
     self._setObject(id, o)
 
 
-class NewsItem( Document ):
+class NewsItem(Document):
+
+    """A News Item.
     """
-        A News Item
-    """
 
     __implements__ = Document.__implements__  # redundant, but explicit
 
@@ -98,4 +64,4 @@
             self.setDescription( description )
         Document.edit( self, text_format, text )
 
-InitializeClass( NewsItem )
+InitializeClass(NewsItem)

Modified: CMF/trunk/CMFDefault/Portal.py
===================================================================
--- CMF/trunk/CMFDefault/Portal.py	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFDefault/Portal.py	2005-10-23 09:46:52 UTC (rev 39562)
@@ -15,57 +15,18 @@
 $Id$
 """
 
-from warnings import warn
-
 from Globals import InitializeClass
 
 from Products.CMFCore.PortalObject import PortalObjectBase
-from Products.CMFCore import PortalFolder
-from Products.CMFCore.TypesTool import FactoryTypeInformation
-from Products.CMFCore.utils import getToolByName
 
-# This SkinnedFolder import is a workaround for circular imports in CMFTopic
-import Products.CMFDefault.SkinnedFolder
-from Products.CMFTopic import Topic
-from Products.CMFTopic import topic_globals
-
 from DublinCore import DefaultDublinCoreImpl
 from permissions import AddPortalContent
 from permissions import AddPortalFolders
-from permissions import DeleteObjects
-from permissions import FTPAccess
 from permissions import ListPortalMembers
-from permissions import ListUndoableChanges
-from permissions import ManagePortal
-from permissions import ManageProperties
 from permissions import ReplyToItem
-from permissions import ReviewPortalContent
-from permissions import SetOwnPassword
-from permissions import SetOwnProperties
-from permissions import UndoChanges
 from permissions import View
-from permissions import ViewManagementScreens
 
-import Document
-import Image
-import File
-import Link
-import NewsItem
-import Favorite
-import DiscussionItem
-import SkinnedFolder
 
-factory_type_information = ( Document.factory_type_information
-                           + Image.factory_type_information
-                           + File.factory_type_information
-                           + Link.factory_type_information
-                           + NewsItem.factory_type_information
-                           + Favorite.factory_type_information
-                           + DiscussionItem.factory_type_information
-                           + SkinnedFolder.factory_type_information
-                           )
-
-
 class CMFSite(PortalObjectBase, DefaultDublinCoreImpl):
 
     """
@@ -106,201 +67,3 @@
         pass
 
 InitializeClass(CMFSite)
-
-
-class PortalGenerator:
-
-    klass = CMFSite
-
-    def setupTools(self, p):
-        """Set up initial tools"""
-
-        addCMFCoreTool = p.manage_addProduct['CMFCore'].manage_addTool
-        addCMFCoreTool('CMF Actions Tool', None)
-        addCMFCoreTool('CMF Catalog', None)
-        addCMFCoreTool('CMF Member Data Tool', None)
-        addCMFCoreTool('CMF Skins Tool', None)
-        addCMFCoreTool('CMF Types Tool', None)
-        addCMFCoreTool('CMF Undo Tool', None)
-        addCMFCoreTool('CMF URL Tool', None)
-        addCMFCoreTool('CMF Workflow Tool', None)
-
-        addCMFDefaultTool = p.manage_addProduct['CMFDefault'].manage_addTool
-        addCMFDefaultTool('Default Discussion Tool', None)
-        addCMFDefaultTool('Default Membership Tool', None)
-        addCMFDefaultTool('Default Registration Tool', None)
-        addCMFDefaultTool('Default Properties Tool', None)
-        addCMFDefaultTool('Default Metadata Tool', None)
-        addCMFDefaultTool('Default Syndication Tool', None)
-
-        # try to install CMFUid without raising exceptions if not available
-        try:
-            addCMFUidTool = p.manage_addProduct['CMFUid'].manage_addTool
-        except AttributeError:
-            pass
-        else:
-            addCMFUidTool('Unique Id Annotation Tool', None)
-            addCMFUidTool('Unique Id Generator Tool', None)
-            addCMFUidTool('Unique Id Handler Tool', None)
-
-    def setupMailHost(self, p):
-        p.manage_addProduct['MailHost'].manage_addMailHost(
-            'MailHost', smtp_host='localhost')
-
-    def setupUserFolder(self, p):
-        p.manage_addProduct['OFSP'].manage_addUserFolder()
-
-    def setupCookieAuth(self, p):
-        p.manage_addProduct['CMFCore'].manage_addCC(
-            id='cookie_authentication')
-
-    def setupMembersFolder(self, p):
-        PortalFolder.manage_addPortalFolder(p, 'Members')
-        p.Members.manage_addProduct['OFSP'].manage_addDTMLMethod(
-            'index_html', 'Member list', '<dtml-return roster>')
-
-    def setupRoles(self, p):
-        # Set up the suggested roles.
-        p.__ac_roles__ = ('Member', 'Reviewer',)
-
-    def setupPermissions(self, p):
-        # Set up some suggested role to permission mappings.
-        mp = p.manage_permission
-
-        mp(AddPortalContent,          ['Owner','Manager',],    1)
-        mp(AddPortalFolders,          ['Owner','Manager',],    1)
-        mp(ListPortalMembers,         ['Member','Manager',],   1)
-        mp(ListUndoableChanges,       ['Member','Manager',],   1)
-        mp(ReplyToItem,               ['Member','Manager',],   1)
-        mp(ReviewPortalContent,       ['Reviewer','Manager',], 1)
-        mp(SetOwnPassword,            ['Member','Manager',],   1)
-        mp(SetOwnProperties,          ['Member','Manager',],   1)
-
-        # Add some other permissions mappings that may be helpful.
-        mp(DeleteObjects,             ['Owner','Manager',],    1)
-        mp(FTPAccess,                 ['Owner','Manager',],    1)
-        mp(ManageProperties,          ['Owner','Manager',],    1)
-        mp(UndoChanges,               ['Owner','Manager',],    1)
-        mp(ViewManagementScreens,     ['Owner','Manager',],    1)
-
-    def setupDefaultSkins(self, p):
-        from Products.CMFCore.DirectoryView import addDirectoryViews
-        ps = getToolByName(p, 'portal_skins')
-        addDirectoryViews(ps, 'skins', globals())
-        addDirectoryViews(ps, 'skins', topic_globals)
-        ps.manage_addProduct['OFSP'].manage_addFolder(id='custom')
-        ps.addSkinSelection('Basic',
-            'custom, zpt_topic, zpt_content, zpt_generic,'
-            + 'zpt_control, Images',
-            make_default=1)
-        p.setupCurrentSkin()
-
-    def setupTypes(self, p, initial_types=factory_type_information):
-        tool = getToolByName(p, 'portal_types', None)
-        if tool is None:
-            return
-        for t in initial_types:
-            fti = FactoryTypeInformation(**t)
-            tool._setObject(t['id'], fti)
-
-    def setupMimetypes(self, p):
-        p.manage_addProduct[ 'CMFCore' ].manage_addRegistry()
-        reg = p.content_type_registry
-
-        reg.addPredicate( 'link', 'extension' )
-        reg.getPredicate( 'link' ).edit( extensions="url, link" )
-        reg.assignTypeName( 'link', 'Link' )
-
-        reg.addPredicate( 'news', 'extension' )
-        reg.getPredicate( 'news' ).edit( extensions="news" )
-        reg.assignTypeName( 'news', 'News Item' )
-
-        reg.addPredicate( 'document', 'major_minor' )
-        reg.getPredicate( 'document' ).edit( major="text", minor="" )
-        reg.assignTypeName( 'document', 'Document' )
-
-        reg.addPredicate( 'image', 'major_minor' )
-        reg.getPredicate( 'image' ).edit( major="image", minor="" )
-        reg.assignTypeName( 'image', 'Image' )
-
-        reg.addPredicate( 'file', 'major_minor' )
-        reg.getPredicate( 'file' ).edit( major="application", minor="" )
-        reg.assignTypeName( 'file', 'File' )
-
-    def setupWorkflow(self, p):
-        wftool = getToolByName(p, 'portal_workflow', None)
-        if wftool is None:
-            return
-        try:
-            from Products.DCWorkflow.Default \
-                    import createDefaultWorkflowClassic
-        except ImportError:
-            return
-        id = 'default_workflow'
-        wftool._setObject( id, createDefaultWorkflowClassic(id) )
-
-        #   These objects don't participate in workflow by default.
-        wftool.setChainForPortalTypes( ('Folder', 'Topic'), () )
-
-    def setup(self, p, create_userfolder):
-        self.setupTools(p)
-        self.setupMailHost(p)
-        if int(create_userfolder) != 0:
-            self.setupUserFolder(p)
-        self.setupCookieAuth(p)
-        self.setupMembersFolder(p)
-        self.setupRoles(p)
-        self.setupPermissions(p)
-        self.setupDefaultSkins(p)
-
-        #   SkinnedFolders are only for customization;
-        #   they aren't a default type.
-        default_types = tuple( filter( lambda x: x['id'] != 'Skinned Folder'
-                                     , factory_type_information ) )
-        self.setupTypes(p, default_types )
-
-        self.setupTypes(p, PortalFolder.factory_type_information)
-        self.setupTypes(p, Topic.factory_type_information)
-        self.setupMimetypes(p)
-        self.setupWorkflow(p)
-
-    def create(self, parent, id, create_userfolder):
-        id = str(id)
-        portal = self.klass(id=id)
-        parent._setObject(id, portal)
-        # Return the fully wrapped object.
-        p = parent.this()._getOb(id)
-        self.setup(p, create_userfolder)
-        return p
-
-    def setupDefaultProperties(self, p, title, description,
-                               email_from_address, email_from_name,
-                               validate_email, default_charset=''):
-        p._setProperty('email_from_address', email_from_address, 'string')
-        p._setProperty('email_from_name', email_from_name, 'string')
-        p._setProperty('validate_email', validate_email and 1 or 0, 'boolean')
-        p._setProperty('default_charset', default_charset, 'string')
-        p._setProperty('enable_permalink', 0, 'boolean')
-        p.title = title
-        p.description = description
-
-
-def manage_addCMFSite(self, id, title='Portal', description='',
-                         create_userfolder=1,
-                         email_from_address='postmaster at localhost',
-                         email_from_name='Portal Administrator',
-                         validate_email=0, default_charset='',
-                         RESPONSE=None):
-    """ Adds a portal instance.
-    """
-    warn('manage_addCMFSite() is deprecated and will be removed in CMF 1.7. '
-         'Please use addConfiguredSite() instead.',
-         DeprecationWarning)
-    gen = PortalGenerator()
-    id = id.strip()
-    p = gen.create(self, id, create_userfolder)
-    gen.setupDefaultProperties(p, title, description,
-                               email_from_address, email_from_name,
-                               validate_email, default_charset)
-    if RESPONSE is not None:
-        RESPONSE.redirect(p.absolute_url() + '/finish_portal_construction')

Modified: CMF/trunk/CMFDefault/SkinnedFolder.py
===================================================================
--- CMF/trunk/CMFDefault/SkinnedFolder.py	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFDefault/SkinnedFolder.py	2005-10-23 09:46:52 UTC (rev 39562)
@@ -22,61 +22,15 @@
 from Products.CMFCore.PortalFolder import PortalFolder
 
 from DublinCore import DefaultDublinCoreImpl
-from permissions import AddPortalContent
-from permissions import ListFolderContents
-from permissions import ManageProperties
 from permissions import ModifyPortalContent
 from permissions import View
 
-factory_type_information = (
-  { 'id'             : 'Skinned Folder'
-  , 'meta_type'      : 'Skinned Folder'
-  , 'description'    : """\
-Skinned folders can define custom 'view' actions.
-"""
-  , 'icon'           : 'folder_icon.gif'
-  , 'product'        : 'CMFDefault'
-  , 'factory'        : 'addSkinnedFolder'
-  , 'filter_content_types' : 0
-  , 'immediate_view' : 'folder_edit_form'
-  , 'aliases'        : {'(Default)': 'folder_view',
-                        'view': 'folder_view'}
-  , 'actions'        : ( { 'id'            : 'view'
-                         , 'name'          : 'View'
-                         , 'action': 'string:${object_url}/folder_view'
-                         , 'permissions'   : (View,)
-                         }
-                       , { 'id'            : 'edit'
-                         , 'name'          : 'Edit'
-                         , 'action': 'string:${object_url}/folder_edit_form'
-                         , 'permissions'   : (ManageProperties,)
-                         }
-                       , { 'id'            : 'folderContents'
-                         , 'name'          : 'Folder contents'
-                         , 'action': 'string:${object_url}/folder_contents'
-                         , 'permissions'   : (ListFolderContents,)
-                         }
-                       , { 'id'            : 'new'
-                         , 'name'          : 'New...'
-                         , 'action': 'string:${object_url}/folder_factories'
-                         , 'permissions'   : (AddPortalContent,)
-                         , 'visible'       : 0
-                         }
-                       , { 'id'            : 'rename_items'
-                         , 'name'          : 'Rename items'
-                         , 'action': 'string:${object_url}/folder_rename_form'
-                         , 'permissions'   : (AddPortalContent,)
-                         , 'visible'       : 0
-                         }
-                       )
-  }
-,
-)
 
-
 class SkinnedFolder(CMFCatalogAware, PortalFolder):
+
     """ Skinned Folder class. 
     """
+
     meta_type = 'Skinned Folder'
 
     security = ClassSecurityInfo()
@@ -104,7 +58,7 @@
 
     # We derive from CMFCatalogAware first, so we are cataloged too.
 
-InitializeClass( SkinnedFolder )
+InitializeClass(SkinnedFolder)
 
 
 def addSkinnedFolder( self, id, title='', description='', REQUEST=None ):

Modified: CMF/trunk/CMFDefault/__init__.py
===================================================================
--- CMF/trunk/CMFDefault/__init__.py	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFDefault/__init__.py	2005-10-23 09:46:52 UTC (rev 39562)
@@ -107,7 +107,6 @@
                , content_types=contentClasses
                , permission=AddPortalContent
                , extra_constructors=contentConstructors
-               , fti=Portal.factory_type_information
                ).initialize( context )
 
     profile_registry.registerProfile('default',
@@ -126,8 +125,7 @@
 
     context.registerClass( Portal.CMFSite
                          , constructors=(factory.addConfiguredSiteForm,
-                                         factory.addConfiguredSite,
-                                         Portal.manage_addCMFSite)
+                                         factory.addConfiguredSite)
                          , icon='images/portal.gif'
                          )
 

Modified: CMF/trunk/CMFDefault/setuphandlers.py
===================================================================
--- CMF/trunk/CMFDefault/setuphandlers.py	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFDefault/setuphandlers.py	2005-10-23 09:46:52 UTC (rev 39562)
@@ -18,11 +18,10 @@
 from Products.CMFCore.utils import getToolByName
 
 from exceptions import BadRequest
-from Portal import PortalGenerator
 
 
 def importVarious(context):
-    """ Import various settings from PortalGenerator.
+    """ Import various settings.
 
     This provisional handler will be removed again as soon as full handlers
     are implemented for these steps.
@@ -36,8 +35,9 @@
     except BadRequest:
         return 'Various settings: Nothing to import.'
 
-    gen = PortalGenerator()
-    gen.setupUserFolder(site)
-    gen.setupMembersFolder(site)
+    site.manage_addProduct['OFSP'].manage_addUserFolder()
+    site.manage_addPortalFolder('Members')
+    site.Members.manage_addProduct['OFSP'].manage_addDTMLMethod('index_html',
+                                        'Member list', '<dtml-return roster>')
 
     return 'Various settings from PortalGenerator imported.'

Deleted: CMF/trunk/CMFTopic/README.txt
===================================================================
--- CMF/trunk/CMFTopic/README.txt	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFTopic/README.txt	2005-10-23 09:46:52 UTC (rev 39562)
@@ -1,21 +0,0 @@
-Updating CMF Topic in a CMF Site
-
-  Since default settings may change from time to time in CMF Topic,
-  you may need to update your Topic types tool (and other) settings.
-  This is done similarly to installing by adding an External Method
-  to your CMF Site instance with the following configuration::
-
-    **id** -- 'update_topic'
-    **title** -- *Update Topic*
-    **module name** -- 'CMFTopic.Update'
-    **function name** -- 'update'
-
-  Go to the management screen for the newly added external method and
-  click the 'Try it' tab.  The update function will execute and give
-  information about the steps it took to register and update CMF Topic 
-  site information.
-
-  *Note: This update script should **only** change values that are
-  still at their default, such as changing an action from 'topic_edit' 
-  to 'topic_edit_form'.  If you changed that action to 'mytopic_edit', 
-  the script should pass that by and not change your settings.*

Modified: CMF/trunk/CMFTopic/Topic.py
===================================================================
--- CMF/trunk/CMFTopic/Topic.py	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFTopic/Topic.py	2005-10-23 09:46:52 UTC (rev 39562)
@@ -22,65 +22,12 @@
 from Products.CMFDefault.SkinnedFolder import SkinnedFolder
 from Products.CMFCore.utils import getToolByName
 
-from permissions import ListFolderContents
 from permissions import View
 from permissions import AddTopics
 from permissions import ChangeTopics
 
 
-# Factory type information -- makes Topic objects play nicely
-# with the Types Tool (portal_types )
-factory_type_information = (
-  { 'id'             : 'Topic'
-  , 'icon'           : 'topic_icon.gif'
-  , 'meta_type'      : 'Portal Topic'
-  , 'description'    : 'Topics are canned queries for organizing content '
-                       'with up to date queries into the catalog.'
-  , 'product'        : 'CMFTopic'
-  , 'factory'        : 'addTopic'
-  , 'immediate_view' : 'topic_edit_form'
-  , 'allowed_content_types': ('Topic',)
-  , 'aliases'        : {'(Default)': 'topic_view',
-                        'view': 'topic_view'}
-  , 'actions'        : ( { 'id'            : 'view'
-                         , 'name'          : 'View'
-                         , 'action': 'string:${object_url}/topic_view'
-                         , 'permissions'   : (View,)
-                         }
-                       , { 'id'            : 'edit'
-                         , 'name'          : 'Edit'
-                         , 'action': 'string:${object_url}/topic_edit_form'
-                         , 'permissions'   : (ChangeTopics,)
-                         }
-                       , { 'id'            : 'criteria'
-                         , 'name'          : 'Criteria'
-                         , 'action': 'string:${object_url}/topic_criteria_form'
-                         , 'permissions'   : (ChangeTopics,)
-                         }
-                       , { 'id'            : 'folderContents'
-                         , 'name'          : 'Subtopics'
-                         , 'action': 'string:${object_url}/folder_contents'
-                         , 'permissions'   : (ListFolderContents,)
-                         }
-                       , { 'id'            : 'new'
-                         , 'name'          : 'New...'
-                         , 'action': 'string:${object_url}/folder_factories'
-                         , 'permissions'   : (AddTopics,)
-                         , 'visible'       : 0
-                         }
-                       , { 'id'            : 'rename_items'
-                         , 'name'          : 'Rename items'
-                         , 'action': 'string:${object_url}/folder_rename_form'
-                         , 'permissions'   : (AddTopics,)
-                         , 'visible'       : 0
-                         }
-                       )
-  }
-,
-)
-
 def addTopic( self, id, title='', REQUEST=None ):
-
     """ Create an empty topic.
     """
     topic = Topic( id )
@@ -92,7 +39,7 @@
         REQUEST['RESPONSE'].redirect( 'manage_main' )
 
 
-class Topic( SkinnedFolder ):
+class Topic(SkinnedFolder):
 
     """ Topics are 'canned queries'
     
@@ -287,4 +234,4 @@
         """
         return "%s %s" % (self.title, self.description) 
 
-InitializeClass( Topic )
+InitializeClass(Topic)

Modified: CMF/trunk/CMFTopic/__init__.py
===================================================================
--- CMF/trunk/CMFTopic/__init__.py	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFTopic/__init__.py	2005-10-23 09:46:52 UTC (rev 39562)
@@ -57,7 +57,6 @@
                , content_types = (Topic.Topic,)
                , permission = AddTopics
                , extra_constructors = (Topic.addTopic,)
-               , fti = Topic.factory_type_information
                ).initialize( context )
 
     profile_registry.registerProfile('default',

Modified: CMF/trunk/CMFTopic/tests/test_DateC.py
===================================================================
--- CMF/trunk/CMFTopic/tests/test_DateC.py	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFTopic/tests/test_DateC.py	2005-10-23 09:46:52 UTC (rev 39562)
@@ -20,7 +20,10 @@
 import Zope2
 Zope2.startup()
 
+import Products
 from DateTime.DateTime import DateTime
+from Products.Five import zcml
+from zope.app.tests.placelesssetup import PlacelessSetup
 
 from Products.CMFCore.tests.base.testcase import RequestTest
 from Products.CMFCore.tests.base.dummy import DummyContent
@@ -149,7 +152,7 @@
         self.assertEqual( expect_now.Date(), DateTime().Date() )
         self.assertEqual( result[0][1]['range'], 'min:max' )
 
-class FriendlyDateCriterionFunctionalTests(RequestTest):
+class FriendlyDateCriterionFunctionalTests(PlacelessSetup, RequestTest):
     # Test the date criterion using a "real CMF" with catalog etc.
     selectable_diffs = [0, 1, 2, 5, 7, 14, 31, 93, 186, 365, 730]
     nonzero_diffs = [1, 2, 5, 7, 14, 31, 93, 186, 365, 730]
@@ -157,7 +160,12 @@
     day_diffs.extend(selectable_diffs)
 
     def setUp(self):
+        PlacelessSetup.setUp(self)
         RequestTest.setUp(self)
+        zcml.load_config('meta.zcml', Products.Five)
+        zcml.load_config('configure.zcml', Products.GenericSetup)
+        zcml.load_config('configure.zcml', Products.CMFCore)
+
         factory = self.root.manage_addProduct['CMFDefault'].addConfiguredSite
         factory('site', 'CMFDefault:default', snapshot=False)
         self.site = self.root.site
@@ -179,6 +187,9 @@
             dummy_ob.modified_date = self.now + i
             dummy_ob.reindexObject()
 
+    def tearDown(self):
+        RequestTest.tearDown(self)
+        PlacelessSetup.tearDown(self)
 
     def test_Harness(self):
         # Make sure the test harness is set up OK

Modified: CMF/trunk/CMFTopic/tests/test_Topic.py
===================================================================
--- CMF/trunk/CMFTopic/tests/test_Topic.py	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFTopic/tests/test_Topic.py	2005-10-23 09:46:52 UTC (rev 39562)
@@ -26,7 +26,6 @@
 from Products.CMFCore.tests.base.testcase import SecurityTest
 from Products.CMFCore.TypesTool import FactoryTypeInformation as FTI
 from Products.CMFCore.TypesTool import TypesTool
-from Products.CMFTopic.Topic import factory_type_information as FTIDATA_TOPIC
 
 
 class FauxBrain( Implicit ):
@@ -198,8 +197,8 @@
 
     def test_Nested( self ):
         self.site._setObject( 'portal_types', TypesTool() )
-        fti = FTIDATA_TOPIC[0].copy()
-        self.site.portal_types._setObject( 'Topic', FTI(**fti) )
+        self.site.portal_types._setObject('Topic', FTI(id='Topic',
+                                      product='CMFTopic', factory='addTopic'))
         topic = self._makeOne('top')
         topic._setPortalTypeName('Topic')
 

Modified: CMF/trunk/CMFUid/tests/test_uidhandling.py
===================================================================
--- CMF/trunk/CMFUid/tests/test_uidhandling.py	2005-10-22 16:23:03 UTC (rev 39561)
+++ CMF/trunk/CMFUid/tests/test_uidhandling.py	2005-10-23 09:46:52 UTC (rev 39562)
@@ -24,13 +24,6 @@
 from Products.CMFCore.tests.base.testcase import SecurityTest
 
 
-def removeUnnecessaryIndexes(catalog):
-    indexes = [id[0] for id in catalog.enumerateIndexes()]
-    columns = catalog.enumerateColumns()
-    catalog.manage_delIndex(indexes)
-    catalog.manage_delColumn(columns)
-
-
 class DummyUid:
     """A dummy uid that surely is of different type of the generated ones.
     """
@@ -58,8 +51,6 @@
         self.root._setObject('dummy', DummyContent(id='dummy'))
         self.root._setObject('dummy2', DummyContent(id='dummy2'))
 
-        removeUnnecessaryIndexes(self.root.portal_catalog)
-
     def test_z3interfaces(self):
         from zope.interface.verify import verifyClass
         from Products.CMFUid.interfaces import IUniqueIdBrainQuery



More information about the CMF-checkins mailing list