[CMF-checkins] SVN: CMF/trunk/CMFTopic/ Allow creation of sub-topics.

Tres Seaver tseaver at palladion.com
Sun Nov 20 23:47:53 EST 2005


Log message for revision 40293:
  Allow creation of sub-topics.

Changed:
  U   CMF/trunk/CMFTopic/configure.zcml
  U   CMF/trunk/CMFTopic/exportimport.py

-=-
Modified: CMF/trunk/CMFTopic/configure.zcml
===================================================================
--- CMF/trunk/CMFTopic/configure.zcml	2005-11-21 04:22:20 UTC (rev 40292)
+++ CMF/trunk/CMFTopic/configure.zcml	2005-11-21 04:47:53 UTC (rev 40293)
@@ -14,5 +14,12 @@
       for="Products.CMFTopic.Topic.ITopic"
       />
 
+  <adapter
+      factory=".exportimport.SubtopicFactory"
+      provides="Products.GenericSetup.interfaces.IContentFactory"
+      for="Products.CMFTopic.Topic.ITopic"
+      name="Topic"
+      />
+
 </configure>
 

Modified: CMF/trunk/CMFTopic/exportimport.py
===================================================================
--- CMF/trunk/CMFTopic/exportimport.py	2005-11-21 04:22:20 UTC (rev 40292)
+++ CMF/trunk/CMFTopic/exportimport.py	2005-11-21 04:47:53 UTC (rev 40293)
@@ -30,6 +30,8 @@
         import PageTemplateFile as PageTemplateResource
 
 
+from Topic import Topic
+
 class TopicExportImport(FolderishExporterImporter):
     """ Dump topic criteria to / from an XML file.
     """
@@ -146,3 +148,14 @@
         keepers.extend(context.objectItems(context._criteria_metatype_ids()))
         return keepers
 
+
+class SubtopicFactory(object):
+
+    def __init__(self, context):
+        self.context = context
+
+    def __call__(self, id):
+        topic = Topic(id)
+        topic.portal_type = 'Topic'
+        return topic
+



More information about the CMF-checkins mailing list