Commit 547fe478 authored by Bartek Górny's avatar Bartek Górny

Search interface brought to accordance with the standard (results in list...

Search interface brought to accordance with the standard (results in list mode, dialogs have select, "string" and "form" searches are separate dialogs);
Getting searchable type list moved out so that it can be overwritted;
Added more search parameters;

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11151 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8f2b7a24
No related merge requests found
......@@ -95,7 +95,11 @@
<value>
<list>
<string>SearchableText</string>
<string>my_document_type</string>
<string>my_search_portal_type</string>
<string>creation_from</string>
<string>creation_to</string>
<string>publication_from</string>
<string>publication_to</string>
</list>
</value>
</item>
......@@ -104,14 +108,11 @@
<value>
<list>
<string>reference</string>
<string>creation_from</string>
<string>creation_to</string>
<string>modification_from</string>
<string>modification_to</string>
<string>search_mode</string>
<string>version</string>
<string>language</string>
<string>mine</string>
<string>newest</string>
<string>language</string>
<string>search_mode</string>
</list>
</value>
</item>
......
......@@ -14,7 +14,7 @@
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_document_type</string> </value>
<value> <string>my_search_portal_type</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
......@@ -14,7 +14,7 @@
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>modification_to</string> </value>
<value> <string>publication_from</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -315,7 +315,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Modified before</string> </value>
<value> <string>Published after</string> </value>
</item>
</dictionary>
</value>
......
......@@ -14,7 +14,7 @@
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>modification_from</string> </value>
<value> <string>publication_to</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -315,7 +315,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Modified after</string> </value>
<value> <string>Published before</string> </value>
</item>
</dictionary>
</value>
......
......@@ -5,16 +5,22 @@
<tuple>
<tuple>
<string>Products.Formulator.StandardFields</string>
<string>LinkField</string>
<string>StringField</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>advanced_search</string> </value>
<value> <string>version</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -24,10 +30,6 @@
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>not_link</string> </key>
<value> <string>The specified link is broken.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
......@@ -47,14 +49,6 @@
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>check_link</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>check_timeout</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
......@@ -95,10 +89,6 @@
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>link_type</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
......@@ -134,14 +124,6 @@
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>check_link</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>check_timeout</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
......@@ -182,10 +164,6 @@
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>link_type</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
......@@ -221,21 +199,13 @@
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>check_link</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>check_timeout</string> </key>
<value> <float>7.0</float> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string>Base_advancedSearchDialog</string> </value>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -251,7 +221,7 @@
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
......@@ -269,10 +239,6 @@
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>link_type</string> </key>
<value> <string>external</string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
......@@ -283,7 +249,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Advanced Search</string> </value>
<value> <string>Version</string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.Form</string>
<string>ERP5Form</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</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/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>listbox</string>
</list>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list>
<string>listbox_Base_showFoundText</string>
</list>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_advancedSearchResults</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>Base_advancedSearchResults</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_list</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Search results</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -12,6 +12,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox</string> </value>
......@@ -487,15 +493,15 @@
</item>
<item>
<key> <string>search</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>search_columns</string> </key>
<value>
<list>
<tuple>
<string>None</string>
<string>None</string>
<string>title</string>
<string>title</string>
</tuple>
</list>
</value>
......
......@@ -12,6 +12,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_Base_showFoundText</string> </value>
......
......@@ -70,17 +70,29 @@
<key> <string>_body</string> </key>
<value> <string>req=context.REQUEST\n
st=req.get(\'SearchableText\',\'\')\n
doctype=req.get(\'document_type\')\n
context.log(st)\n
doctype=req.get(\'search_portal_type\')\n
context.log(doctype)\n
if doctype==\'all\':doctype=None\n
if isinstance(doctype,str):\n
doctype=[doctype]\n
if doctype:\n
if len(doctype)==1:\n
st+=\' type:%s\' % doctype[0]\n
st+=\' type:"%s"\' % doctype[0]\n
else:\n
st+=\' type:(%s)\' % \',\'.join(doctype)\n
ref=req.get(\'reference\')\n
if ref:st+=\' reference:%s\' % ref\n
ver=req.get(\'version\')\n
if ver:st+=\' version:%s\' % ver\n
lng=req.get(\'language\')\n
if lng and lng!=\'0\':\n
st+=\' language:%s\' % lng\n
# category search\n
for c in (\'group\',\'function\',\'site\'):\n
cval=req.get(\'search_\'+c)\n
if cval:\n
st+=\' %s:%s\' % (c,cval)\n
sm=req.get(\'search_mode\')\n
smmap={\'in_boolean_mode\':\'boolean\',\'with_query_expansion\':\'expanded\'}\n
if sm and smmap.has_key(sm):\n
......@@ -91,7 +103,7 @@ if mine:\n
newest=req.get(\'newest\')\n
if newest:\n
st+=\' newest:yes\'\n
\n
context.log(st)\n
return st\n
</string> </value>
</item>
......@@ -148,10 +160,17 @@ return st\n
<string>req</string>
<string>st</string>
<string>doctype</string>
<string>None</string>
<string>isinstance</string>
<string>str</string>
<string>len</string>
<string>_getitem_</string>
<string>ref</string>
<string>ver</string>
<string>lng</string>
<string>_getiter_</string>
<string>c</string>
<string>cval</string>
<string>sm</string>
<string>smmap</string>
<string>mine</string>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</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>return context.getPortalDocumentTypeList()+(\'Conference\',\'Project\')\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></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>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>_getattr_</string>
<string>context</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getSearchableTypeList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -72,7 +72,7 @@
sstr=context.Base_assembleSearchString()\n
context.log(sstr)\n
req.set(\'SearchableText\',sstr)\n
return context.Base_searchDialog()\n
return context.Base_advancedSearchResults()\n
</string> </value>
</item>
<item>
......
......@@ -53,7 +53,7 @@
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_searchDialog</string> </value>
<value> <string>Base_processAdvancedSearch</string> </value>
</item>
<item>
<key> <string>encoding</string> </key>
......@@ -81,10 +81,7 @@
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>listbox</string>
<string>listbox_Base_showFoundText</string>
</list>
<list/>
</value>
</item>
<item>
......@@ -104,9 +101,7 @@
<item>
<key> <string>right</string> </key>
<value>
<list>
<string>advanced_search</string>
</list>
<list/>
</value>
</item>
</dictionary>
......
......@@ -12,6 +12,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_dms_category_list</string> </value>
......
......@@ -83,7 +83,7 @@ args=context.parseSearchString(sstr)\n
\n
# if no portal type specified, take all\n
if not args.has_key(\'portal_type\') or args[\'portal_type\']==():\n
args[\'portal_type\']=context.getPortalDocumentTypeList()+(\'Conference\',\'Project\')\n
args[\'portal_type\']=context.Base_getSearchableTypeList()\n
\n
# process searching by category\n
cats=[]\n
......@@ -108,7 +108,6 @@ if kw.has_key(\'SearchableText\'):\n
kw[\'full_text.SearchableText\']=kw[\'SearchableText\']\n
kw.pop(\'SearchableText\')\n
\n
# this will go out, most likely\n
cf=kw.get(\'creation_from\')\n
ct=kw.get(\'creation_to\')\n
mf=kw.get(\'modification_from\')\n
......
......@@ -243,7 +243,7 @@
</item>
<item>
<key> <string>hash_script_id</string> </key>
<value> <string>DMSBaseCategoryHash</string> </value>
<value> <string>Base_hashDocumentCategoryItemList</string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
......@@ -299,7 +299,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.portal_preferences.default_site_preference.getPreferredDmsBaseCategoryList() or []</string> </value>
<value> <string>here/Base_getDocumentCategoryItemList</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -12,6 +12,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_dms_category_list</string> </value>
......
......@@ -12,6 +12,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_dms_category_list</string> </value>
......
......@@ -5,13 +5,19 @@
<tuple>
<tuple>
<string>Products.Formulator.StandardFields</string>
<string>TextAreaField</string>
<string>LinesField</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_subject_list</string> </value>
......@@ -111,6 +117,10 @@
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>view_separator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
......@@ -190,6 +200,10 @@
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>view_separator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
......@@ -215,7 +229,9 @@
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
<value>
<list/>
</value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -269,6 +285,14 @@
<key> <string>unicode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>view_separator</string> </key>
<value> <string encoding="cdata"><![CDATA[
<br />
]]></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
......
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