[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/TextIndexNG - TextIndexNG.py:1.2.2.18

Andreas Jung andreas@digicool.com
Tue, 22 Jan 2002 10:51:12 -0500


Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/TextIndexNG
In directory cvs.zope.org:/tmp/cvs-serv3359

Modified Files:
      Tag: ajung-textindexng-branch
	TextIndexNG.py 
Log Message:
added more management tabs


=== Zope/lib/python/Products/PluginIndexes/TextIndexNG/TextIndexNG.py 1.2.2.17 => 1.2.2.18 ===
          'action': 'manage_main',
          'help': ('TextIndex','TextIndex_Settings.stx')},
+        {'label': 'Stop words',     
+         'action': 'manage_stopwords',
+         'help': ('TextIndex','TextIndex_Settings.stx')},
+        {'label': 'Thesaurus',     
+         'action': 'manage_thesaurus',
+         'help': ('TextIndex','TextIndex_Settings.stx')},
+        {'label': 'Normalizer',     
+         'action': 'manage_normalizer',
+         'help': ('TextIndex','TextIndex_Settings.stx')},
     )
 
     query_options = ("query","operator")
@@ -92,6 +101,7 @@
 
         debug(extra)
 
+
         # reference to catalog (can we get rid of that ?)
         self.catalog       = caller
 
@@ -130,6 +140,7 @@
 
         # Support for near search (None,'internal','documentLookup')
         self.nearSearch   = getattr(extra,'nearSearch',  None)
+        if self.nearSearch=='None': self.nearSearch = None
 
         # Stopwords: either filename or StopWord object
         self.stopWords     = getattr(extra,'stopWords',    None) or None
@@ -143,6 +154,7 @@
         # Normalizer: characterMapping
         self.charMapping   = getattr(extra,'characterMapping', None) or None
 
+
         if not self.nearSearch in (None,'internal','documentLookup'):
             raise ValueError,'nearSearch must be either None, "internal"'\
                              ' or "documentLookup"'
@@ -718,6 +730,16 @@
         return len(self._IDX)
 
 
+    def info(self):
+        """ return a list of TextIndexNG properties """
+
+        lst = []
+        for k in dir(self):
+            lst.append( (k,str(getattr(self,k))) )
+
+        lst.sort()
+        return lst
+
 
     def manage_setPreferences(self,extra,
                                REQUEST=None,RESPONSE=None,URL2=None):
@@ -750,11 +772,15 @@
 
 
     manage_workspace  = DTMLFile("dtml/manageTextIndexNG",globals())
+    manage_stopwords  = DTMLFile("dtml/manageStopWords",globals())
+    manage_thesaurus  = DTMLFile("dtml/manageThesaurus",globals())
+    manage_normalizer = DTMLFile("dtml/manageNormalizer",globals())
 
 
 manage_addTextIndexNGForm = DTMLFile('dtml/addTextIndexNG', globals())
 
 def manage_addTextIndexNG(self, id, extra, REQUEST=None, RESPONSE=None, URL3=None):
     """Add a new TextIndexNG """
+    print 'blabla'
     return self.manage_addIndex(id, 'TextIndexNG', extra, REQUEST, RESPONSE, URL3)