[zopeorg-checkins] CVS: Products/ZopeOrg-NV - __init__.py:1.24
Sidnei da Silva
sidnei at x3ng.com.br
Mon Jun 2 17:20:29 EDT 2003
Update of /cvs-zopeorg/Products/ZopeOrg-NV
In directory cvs.zope.org:/tmp/cvs-serv10636
Modified Files:
__init__.py
Log Message:
Fixes to allow cataloging
=== Products/ZopeOrg-NV/__init__.py 1.23 => 1.24 ===
import ZopeServiceProvider
import ZopeOrgTypes
import ZPublisher.Publish
+import zLOG
+
+def log(message, summary='', severity=0, dup=1):
+ zLOG.LOG('ZopeOrg: ',severity,summary,message)
#Hackish workaround to allow accesing the broken ZODB on ZopeOrg
class ImplicitAcquirerWrapper:
@@ -20,6 +24,28 @@
from Products.CMFDefault.DublinCore import DefaultDublinCoreImpl
DefaultDublinCoreImpl._DefaultDublinCoreImpl__FLOOR_DATE = DateTime(1979, 0)
DefaultDublinCoreImpl._DefaultDublinCoreImpl__CEILING_DATE = DateTime(2979, 0)
+
+def SearchableText(self):
+ """ Used by the catalog for basic full text indexing """
+ if not callable(self.Title):
+ log('Title should be method, found %s at %s .\n' % (type(self.Title), \
+ self.absolute_url(relative=1)))
+ if not callable(self.Description):
+ log('Description should be method, found %s at %s .\n' % (type(self.Description), \
+ self.absolute_url(relative=1)))
+ if not callable(self.EditableBody):
+ log('EditableBody should be method, found %s at %s .\n' % (type(self.EditableBody), \
+ self.absolute_url(relative=1)))
+ title = callable(self.Title) and self.Title() or self.Title
+ description = callable(self.Description) and self.Description() or self.Description
+ body = callable(self.EditableBody) and self.EditableBody() or self.EditableBody
+ return "%s %s %s" % ( title
+ , description
+ , body
+ )
+
+from Products.CMFDefault.Document import Document
+Document.SearchableText = SearchableText
Acquisition.ImplicitAcquirerWrapper = ImplicitAcquirerWrapper
ZPublisher.Publish.rfind = rfind
More information about the zopeorg-checkins
mailing list