Commit c6507061 authored by Yusei Tahara's avatar Yusei Tahara

2007-12-18 Yusei

* Fixed wrong field names around search dialog.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18396 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 68233e9d
...@@ -41,7 +41,7 @@ Multiple arguments: ...@@ -41,7 +41,7 @@ Multiple arguments:
- arg:all translates into empty tuple, which implies all available values - arg:all translates into empty tuple, which implies all available values
- state (simulation_state), type (portal_type) - state (simulation_state), type (portal_type)
Everything else is treated as SearchableText Everything else is treated as searchabletext
""" """
# XXX score: # XXX score:
...@@ -92,12 +92,12 @@ def parsestates(s): ...@@ -92,12 +92,12 @@ def parsestates(s):
return s.replace('"','').replace("'","") return s.replace('"','').replace("'","")
def analyze(params): def analyze(params):
params['SearchableText']='' params['searchabletext']=''
params['simulation_state']=simulation_states params['simulation_state']=simulation_states
def cutter(s): def cutter(s):
ss=s.split(':') ss=s.split(':')
if len(ss)==1: if len(ss)==1:
params['SearchableText']+=ss[0] params['searchabletext']+=ss[0]
if len(ss)==2: if len(ss)==2:
try: try:
ps=paramsmap.get(ss[0])(ss[1]) ps=paramsmap.get(ss[0])(ss[1])
...@@ -116,7 +116,7 @@ def parseSearchString(searchstring): ...@@ -116,7 +116,7 @@ def parseSearchString(searchstring):
l=r.split(searchstring) l=r.split(searchstring)
print l print l
map(analyze(params),l) map(analyze(params),l)
params['SearchableText']=params['SearchableText'].strip() params['searchabletext']=params['searchabletext'].strip()
return params return params
if __name__=='__main__': if __name__=='__main__':
......
...@@ -73,25 +73,25 @@ method.\n ...@@ -73,25 +73,25 @@ method.\n
"""\n """\n
req = context.REQUEST\n req = context.REQUEST\n
\n \n
search_straight = req.get(\'SearchableText\', \'\')\n search_straight = req.get(\'searchabletext\', \'\')\n
if search_straight != \'\':\n if search_straight != \'\':\n
return search_straight\n return search_straight\n
\n \n
# words to search in \'any of the words\' form - left intact\n # words to search in \'any of the words\' form - left intact\n
search_string = req.get(\'SearchableText_any\',\'\')\n search_string = req.get(\'searchabletext_any\',\'\')\n
\n \n
# exact phrase to search for - double-quoted\n # exact phrase to search for - double-quoted\n
search_phrase = req.get(\'SearchableText_phrase\',\'\')\n search_phrase = req.get(\'searchabletext_phrase\',\'\')\n
if search_phrase != "":\n if search_phrase != "":\n
search_string += \' "\' + search_phrase + \'"\'\n search_string += \' "\' + search_phrase + \'"\'\n
\n \n
# search "with all of the words" - each word prefixed by "+"\n # search "with all of the words" - each word prefixed by "+"\n
search_all = req.get(\'SearchableText_all\',\'\')\n search_all = req.get(\'searchabletext_all\',\'\')\n
if search_all != "":\n if search_all != "":\n
search_string += \' \' + \' \'.join(\'+\' + word for word in search_all.split(\' \'))\n search_string += \' \' + \' \'.join(\'+\' + word for word in search_all.split(\' \'))\n
\n \n
# search without these words - every word prefixed by "-"\n # search without these words - every word prefixed by "-"\n
search_without = req.get(\'SearchableText_without\',\'\')\n search_without = req.get(\'searchabletext_without\',\'\')\n
if search_without!="":\n if search_without!="":\n
search_string += \' \' + \' \'.join(\'-\' + word for word in search_without.split(\' \'))\n search_string += \' \' + \' \'.join(\'-\' + word for word in search_without.split(\' \'))\n
\n \n
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
"""\n """\n
The main search script. Receives one big string - a SearchableText, in\n The main search script. Receives one big string - a searchabletext, in\n
the search syntax, parses the string using external method Base_parseSearchString,\n the search syntax, parses the string using external method Base_parseSearchString,\n
then does the following:\n then does the following:\n
- processes arguments for searching by any category\n - processes arguments for searching by any category\n
...@@ -80,17 +80,17 @@ then does the following:\n ...@@ -80,17 +80,17 @@ then does the following:\n
"""\n """\n
\n \n
# if no args we return empty list\n # if no args we return empty list\n
# we use only SearchableText - all params are passed through this\n # we use only searchabletext - all params are passed through this\n
\n \n
# SearchableText can be supplied in request or stored in selection\n # searchabletext can be supplied in request or stored in selection\n
sstr = context.REQUEST.get(\'SearchableText\')\n sstr = context.REQUEST.get(\'searchabletext\')\n
\n \n
if sstr:\n if sstr:\n
context.portal_selections.setSelectionParamsFor(\'search_params_selection\', dict(SearchableText=sstr))\n context.portal_selections.setSelectionParamsFor(\'search_params_selection\', dict(searchabletext=sstr))\n
else:\n else:\n
params = context.portal_selections.getSelectionParamsFor(\'search_params_selection\')\n params = context.portal_selections.getSelectionParamsFor(\'search_params_selection\')\n
if params:\n if params:\n
sstr = params.get(\'SearchableText\')\n sstr = params.get(\'searchabletext\')\n
\n \n
if not sstr: return []\n if not sstr: return []\n
\n \n
...@@ -116,13 +116,13 @@ if not args.has_key(\'portal_type\') or args[\'portal_type\'] == ():\n ...@@ -116,13 +116,13 @@ if not args.has_key(\'portal_type\') or args[\'portal_type\'] == ():\n
# args[\'SearchableText\'] = dict(query=args[\'SearchableText\'], search_mode=modemap[mode])\n # args[\'SearchableText\'] = dict(query=args[\'SearchableText\'], search_mode=modemap[mode])\n
\n \n
# we always do boolean because we want these options in search dialog\n # we always do boolean because we want these options in search dialog\n
args[\'SearchableText\'] = dict(query=args[\'SearchableText\'], search_mode=\'in_boolean_mode\')\n args[\'searchabletext\'] = dict(query=args[\'searchabletext\'], search_mode=\'in_boolean_mode\')\n
\n \n
# a hack because SQLCatalog wants table.key now \n # a hack because SQLCatalog wants table.key now \n
# dunno if it is a bug or a feature\n # dunno if it is a bug or a feature\n
if args.has_key(\'SearchableText\'):\n if args.has_key(\'searchabletext\'):\n
args[\'full_text.SearchableText\'] = args[\'SearchableText\']\n args[\'full_text.SearchableText\'] = args[\'searchabletext\']\n
args.pop(\'SearchableText\')\n args.pop(\'searchabletext\')\n
\n \n
cf = args.get(\'creation_from\')\n cf = args.get(\'creation_from\')\n
ct = args.get(\'creation_to\')\n ct = args.get(\'creation_to\')\n
......
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<string>Products.PythonScripts.PythonScript</string> <tuple/>
<string>PythonScript</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -76,7 +73,7 @@ ...@@ -76,7 +73,7 @@
req = context.REQUEST\n req = context.REQUEST\n
sstr = context.Base_assembleSearchString()\n sstr = context.Base_assembleSearchString()\n
\n \n
req.set(\'SearchableText\', sstr)\n req.set(\'searchabletext\', sstr)\n
return context.Base_viewAdvancedSearchResultList()\n return context.Base_viewAdvancedSearchResultList()\n
</string> </value> </string> </value>
</item> </item>
......
...@@ -82,10 +82,10 @@ if hasattr(context, \'asText\'):\n ...@@ -82,10 +82,10 @@ if hasattr(context, \'asText\'):\n
argument_names = (\'advanced_search_text\', \n argument_names = (\'advanced_search_text\', \n
\'title\',\n \'title\',\n
\'reference\',\n \'reference\',\n
\'SearchableText\', \n \'searchabletext\', \n
\'SearchableText_any\',\n \'searchabletext_any\',\n
\'SearchableText_all\', \n \'searchabletext_all\', \n
\'SearchableText_phrase\',)\n \'searchabletext_phrase\',)\n
if selection is not None:\n if selection is not None:\n
params = selection.getParams()\n params = selection.getParams()\n
else:\n else:\n
...@@ -101,7 +101,7 @@ if not search_string:\n ...@@ -101,7 +101,7 @@ if not search_string:\n
return document_text[:300]\n return document_text[:300]\n
\n \n
search_argument_list = context.Base_parseSearchString(search_string)\n search_argument_list = context.Base_parseSearchString(search_string)\n
search_words = search_argument_list.get(\'SearchableText\')\n search_words = search_argument_list.get(\'searchabletext\')\n
\n \n
if search_words in (\'\', None,):\n if search_words in (\'\', None,):\n
# the searched words are empty (e.g. because we used only parameters \n # the searched words are empty (e.g. because we used only parameters \n
......
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="ERP5Form" module="Products.ERP5Form.Form"/>
<string>Products.ERP5Form.Form</string> <tuple/>
<string>ERP5Form</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -94,13 +91,13 @@ ...@@ -94,13 +91,13 @@
<key> <string>left</string> </key> <key> <string>left</string> </key>
<value> <value>
<list> <list>
<string>SearchableText_any</string> <string>your_searchabletext_any</string>
<string>SearchableText_all</string> <string>your_searchabletext_all</string>
<string>SearchableText_phrase</string> <string>your_searchabletext_phrase</string>
<string>SearchableText_without</string> <string>your_searchabletext_without</string>
<string>my_search_portal_type</string> <string>my_search_portal_type</string>
<string>creation_from</string> <string>your_creation_from</string>
<string>creation_to</string> <string>your_creation_to</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -108,11 +105,11 @@ ...@@ -108,11 +105,11 @@
<key> <string>right</string> </key> <key> <string>right</string> </key>
<value> <value>
<list> <list>
<string>reference</string> <string>your_reference</string>
<string>version</string> <string>your_version</string>
<string>language</string> <string>your_language</string>
<string>mine</string> <string>your_mine</string>
<string>newest</string> <string>your_newest</string>
<string>my_created_within</string> <string>my_created_within</string>
</list> </list>
</value> </value>
......
...@@ -3,18 +3,15 @@ ...@@ -3,18 +3,15 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="DateTimeField" module="Products.Formulator.StandardFields"/>
<string>Products.Formulator.StandardFields</string> <tuple/>
<string>DateTimeField</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>creation_from</string> </value> <value> <string>your_creation_from</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
...@@ -3,18 +3,15 @@ ...@@ -3,18 +3,15 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="DateTimeField" module="Products.Formulator.StandardFields"/>
<string>Products.Formulator.StandardFields</string> <tuple/>
<string>DateTimeField</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>creation_to</string> </value> <value> <string>your_creation_to</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
...@@ -3,18 +3,15 @@ ...@@ -3,18 +3,15 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="ListField" module="Products.Formulator.StandardFields"/>
<string>Products.Formulator.StandardFields</string> <tuple/>
<string>ListField</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>language</string> </value> <value> <string>your_language</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
...@@ -3,18 +3,15 @@ ...@@ -3,18 +3,15 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="CheckBoxField" module="Products.Formulator.StandardFields"/>
<string>Products.Formulator.StandardFields</string> <tuple/>
<string>CheckBoxField</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>mine</string> </value> <value> <string>your_mine</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="CheckBoxField" module="Products.Formulator.StandardFields"/>
<string>Products.Formulator.StandardFields</string> <tuple/>
<string>CheckBoxField</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -20,7 +17,7 @@ ...@@ -20,7 +17,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>newest</string> </value> <value> <string>your_newest</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
...@@ -3,18 +3,15 @@ ...@@ -3,18 +3,15 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="StringField" module="Products.Formulator.StandardFields"/>
<string>Products.Formulator.StandardFields</string> <tuple/>
<string>StringField</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>reference</string> </value> <value> <string>your_reference</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
...@@ -3,18 +3,15 @@ ...@@ -3,18 +3,15 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="StringField" module="Products.Formulator.StandardFields"/>
<string>Products.Formulator.StandardFields</string> <tuple/>
<string>StringField</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>SearchableText_all</string> </value> <value> <string>your_searchabletext_all</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
...@@ -3,18 +3,15 @@ ...@@ -3,18 +3,15 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="StringField" module="Products.Formulator.StandardFields"/>
<string>Products.Formulator.StandardFields</string> <tuple/>
<string>StringField</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>SearchableText_any</string> </value> <value> <string>your_searchabletext_any</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
...@@ -3,18 +3,15 @@ ...@@ -3,18 +3,15 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="StringField" module="Products.Formulator.StandardFields"/>
<string>Products.Formulator.StandardFields</string> <tuple/>
<string>StringField</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>SearchableText_phrase</string> </value> <value> <string>your_searchabletext_phrase</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
...@@ -3,18 +3,15 @@ ...@@ -3,18 +3,15 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="StringField" module="Products.Formulator.StandardFields"/>
<string>Products.Formulator.StandardFields</string> <tuple/>
<string>StringField</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>SearchableText_without</string> </value> <value> <string>your_searchabletext_without</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="StringField" module="Products.Formulator.StandardFields"/>
<string>Products.Formulator.StandardFields</string> <tuple/>
<string>StringField</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -20,7 +17,7 @@ ...@@ -20,7 +17,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>version</string> </value> <value> <string>your_version</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
<key> <string>left</string> </key> <key> <string>left</string> </key>
<value> <value>
<list> <list>
<string>SearchableText</string> <string>your_searchabletext</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -3,18 +3,15 @@ ...@@ -3,18 +3,15 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="StringField" module="Products.Formulator.StandardFields"/>
<string>Products.Formulator.StandardFields</string> <tuple/>
<string>StringField</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>SearchableText</string> </value> <value> <string>your_searchabletext</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
2007-12-18 Yusei
* Fixed wrong field names around search dialog.
2007-12-11 Yusei 2007-12-11 Yusei
* Fixed dependencies. erp5_dms depends on erp5_crm. Because Document Ingestion Message is based on Event portal type. * Fixed dependencies. erp5_dms depends on erp5_crm. Because Document Ingestion Message is based on Event portal type.
......
768 769
\ No newline at end of file \ No newline at end of file
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