[Erp5-report] r11551 - /erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Nov 30 17:15:44 CET 2006


Author: bartek
Date: Thu Nov 30 17:15:42 2006
New Revision: 11551

URL: http://svn.erp5.org?rev=11551&view=rev
Log:
if no keywords are submitted, we return just a chunk of searchable text

Modified:
    erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_showFoundText.xml

Modified: erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_showFoundText.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_showFoundText.xml?rev=11551&r1=11550&r2=11551&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_showFoundText.xml (original)
+++ erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_showFoundText.xml Thu Nov 30 17:15:42 2006
@@ -76,11 +76,13 @@
 txt=brain.getObject().SearchableText()\n
 st=selection.params.get(\'SearchableText\')\n
 if st is None:\n
-  return \'\'\n
+  # we should return something\n
+  return txt[min(len(txt)-300,200):500] # a somewhat arbitrary choice to trim searchable attrs\n
 args=context.parseSearchString(st)\n
 sw=args.get(\'SearchableText\')\n
-if sw is None:\n
-  return \'\'\n
+if sw is None or sw==\'\':\n
+  # we should return something\n
+  return txt[min(len(txt)-300,200):500] # a somewhat arbitrary choice to trim searchable attrs\n
 res=context.cutFound(context,txt,sw,tags,trail,maxlines)\n
 return \' \'.join(map(str,res))\n
 
@@ -136,6 +138,9 @@
                             <string>txt</string>
                             <string>st</string>
                             <string>None</string>
+                            <string>_getitem_</string>
+                            <string>min</string>
+                            <string>len</string>
                             <string>context</string>
                             <string>args</string>
                             <string>sw</string>




More information about the Erp5-report mailing list