[Erp5-report] r36723 ivan - in /erp5/trunk/products/ERP5/bootstrap/erp5_core: SkinTemplateI...

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Jun 30 12:52:38 CEST 2010


Author: ivan
Date: Wed Jun 30 12:52:32 2010
New Revision: 36723

URL: http://svn.erp5.org?rev=36723&view=rev
Log:
Delegate getting searchable text to new  script .Base_getSearchText..

Added:
    erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getSearchText.xml
Modified:
    erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_showFoundText.xml
    erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision

Added: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getSearchText.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getSearchText.xml?rev=36723&view=auto
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getSearchText.xml (added)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getSearchText.xml [utf8] Wed Jun 30 12:52:32 2010
@@ -0,0 +1,164 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_container</string> </key>
+                                <value> <string>container</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_context</string> </key>
+                                <value> <string>context</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_m_self</string> </key>
+                                <value> <string>script</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_body</string> </key>
+            <value> <string>"""\n
+  Get search text from REQUEST or selection.\n
+"""\n
+# get search words from listbox selection\n
+argument_names = (\'advanced_search_text\', \n
+                  \'your_search_text\',\n
+                  \'title\',\n
+                  \'reference\',\n
+                  \'searchabletext\', \n
+                  \'searchabletext_any\',\n
+                  \'searchabletext_all\', \n
+                  \'searchabletext_phrase\',)\n
+\n
+if selection is None:\n
+  selection_name = context.REQUEST.get("selection_name", None)\n
+  if selection_name is not None:\n
+    selection = context.portal_selections.getSelectionFor(selection_name)\n
+\n
+if selection is not None:\n
+  params = selection.getParams()\n
+else:\n
+  params = context.portal_selections.getSelectionParamsFor(\'search_result_selection\')\n
+\n
+params = [params.get(name, \'\') for name in argument_names]\n
+# flatten value if it is list\n
+params = [(hasattr(param, \'sort\') and \' \'.join(param) or param) for param in params]\n
+search_string = \' \'.join(params).strip()\n
+\n
+return search_string\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>selection=None</string> </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_code</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>co_argcount</string> </key>
+                        <value> <int>1</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>selection</string>
+                            <string>argument_names</string>
+                            <string>None</string>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>selection_name</string>
+                            <string>params</string>
+                            <string>append</string>
+                            <string>$append0</string>
+                            <string>_getiter_</string>
+                            <string>name</string>
+                            <string>param</string>
+                            <string>hasattr</string>
+                            <string>search_string</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <tuple>
+                <none/>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>Base_getSearchText</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_showFoundText.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_showFoundText.xml?rev=36723&r1=36722&r2=36723&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_showFoundText.xml [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_showFoundText.xml [utf8] Wed Jun 30 12:52:32 2010
@@ -80,31 +80,13 @@ def getRandomDocumentTextExcerpt(documen
   else:\n
     return \'\'\n
 \n
-# get search words from listbox selection\n
-argument_names = (\'advanced_search_text\', \n
-                  \'your_search_text\',\n
-                  \'title\',\n
-                  \'reference\',\n
-                  \'searchabletext\', \n
-                  \'searchabletext_any\',\n
-                  \'searchabletext_all\', \n
-                  \'searchabletext_phrase\',)\n
-\n
 if document_text is None:\n
   try:\n
     document_text = context.getSearchableText()\n
   except NotConvertedError:\n
     return context.Base_translateString("This document is not converted yet.")\n
 \n
-if selection is not None:\n
-  params = selection.getParams()\n
-else:\n
-  params = context.portal_selections.getSelectionParamsFor(\'search_result_selection\')\n
-\n
-params = [params.get(name, \'\') for name in argument_names]\n
-# flatten value if it is list\n
-params = [(hasattr(param, \'sort\') and \' \'.join(param) or param) for param in params]\n
-search_string = \' \'.join(params).strip()\n
+search_string = context.Base_getSearchText(selection)\n
 \n
 if search_string != \'\':\n
   search_argument_list = context.Base_parseSearchString(search_string)\n
@@ -178,15 +160,7 @@ else:\n
                             <string>context</string>
                             <string>is_gadget_mode</string>
                             <string>getRandomDocumentTextExcerpt</string>
-                            <string>argument_names</string>
                             <string>None</string>
-                            <string>params</string>
-                            <string>append</string>
-                            <string>$append0</string>
-                            <string>_getiter_</string>
-                            <string>name</string>
-                            <string>param</string>
-                            <string>hasattr</string>
                             <string>search_string</string>
                             <string>search_argument_list</string>
                             <string>found_text_fragments</string>

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision?rev=36723&r1=36722&r2=36723&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] Wed Jun 30 12:52:32 2010
@@ -1 +1 @@
-1622
\ No newline at end of file
+1623
\ No newline at end of file




More information about the Erp5-report mailing list