Commit e8f935a4 authored by Bartek Górny's avatar Bartek Górny

Support for document-type attributes, incl. SearchableText.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9007 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8644a31a
...@@ -66,6 +66,23 @@ class DMSFile(XMLObject,File): ...@@ -66,6 +66,23 @@ class DMSFile(XMLObject,File):
_edit=File._edit _edit=File._edit
edit=File.edit edit=File.edit
### Content indexing methods
security.declareProtected(Permissions.View, 'getSearchableText')
def getSearchableText(self, md=None):
"""\
Used by the catalog for basic full text indexing
And so we end up with a strange hybrid of File and Document
This is the same as in OOoDocument except that no text_content here
Some people call it 'copy-and-paste programming'
"""
searchable_attrs=('title','description','id','reference','version',
'short_title','keywords','subject','original_filename','source_project_title')
searchable_text = ' '.join(map(lambda x: self.getProperty(x) or ' ',searchable_attrs))
return searchable_text
SearchableText=getSearchableText
# BG copied from File in case # BG copied from File in case
index_html = CMFFile.index_html index_html = CMFFile.index_html
PUT = CMFFile.PUT PUT = CMFFile.PUT
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment