[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/index/text - configure.zcml:1.1 index.py:1.4 interfaces.py:1.2

Guido van Rossum guido@python.org
Wed, 4 Dec 2002 12:11:52 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/index/text
In directory cvs.zope.org:/tmp/cvs-serv16612/text

Modified Files:
	index.py interfaces.py 
Added Files:
	configure.zcml 
Log Message:
Add machinery for creating a TextIndex from the Services Add menu.
You can't subscribe it yet; that needs to be done later.

=== Added File Zope3/lib/python/Zope/App/index/text/configure.zcml ===
<zopeConfigure
   xmlns='http://namespaces.zope.org/zope'
>

  <content
    class=".index.TextIndex"
    >

    <require
      permission="Zope.ManageServices"
      interface=".interfaces.IUITextIndex"
      />

    <factory
      id="Zope.App.index.text.factory"
      permission="Zope.ManageServices"
      />

  </content>

  <include package=".browser" />

</zopeConfigure>


=== Zope3/lib/python/Zope/App/index/text/index.py 1.3 => 1.4 ===
--- Zope3/lib/python/Zope/App/index/text/index.py:1.3	Wed Dec  4 09:43:04 2002
+++ Zope3/lib/python/Zope/App/index/text/index.py	Wed Dec  4 12:11:51 2002
@@ -29,7 +29,7 @@
      IObjectUnregisteredHubEvent, \
      IObjectModifiedHubEvent
 
-from Zope.App.index.text.interfaces import ISearchableText
+from Zope.App.index.text.interfaces import ISearchableText, IUITextIndex
 
 from Zope.ComponentArchitecture import queryAdapter
 from Zope.ContextWrapper import ContextMethod
@@ -38,7 +38,8 @@
 
 class TextIndex(TextIndexWrapper):
 
-    __implements__ = TextIndexWrapper.__implements__ + (ISubscriber,)
+    __implements__ = TextIndexWrapper.__implements__ + (ISubscriber,
+                                                        IUITextIndex)
 
     def notify(wrapped_self, event):
         """An event occurred.  Index or unindex the object in response."""


=== Zope3/lib/python/Zope/App/index/text/interfaces.py 1.1 => 1.2 ===
--- Zope3/lib/python/Zope/App/index/text/interfaces.py:1.1	Wed Dec  4 06:10:24 2002
+++ Zope3/lib/python/Zope/App/index/text/interfaces.py	Wed Dec  4 12:11:51 2002
@@ -29,3 +29,15 @@
         through the splitter pipeline; the combined stream of words
         coming out of the pipeline will be indexed.
         """
+
+from Zope.TextIndex.TextIndexInterfaces import IStatistics
+
+class IUITextIndex(IStatistics):
+
+    """Interface for creating a TextIndex from the ZMI."""
+
+    def subscribe():
+        """Subscribe to the prevailing object hub service."""
+
+    def unsubscribe():
+        """Unsubscribe from the object hub service."""