[CMF-checkins] SVN: CMF/branches/2.0/CMF merged r67928:r67932 from trunk:

Yvo Schubbe y.2006_ at wcm-solutions.de
Wed May 3 11:29:25 EDT 2006


Log message for revision 67934:
  merged r67928:r67932 from trunk:
  - TI add view: ignore non-XML files
  - BatchViewBase: added hook for navigation vars (they might be different than hidden vars)
  - some minor i18n tweaking
  - moved ITopic to the standard location, added IMutableTopic
  - CMFTopic: minor profile changes
  - related cleanup

Changed:
  U   CMF/branches/2.0/CMFCore/browser/typeinfo.py
  U   CMF/branches/2.0/CMFDefault/browser/templates/batch_widgets.pt
  U   CMF/branches/2.0/CMFDefault/browser/templates/form_widgets.pt
  U   CMF/branches/2.0/CMFDefault/browser/utils.py
  U   CMF/branches/2.0/CMFDefault/locales/cmf_default-manual.pot
  U   CMF/branches/2.0/CMFDefault/locales/cmf_default.pot
  U   CMF/branches/2.0/CMFDefault/skins/zpt_generic/batch_widgets.pt
  U   CMF/branches/2.0/CMFDefault/skins/zpt_generic/form_widgets.pt
  U   CMF/branches/2.0/CMFTopic/Topic.py
  UU  CMF/branches/2.0/CMFTopic/configure.zcml
  U   CMF/branches/2.0/CMFTopic/interfaces/__init__.py
  UU  CMF/branches/2.0/CMFTopic/profiles/default/types/Topic.xml
  U   CMF/branches/2.0/CMFTopic/tests/test_Topic.py

-=-
Modified: CMF/branches/2.0/CMFCore/browser/typeinfo.py
===================================================================
--- CMF/branches/2.0/CMFCore/browser/typeinfo.py	2006-05-03 15:07:59 UTC (rev 67933)
+++ CMF/branches/2.0/CMFCore/browser/typeinfo.py	2006-05-03 15:29:25 UTC (rev 67934)
@@ -44,6 +44,9 @@
                 context = stool._getImportContext(info['id'])
                 file_ids = context.listDirectory('types')
                 for file_id in file_ids or ():
+                    if not file_id.endswith('.xml'):
+                        continue
+
                     filename = 'types/%s' % file_id
                     body = context.readDataFile(filename)
                     if body is None:

Modified: CMF/branches/2.0/CMFDefault/browser/templates/batch_widgets.pt
===================================================================
--- CMF/branches/2.0/CMFDefault/browser/templates/batch_widgets.pt	2006-05-03 15:07:59 UTC (rev 67933)
+++ CMF/branches/2.0/CMFDefault/browser/templates/batch_widgets.pt	2006-05-03 15:29:25 UTC (rev 67934)
@@ -1,7 +1,7 @@
 <html>
 <body>
 
- <metal:macro metal:define-macro="summary"
+ <metal:macro metal:define-macro="summary" i18n:domain="cmf_default"
  ><p class="BatchSummary" tal:condition="view/summary_length"
      i18n:translate="">Found <span tal:replace="view/summary_length"
       i18n:name="count">N</span> <span i18n:name="type"><span tal:omit-tag=""
@@ -13,7 +13,7 @@
      i18n:translate="">There are no items matching your specified criteria.</p
 ></metal:macro>
 
- <metal:macro metal:define-macro="listing">
+ <metal:macro metal:define-macro="listing" i18n:domain="cmf_default">
  <p class="BatchListing" tal:repeat="item_info view/listItemInfos"
  ><a href="" tal:attributes="href item_info/url"
   ><img src="" alt="" title="" border="0" width="16" height="16"

Modified: CMF/branches/2.0/CMFDefault/browser/templates/form_widgets.pt
===================================================================
--- CMF/branches/2.0/CMFDefault/browser/templates/form_widgets.pt	2006-05-03 15:07:59 UTC (rev 67933)
+++ CMF/branches/2.0/CMFDefault/browser/templates/form_widgets.pt	2006-05-03 15:29:25 UTC (rev 67934)
@@ -1,13 +1,13 @@
 <html>
 <body>
 
-<metal:macro metal:define-macro="hidden_vars">
+<metal:macro metal:define-macro="hidden_vars" i18n:domain="cmf_default">
  <tal:loop tal:repeat="hidden_var view/listHiddenVarInfos"
  ><input type="hidden" name="HiddenVarName" value=""
      tal:attributes="name hidden_var/name; value hidden_var/value" /></tal:loop
 ></metal:macro>
 
- <metal:macro metal:define-macro="buttons"
+ <metal:macro metal:define-macro="buttons" i18n:domain="cmf_default"
 ><div class="FormButtons">
   <tal:loop tal:repeat="button view/listButtonInfos"
   ><input type="submit" name="ButtonName" value="ButtonValue"

Modified: CMF/branches/2.0/CMFDefault/browser/utils.py
===================================================================
--- CMF/branches/2.0/CMFDefault/browser/utils.py	2006-05-03 15:07:59 UTC (rev 67933)
+++ CMF/branches/2.0/CMFDefault/browser/utils.py	2006-05-03 15:29:25 UTC (rev 67934)
@@ -208,9 +208,13 @@
         return {}
 
     @memoize
+    def _getNavigationVars(self):
+        return self._getHiddenVars()
+
+    @memoize
     def _getNavigationURL(self, b_start):
         target = self._getViewURL()
-        kw = self._getHiddenVars()
+        kw = self._getNavigationVars().copy()
 
         kw['b_start'] = b_start
         for k, v in kw.items():

Modified: CMF/branches/2.0/CMFDefault/locales/cmf_default-manual.pot
===================================================================
--- CMF/branches/2.0/CMFDefault/locales/cmf_default-manual.pot	2006-05-03 15:07:59 UTC (rev 67933)
+++ CMF/branches/2.0/CMFDefault/locales/cmf_default-manual.pot	2006-05-03 15:29:25 UTC (rev 67934)
@@ -1,6 +1,3 @@
-msgid "Found ${count} ${type} matching '${text}'."
-msgstr ""
-
 msgid "Found ${count} ${type}."
 msgstr ""
 

Modified: CMF/branches/2.0/CMFDefault/locales/cmf_default.pot
===================================================================
--- CMF/branches/2.0/CMFDefault/locales/cmf_default.pot	2006-05-03 15:07:59 UTC (rev 67933)
+++ CMF/branches/2.0/CMFDefault/locales/cmf_default.pot	2006-05-03 15:29:25 UTC (rev 67934)
@@ -339,6 +339,60 @@
 msgid "News Item changed."
 msgstr ""
 
+#: CMFDefault/browser/templates/batch_widgets.pt:10
+#: CMFDefault/skins/zpt_generic/batch_widgets.pt:17
+msgid "Found ${count} ${type} matching '${text}'."
+msgstr ""
+
+#: CMFDefault/browser/templates/batch_widgets.pt:12
+#: CMFDefault/skins/zpt_generic/batch_widgets.pt:19
+#: CMFDefault/skins/zpt_generic/review.pt:100
+msgid "There are no items matching your specified criteria."
+msgstr ""
+
+#: CMFDefault/browser/templates/batch_widgets.pt:7
+#: CMFDefault/browser/templates/batch_widgets.pt:19
+#: CMFDefault/browser/templates/batch_widgets.pt:19
+#: CMFDefault/browser/templates/batch_widgets.pt:30
+#: CMFDefault/browser/templates/folder_contents.pt:42
+#: CMFDefault/browser/templates/form_widgets.pt:13
+#: CMFDefault/skins/zpt_content/content_status_history.pt:25
+#: CMFDefault/skins/zpt_content/content_status_history.pt:32
+#: CMFDefault/skins/zpt_content/transition_form.pt:26
+#: CMFDefault/skins/zpt_content/transition_form.pt:56
+#: CMFDefault/skins/zpt_generic/batch_widgets.pt:14
+#: CMFDefault/skins/zpt_generic/batch_widgets.pt:34
+#: CMFDefault/skins/zpt_generic/batch_widgets.pt:34
+#: CMFDefault/skins/zpt_generic/batch_widgets.pt:45
+#: CMFDefault/skins/zpt_generic/folder_contents_template.pt:46
+#: CMFDefault/skins/zpt_generic/folder_factories_template.pt:21
+#: CMFDefault/skins/zpt_generic/folder_factories_template.pt:26
+#: CMFDefault/skins/zpt_generic/folder_filter_form.pt:51
+#: CMFDefault/skins/zpt_generic/folder_rename_template.pt:17
+#: CMFDefault/skins/zpt_generic/form_widgets.pt:22
+#: CMFDefault/skins/zpt_generic/index_html_utils.html:32
+#: CMFDefault/skins/zpt_generic/index_html_utils.html:32
+#: CMFDefault/skins/zpt_generic/index_html_utils.html:70
+#: CMFDefault/skins/zpt_generic/index_html_utils.html:70
+#: CMFDefault/skins/zpt_generic/index_html_utils.html:106
+#: CMFDefault/skins/zpt_generic/index_html_utils.html:106
+#: CMFDefault/skins/zpt_generic/join_template.pt:5
+#: CMFDefault/skins/zpt_generic/main_template.pt:71
+#: CMFDefault/skins/zpt_generic/main_template.pt:118
+#: CMFDefault/skins/zpt_generic/main_template.pt:157
+#: CMFDefault/skins/zpt_generic/main_template.pt:175
+#: CMFDefault/skins/zpt_generic/main_template.pt:201
+#: CMFDefault/skins/zpt_generic/main_template.pt:207
+#: CMFDefault/skins/zpt_generic/main_template.pt:221
+#: CMFDefault/skins/zpt_generic/main_template.pt:235
+#: CMFDefault/skins/zpt_generic/main_template.pt:269
+#: CMFDefault/skins/zpt_generic/review.pt:55
+#: CMFDefault/skins/zpt_generic/roster.pt:43
+#: CMFDefault/skins/zpt_generic/search_results_template.pt:35
+#: CMFDefault/skins/zpt_generic/synPropertiesForm_template.pt:66
+msgid "${DYNAMIC_CONTENT}"
+msgstr ""
+
 #: CMFDefault/browser/templates/document_edit.pt:13
 #: CMFDefault/browser/templates/link_edit.pt:12
 #: CMFDefault/browser/templates/metadata_edit.pt:34
@@ -438,39 +492,6 @@
 msgid "Root"
 msgstr ""
 
-#: CMFDefault/browser/templates/folder_contents.pt:42
-#: CMFDefault/skins/zpt_content/content_status_history.pt:25
-#: CMFDefault/skins/zpt_content/content_status_history.pt:32
-#: CMFDefault/skins/zpt_content/transition_form.pt:26
-#: CMFDefault/skins/zpt_content/transition_form.pt:56
-#: CMFDefault/skins/zpt_generic/folder_contents_template.pt:46
-#: CMFDefault/skins/zpt_generic/folder_factories_template.pt:21
-#: CMFDefault/skins/zpt_generic/folder_factories_template.pt:26
-#: CMFDefault/skins/zpt_generic/folder_filter_form.pt:51
-#: CMFDefault/skins/zpt_generic/folder_rename_template.pt:17
-#: CMFDefault/skins/zpt_generic/index_html_utils.html:32
-#: CMFDefault/skins/zpt_generic/index_html_utils.html:32
-#: CMFDefault/skins/zpt_generic/index_html_utils.html:70
-#: CMFDefault/skins/zpt_generic/index_html_utils.html:70
-#: CMFDefault/skins/zpt_generic/index_html_utils.html:106
-#: CMFDefault/skins/zpt_generic/index_html_utils.html:106
-#: CMFDefault/skins/zpt_generic/join_template.pt:5
-#: CMFDefault/skins/zpt_generic/main_template.pt:71
-#: CMFDefault/skins/zpt_generic/main_template.pt:118
-#: CMFDefault/skins/zpt_generic/main_template.pt:157
-#: CMFDefault/skins/zpt_generic/main_template.pt:175
-#: CMFDefault/skins/zpt_generic/main_template.pt:201
-#: CMFDefault/skins/zpt_generic/main_template.pt:207
-#: CMFDefault/skins/zpt_generic/main_template.pt:221
-#: CMFDefault/skins/zpt_generic/main_template.pt:235
-#: CMFDefault/skins/zpt_generic/main_template.pt:269
-#: CMFDefault/skins/zpt_generic/review.pt:55
-#: CMFDefault/skins/zpt_generic/roster.pt:43
-#: CMFDefault/skins/zpt_generic/search_results_template.pt:35
-#: CMFDefault/skins/zpt_generic/synPropertiesForm_template.pt:66
-msgid "${DYNAMIC_CONTENT}"
-msgstr ""
-
 #: CMFDefault/browser/templates/folder_contents.pt:5
 #: CMFDefault/skins/zpt_generic/folder_contents_template.pt:5
 msgid "Folder Contents: ${obj_title}"
@@ -596,30 +617,30 @@
 msgid "Body"
 msgstr ""
 
-#: CMFDefault/browser/utils.py:265
+#: CMFDefault/browser/utils.py:269
 msgid "Previous item"
 msgstr ""
 
-#: CMFDefault/browser/utils.py:267
+#: CMFDefault/browser/utils.py:271
 # Default: ""
 msgid "Previous ${count} items"
 msgstr ""
 
-#: CMFDefault/browser/utils.py:279
+#: CMFDefault/browser/utils.py:283
 msgid "Next item"
 msgstr ""
 
-#: CMFDefault/browser/utils.py:281
+#: CMFDefault/browser/utils.py:285
 # Default: ""
 msgid "Next ${count} items"
 msgstr ""
 
-#: CMFDefault/browser/utils.py:292
+#: CMFDefault/browser/utils.py:296
 #: CMFDefault/skins/zpt_generic/search.py:47
 msgid "item"
 msgstr ""
 
-#: CMFDefault/browser/utils.py:292
+#: CMFDefault/browser/utils.py:296
 #: CMFDefault/skins/zpt_generic/search.py:47
 msgid "items"
 msgstr ""
@@ -1720,10 +1741,6 @@
 msgid "Be aware that this URL might wrap over two lines. If your browser shows an error message when you try to access the URL please make sure that you put in the complete string."
 msgstr ""
 
-#: CMFDefault/skins/zpt_generic/review.pt:100
-msgid "There are no items matching your specified criteria."
-msgstr ""
-
 #: CMFDefault/skins/zpt_generic/review.pt:14
 msgid "Items pending review"
 msgstr ""
@@ -2042,9 +2059,6 @@
 msgid "Query Parameters:"
 msgstr ""
 
-msgid "Found ${count} ${type} matching '${text}'."
-msgstr ""
-
 msgid "Found ${count} ${type}."
 msgstr ""
 

Modified: CMF/branches/2.0/CMFDefault/skins/zpt_generic/batch_widgets.pt
===================================================================
--- CMF/branches/2.0/CMFDefault/skins/zpt_generic/batch_widgets.pt	2006-05-03 15:07:59 UTC (rev 67933)
+++ CMF/branches/2.0/CMFDefault/skins/zpt_generic/batch_widgets.pt	2006-05-03 15:29:25 UTC (rev 67934)
@@ -8,7 +8,7 @@
                                        'match': 'foo'};
                       global batch python: {'summary': summary}" />
 
- <metal:macro metal:define-macro="summary"
+ <metal:macro metal:define-macro="summary" i18n:domain="cmf_default"
  ><p class="BatchSummary" tal:condition="batch/summary/length"
      i18n:translate="">Found <span tal:replace="batch/summary/length"
       i18n:name="count">N</span> <span i18n:name="type"><span tal:omit-tag=""
@@ -28,7 +28,7 @@
                                        'type': 'File', 'url': '?'}, );
                       global batch python: {'listItemInfos': items}" />
 
- <metal:macro metal:define-macro="listing">
+ <metal:macro metal:define-macro="listing" i18n:domain="cmf_default">
  <p class="BatchListing" tal:repeat="item_info batch/listItemInfos"
  ><a href="" tal:attributes="href item_info/url"
   ><img src="" alt="" title="" border="0" width="16" height="16"

Modified: CMF/branches/2.0/CMFDefault/skins/zpt_generic/form_widgets.pt
===================================================================
--- CMF/branches/2.0/CMFDefault/skins/zpt_generic/form_widgets.pt	2006-05-03 15:07:59 UTC (rev 67933)
+++ CMF/branches/2.0/CMFDefault/skins/zpt_generic/form_widgets.pt	2006-05-03 15:29:25 UTC (rev 67934)
@@ -6,7 +6,7 @@
                       global form python: {'listHiddenVarInfos': hidden_vars}
                       " />
 
-<metal:macro metal:define-macro="hidden_vars">
+<metal:macro metal:define-macro="hidden_vars" i18n:domain="cmf_default">
  <tal:loop tal:repeat="hidden_var form/listHiddenVarInfos"
  ><input type="hidden" name="HiddenVarName" value=""
      tal:attributes="name hidden_var/name; value hidden_var/value" /></tal:loop
@@ -16,7 +16,7 @@
                                          'value': 'Delete'}, );
                       global form python: {'listButtonInfos': buttons}" />
 
- <metal:macro metal:define-macro="buttons"
+ <metal:macro metal:define-macro="buttons" i18n:domain="cmf_default"
 ><div class="FormButtons">
   <tal:loop tal:repeat="button form/listButtonInfos"
   ><input type="submit" name="ButtonName" value="ButtonValue"

Modified: CMF/branches/2.0/CMFTopic/Topic.py
===================================================================
--- CMF/branches/2.0/CMFTopic/Topic.py	2006-05-03 15:07:59 UTC (rev 67933)
+++ CMF/branches/2.0/CMFTopic/Topic.py	2006-05-03 15:29:25 UTC (rev 67934)
@@ -18,23 +18,19 @@
 from AccessControl import ClassSecurityInfo
 from Acquisition import aq_parent, aq_inner
 from Globals import InitializeClass
+from zope.interface import implements
 
 from Products.CMFDefault.SkinnedFolder import SkinnedFolder
 from Products.CMFCore.utils import getToolByName
-from zope.interface import Interface
-from zope.interface import implements
-from zope.interface import implementedBy
 
+from interfaces import IMutableTopic
+from interfaces import ITopic
 from permissions import View
 from permissions import AddTopics
 from permissions import ChangeTopics
 
 
-class ITopic(Interface):
-    """ Marker interface.
-    """
-
-def addTopic( self, id, title='', REQUEST=None ):
+def addTopic(self, id, title='', REQUEST=None):
     """ Create an empty topic.
     """
     topic = Topic( id )
@@ -48,12 +44,14 @@
 
 class Topic(SkinnedFolder):
 
-    """ Topics are 'canned queries'
-    
+    """ Topics are 'canned queries'.
+
     o Each topic holds a set of zero or more Criteria objects specifying
       the query.
     """
-    implements(ITopic, implementedBy(SkinnedFolder))
+
+    implements(IMutableTopic, ITopic)
+
     meta_type='Portal Topic'
 
     security = ClassSecurityInfo()
@@ -63,16 +61,13 @@
     _criteriaTypes = []
 
     security.declareProtected(ChangeTopics, 'listCriteria')
-    def listCriteria( self ):
-
+    def listCriteria(self):
         """ Return a list of our criteria objects.
         """
         return self.objectValues( self._criteria_metatype_ids() )
 
-
     security.declareProtected(ChangeTopics, 'listCriteriaTypes')
-    def listCriteriaTypes( self ):
-
+    def listCriteriaTypes(self):
         """ List the available criteria types.
         """
         out = []
@@ -83,8 +78,7 @@
         return out
 
     security.declareProtected(ChangeTopics, 'listAvailableFields')
-    def listAvailableFields( self ):
-
+    def listAvailableFields(self):
         """ Return a list of available fields for new criteria.
         """
         portal_catalog = getToolByName( self, 'portal_catalog' )
@@ -96,19 +90,17 @@
         return availfields
 
     security.declareProtected(ChangeTopics, 'listSubtopics')
-    def listSubtopics( self ):
-
+    def listSubtopics(self):
         """ Return a list of our subtopics.
         """
         return self.objectValues( self.meta_type )
 
     security.declareProtected(ChangeTopics, 'edit')
-    def edit( self, acquireCriteria, title=None, description=None ):
-
+    def edit(self, acquireCriteria, title=None, description=None):
         """ Set the flag which indicates whether to acquire criteria.
 
         o If set, reuse creiteria from parent topics;
-        
+
         o Also update metadata about the Topic.
         """
         self.acquireCriteria = bool(acquireCriteria)
@@ -119,8 +111,7 @@
         self.reindexObject()
 
     security.declareProtected(View, 'buildQuery')
-    def buildQuery( self ):
-
+    def buildQuery(self):
         """ Construct a catalog query using our criterion objects.
         """
         result = {}
@@ -144,10 +135,9 @@
         return result
 
     security.declareProtected(View, 'queryCatalog')
-    def queryCatalog( self, REQUEST=None, **kw ):
-
+    def queryCatalog(self, REQUEST=None, **kw):
         """ Invoke the catalog using our criteria.
-        
+
         o Built-in criteria update any criteria passed in 'kw'.
         """
         kw.update( self.buildQuery() )
@@ -155,22 +145,20 @@
         return portal_catalog.searchResults(REQUEST, **kw)
 
     security.declareProtected(View, 'synContentValues')
-    def synContentValues( self ):
-
+    def synContentValues(self):
         """ Return a limited subset of the brains for our query.
-        
+
         o Return no more brain objects than the limit set by the
           syndication tool.
         """
         syn_tool = getToolByName( self, 'portal_syndication' )
         limit = syn_tool.getMaxItems( self )
         brains = self.queryCatalog( sort_limit=limit )[ :limit ]
-        return [ brain.getObject() for brain in brains ] 
+        return [ brain.getObject() for brain in brains ]
 
     ### Criteria adding/editing/deleting
     security.declareProtected(ChangeTopics, 'addCriterion')
-    def addCriterion( self, field, criterion_type ):
-
+    def addCriterion(self, field, criterion_type):
         """ Add a new search criterion.
         """
         crit = None
@@ -188,8 +176,7 @@
         self._setObject( newid, crit )
 
     security.declareProtected(ChangeTopics, 'deleteCriterion')
-    def deleteCriterion( self, criterion_id ):
-
+    def deleteCriterion(self, criterion_id):
         """ Delete selected criterion.
         """
         if type( criterion_id ) is type( '' ):
@@ -199,8 +186,7 @@
                 self._delObject( cid )
 
     security.declareProtected(View, 'getCriterion')
-    def getCriterion( self, criterion_id ):
-
+    def getCriterion(self, criterion_id):
         """ Get the criterion object.
         """
         try:
@@ -209,8 +195,7 @@
             return self._getOb( criterion_id )
 
     security.declareProtected(AddTopics, 'addSubtopic')
-    def addSubtopic( self, id ):
-
+    def addSubtopic(self, id):
         """ Add a new subtopic.
         """
         ti = self.getTypeInfo()
@@ -220,8 +205,8 @@
     #
     #   Helper methods
     #
-    security.declarePrivate( '_criteria_metatype_ids' )
-    def _criteria_metatype_ids( self ):
+    security.declarePrivate('_criteria_metatype_ids')
+    def _criteria_metatype_ids(self):
 
         result = []
 
@@ -239,6 +224,6 @@
         SeachableText is used for full text seraches of a portal.  It
         should return a concatenation of all useful text.
         """
-        return "%s %s" % (self.title, self.description) 
+        return "%s %s" % (self.title, self.description)
 
 InitializeClass(Topic)

Modified: CMF/branches/2.0/CMFTopic/configure.zcml
===================================================================
--- CMF/branches/2.0/CMFTopic/configure.zcml	2006-05-03 15:07:59 UTC (rev 67933)
+++ CMF/branches/2.0/CMFTopic/configure.zcml	2006-05-03 15:29:25 UTC (rev 67934)
@@ -5,21 +5,20 @@
   <adapter
       factory=".exportimport.TopicExportImport"
       provides="Products.GenericSetup.interfaces.IFilesystemExporter"
-      for="Products.CMFTopic.Topic.ITopic"
+      for="Products.CMFTopic.interfaces.ITopic"
       />
 
   <adapter
       factory=".exportimport.TopicExportImport"
       provides="Products.GenericSetup.interfaces.IFilesystemImporter"
-      for="Products.CMFTopic.Topic.ITopic"
+      for="Products.CMFTopic.interfaces.ITopic"
       />
 
   <adapter
       factory=".exportimport.SubtopicFactory"
       provides="Products.GenericSetup.interfaces.IContentFactory"
-      for="Products.CMFTopic.Topic.ITopic"
+      for="Products.CMFTopic.interfaces.ITopic"
       name="Topic"
       />
 
 </configure>
-


Property changes on: CMF/branches/2.0/CMFTopic/configure.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: CMF/branches/2.0/CMFTopic/interfaces/__init__.py
===================================================================
--- CMF/branches/2.0/CMFTopic/interfaces/__init__.py	2006-05-03 15:07:59 UTC (rev 67933)
+++ CMF/branches/2.0/CMFTopic/interfaces/__init__.py	2006-05-03 15:29:25 UTC (rev 67934)
@@ -18,6 +18,27 @@
 from zope.interface import Interface
 
 
+class ITopic(Interface):
+
+    """ Topics are 'canned queries'.
+
+    o Each topic holds a set of zero or more Criteria objects specifying
+      the query.
+    """
+
+    def queryCatalog(REQUEST=None, **kw):
+        """ Invoke the catalog using our criteria.
+
+        o Built-in criteria update any criteria passed in 'kw'.
+        """
+
+
+class IMutableTopic(ITopic):
+
+    """ Updatable form of ITopic.
+    """
+
+
 class ICriterion(Interface):
     """\
     A Topic is composed of Criterion objects which specify the query

Modified: CMF/branches/2.0/CMFTopic/profiles/default/types/Topic.xml
===================================================================
--- CMF/branches/2.0/CMFTopic/profiles/default/types/Topic.xml	2006-05-03 15:07:59 UTC (rev 67933)
+++ CMF/branches/2.0/CMFTopic/profiles/default/types/Topic.xml	2006-05-03 15:29:25 UTC (rev 67934)
@@ -16,9 +16,10 @@
  </property>
  <property name="allow_discussion">False</property>
  <alias from="(Default)" to="topic_view"/>
+ <alias from="index.html" to="topic_view"/>
  <alias from="view" to="topic_view"/>
  <action title="View" action_id="view" category="object" condition_expr=""
-    url_expr="string:${object_url}/topic_view" visible="True">
+    url_expr="string:${object_url}" visible="True">
   <permission value="View"/>
  </action>
  <action title="Edit" action_id="edit" category="object" condition_expr=""


Property changes on: CMF/branches/2.0/CMFTopic/profiles/default/types/Topic.xml
___________________________________________________________________
Name: svn:keywords
   - Author Date Id Revision

Modified: CMF/branches/2.0/CMFTopic/tests/test_Topic.py
===================================================================
--- CMF/branches/2.0/CMFTopic/tests/test_Topic.py	2006-05-03 15:07:59 UTC (rev 67933)
+++ CMF/branches/2.0/CMFTopic/tests/test_Topic.py	2006-05-03 15:29:25 UTC (rev 67934)
@@ -15,10 +15,8 @@
 $Id$
 """
 
-from unittest import TestSuite, makeSuite, main
+import unittest
 import Testing
-import Zope2
-Zope2.startup()
 
 from Acquisition import Implicit
 
@@ -121,6 +119,7 @@
 
 
 class TestTopic(SecurityTest):
+
     """ Test all the general Topic cases.
     """
 
@@ -128,18 +127,20 @@
         SecurityTest.setUp(self)
         self.site = DummySite('site').__of__(self.root)
 
-    def _makeOne(self, id, *args, **kw):
+    def _getTargetClass(self):
         from Products.CMFTopic.Topic import Topic
 
-        return self.site._setObject( id, Topic(id, *args, **kw) )
+        return Topic
 
-    def _initSite( self, max_items=15, index_ids=() ):
+    def _makeOne(self, id, *args, **kw):
+        return self.site._setObject(id,
+                                    self._getTargetClass()(id, *args, **kw))
 
+    def _initSite(self, max_items=15, index_ids=()):
         self.site.portal_catalog = DummyCatalog( index_ids )
         self.site.portal_syndication = DummySyndicationTool( max_items )
 
-    def _initDocuments( self, **kw ):
-
+    def _initDocuments(self, **kw):
         for k, v in kw.items():
 
             document = DummyDocument( k )
@@ -156,21 +157,25 @@
                 import DynamicType as IDynamicType
         from Products.CMFCore.interfaces.Folderish \
                 import Folderish as IFolderish
-        from Products.CMFTopic.Topic import Topic
 
-        verifyClass(IDynamicType, Topic)
-        verifyClass(IFolderish, Topic)
-        verifyClass(IOrderedContainer, Topic)
-        verifyClass(WriteLockInterface, Topic)
+        verifyClass(IDynamicType, self._getTargetClass())
+        verifyClass(IFolderish, self._getTargetClass())
+        verifyClass(IOrderedContainer, self._getTargetClass())
+        verifyClass(WriteLockInterface, self._getTargetClass())
 
     def test_z3interfaces(self):
         from zope.interface.verify import verifyClass
         from Products.CMFCore.interfaces import IDynamicType
         from Products.CMFCore.interfaces import IFolderish
-        from Products.CMFTopic.Topic import Topic
+        from Products.CMFCore.interfaces import IMutableMinimalDublinCore
+        from Products.CMFTopic.interfaces import IMutableTopic
+        from Products.CMFTopic.interfaces import ITopic
 
-        verifyClass(IDynamicType, Topic)
-        verifyClass(IFolderish, Topic)
+        verifyClass(IDynamicType, self._getTargetClass())
+        verifyClass(IFolderish, self._getTargetClass())
+        verifyClass(IMutableMinimalDublinCore, self._getTargetClass())
+        verifyClass(IMutableTopic, self._getTargetClass())
+        verifyClass(ITopic, self._getTargetClass())
 
     def test_Empty( self ):
         topic = self._makeOne('top')
@@ -337,9 +342,9 @@
 
 
 def test_suite():
-    return TestSuite((
-        makeSuite(TestTopic),
+    return unittest.TestSuite((
+        unittest.makeSuite(TestTopic),
         ))
 
 if __name__ == '__main__':
-    main(defaultTest='test_suite')
+    unittest.main(defaultTest='test_suite')



More information about the CMF-checkins mailing list