<?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 encoding="cdata"><![CDATA[

"""\n
  This script is used in listbox allowing when switching \'table\' --> \'search\' mode.\n
  It will try to generate parts of the document\'s text \n
  containing searched words as well highlighting the searched \n
  words in the text itself.\n
"""\n
\n
if selection is not None:\n
  params = selection.getParams()\n
else:\n
  params = context.portal_selections.getSelectionParamsFor(\'search_result_selection\')\n
search_words = params.get(\'your_search_text\')\n
\n
if search_words is None:\n
  return \'\'\n
else:\n
\n
  if document_text is None:\n
    document_text = context.getSearchableText()\n
\n
  found_text_fragments = context.Base_getExcerptText(\n
                           context, \\\n
                           document_text, \\\n
                           search_words, \\\n
                           tags = (\'<em>\', \'</em>\'), \\\n
                           trail = 5, \\\n
                           maxlines = max_lines)\n
  result = \' \'.join(map(str, found_text_fragments))\n
\n
  # Document may contains charactors which utf8 codec cannot decode.\n
  unicode_result = result.decode(\'utf-8\', \'ignore\')\n
  result = unicode_result.encode(\'utf-8\')\n
\n
  return result\n


]]></string> </value>
        </item>
        <item>
            <key> <string>_code</string> </key>
            <value>
              <none/>
            </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
            <value> <string>document_text=None, selection=None, max_lines = 5, max_text_length = 500</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>4</int> </value>
                    </item>
                    <item>
                        <key> <string>co_varnames</string> </key>
                        <value>
                          <tuple>
                            <string>document_text</string>
                            <string>selection</string>
                            <string>max_lines</string>
                            <string>max_text_length</string>
                            <string>None</string>
                            <string>_getattr_</string>
                            <string>params</string>
                            <string>context</string>
                            <string>search_words</string>
                            <string>found_text_fragments</string>
                            <string>map</string>
                            <string>str</string>
                            <string>result</string>
                            <string>unicode_result</string>
                          </tuple>
                        </value>
                    </item>
                  </dictionary>
                </state>
              </object>
            </value>
        </item>
        <item>
            <key> <string>func_defaults</string> </key>
            <value>
              <tuple>
                <none/>
                <none/>
                <int>5</int>
                <int>500</int>
              </tuple>
            </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>Base_showFoundText</string> </value>
        </item>
        <item>
            <key> <string>warnings</string> </key>
            <value>
              <tuple/>
            </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
