[CMF-checkins] CVS: Products/CMFTopic/interfaces - __init__.py:1.3.12.1 Criterion.py:NONE

Tres Seaver tseaver at palladion.com
Fri Jul 15 18:41:54 EDT 2005


Update of /cvs-repository/Products/CMFTopic/interfaces
In directory cvs.zope.org:/tmp/cvs-serv16776/CMFTopic/interfaces

Modified Files:
      Tag: tseaver-z3_interfaces-branch
	__init__.py 
Removed Files:
      Tag: tseaver-z3_interfaces-branch
	Criterion.py 
Log Message:


Branch for Z3-ification of CMF interfaces

 - All interfaces declared in the CMF are now Zope3-style interfaces
   (the one remaining exception is to leave Zope2's
   'webdav.WriteLockInterface' declared by CMFCore.PortalContent and
   derivatives.).

TOOD

  - Clean up XXX'es noted during this pass.


=== Products/CMFTopic/interfaces/__init__.py 1.3 => 1.3.12.1 ===
--- Products/CMFTopic/interfaces/__init__.py:1.3	Thu Aug 12 11:07:42 2004
+++ Products/CMFTopic/interfaces/__init__.py	Fri Jul 15 18:41:23 2005
@@ -10,8 +10,71 @@
 # FOR A PARTICULAR PURPOSE.
 # 
 ##############################################################################
-"""\
-Loads interface names into the package.
+""" CMFTopic product interfaces
 """
 
-from Criterion import Criterion
+from zope.interface import Interface
+
+
+class ICriterion(Interface):
+    """\
+    A Topic is composed of Criterion objects which specify the query
+    used for the Topic.  By supplying some basic information, the
+    Criterion objects can be plugged into Topics without the Topic
+    having to be too aware of the Criteria types.
+    """
+
+    def Type():
+        """\
+        Return the type of criterion object this is (ie - 'List Criterion')
+        """
+
+    def Field():
+        """\
+        Return the field this criterion object searches on.
+        """
+
+    def Description():
+        """\
+        Return a brief description of the criteria type.
+        """
+
+    def editableAttributes():
+        """\
+        Returns a tuble of editable attributes.  The values of this
+        are used by the topic to build commands to send to the
+        'edit' method based on each criterion's setup.
+        """
+
+    def getEditForm():
+        """\
+        Return the name of a DTML component used to edit criterion.
+        Editforms should be specific to their type of criteria.
+        """
+
+    def apply(command):
+        """\
+        To make it easier to apply values from the rather dynamic
+        Criterion edit form using Python Scripts, apply takes a
+        mapping object as a default and applies itself to self.edit.
+
+        It's basically a nice and protected wrapper around
+        self.edit(**command).
+        """
+
+# XXX: Interfaces have to specify the signature.
+##    def edit(**kw):
+##        """\
+##        The signature of this method should be specific to the
+##        criterion.  Using the values in the attribute
+##        '_editableAttributes', the Topic can apply the right
+##        commands to each criteria object as its being edited without
+##        having to know too much about the structure.
+##        """
+
+    def getCriteriaItems():
+        """\
+        Return a sequence of key-value tuples, each representing
+        a value to be injected into the query dictionary (and,
+        therefore, tailored to work with the catalog).
+        """

=== Removed File Products/CMFTopic/interfaces/Criterion.py ===



More information about the CMF-checkins mailing list