[Erp5-report] r37174 ivan - /erp5/trunk/products/ERP5/Document/

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Jul 16 15:51:23 CEST 2010


Author: ivan
Date: Fri Jul 16 15:51:22 2010
New Revision: 37174

URL: http://svn.erp5.org?rev=37174&view=rev
Log:
Use Base.getSearchableText which now uses portal type based configuration.

Modified:
    erp5/trunk/products/ERP5/Document/Document.py
    erp5/trunk/products/ERP5/Document/EmailDocument.py

Modified: erp5/trunk/products/ERP5/Document/Document.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Document.py?rev=37174&r1=37173&r2=37174&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Document.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Document.py [utf8] Fri Jul 16 15:51:22 2010
@@ -337,53 +337,6 @@ class Document(DocumentExtensibleTravers
                     , PropertySheet.Snapshot
                     )
 
-  searchable_property_list = ('asText', 'title', 'description', 'id', 'reference',
-                              'version', 'short_title', 'subject',
-                              'source_reference', 'source_project_title')
-
-
-  security.declareProtected(Permissions.View, 'getSearchableText')
-  def getSearchableText(self, md=None):
-    """
-      Used by the catalog for basic full text indexing.
-      Uses searchable_property_list attribute to put together various properties
-      of the document into one searchable text string.
-
-      XXX-JPS - This method is nice. It should probably be moved to Base class
-      searchable_property_list could become a standard class attribute.
-
-      TODO (future): Make this property a per portal type property.
-    """
-    def getPropertyListOrValue(property):
-      """
-        we try to get a list, else we get value and convert to list
-      """
-      method = getattr(self, property, None)
-      if method is not None:
-        if callable(method):
-          val = method()
-          if isinstance(val, (list, tuple)):
-            return list(val)
-          return [str(val)]
-      val = self.getPropertyList(property)
-      if val is None:
-        val = self.getProperty(property)
-        if val is not None and val != '':
-          val = [str(val)]
-        else:
-          val = []
-      else:
-        val = [str(v) for v in list(val) if v is not None]
-      return val
-
-    searchable_text = reduce(add, map(lambda x: getPropertyListOrValue(x),
-                                                self.searchable_property_list))
-    searchable_text = ' '.join(searchable_text)
-    return searchable_text
-
-  # Compatibility with CMF Catalog
-  SearchableText = getSearchableText
-
   index_html = DownloadableMixin.index_html
 
   security.declareProtected(Permissions.AccessContentsInformation, 'isExternalDocument')

Modified: erp5/trunk/products/ERP5/Document/EmailDocument.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/EmailDocument.py?rev=37174&r1=37173&r2=37174&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/EmailDocument.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/EmailDocument.py [utf8] Fri Jul 16 15:51:22 2010
@@ -156,10 +156,6 @@ class EmailDocument(TextDocument):
                     , PropertySheet.Reference
                     )
 
-  # Searchable Text - at least search the body message
-  #                 - later: search attachments too
-  searchable_property_list = TextDocument.searchable_property_list
-
   # Mail processing API
   def _getMessage(self):
     result = getattr(self, '_v_message', None)




More information about the Erp5-report mailing list