Commit c28a0fa6 authored by Ivan Tyagov's avatar Ivan Tyagov

Make it possible to configure list of searchable portal types through web site configuration.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41707 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e682d5c8
No related merge requests found
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</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
This script prepares the list of portal types\n
which can be searched by a quick search.\n
\n
TODO:\n
- add support for domains so that the search types\n
can be easily configured\n
- assess caching performance (and more generally\n
assess performance of the KM pages so that\n
it becomes as fast as a Wiki)\n
"""\n
\n
translateString = context.Base_translateString\n
search_list = [(\'all\', \'All Documents\'),\n
(\'\', \'Everything\')]\n
\n
# Document Portal Types\n
search_list.append((\'\', \'-- Documents --\'))\n
for portal_type in context.getPortalDocumentTypeList():\n
search_list.append((portal_type, portal_type))\n
\n
# Directory\n
search_list.append((\'\', \'-- Directory --\'))\n
search_list.append((\'Person\', \'Person\'))\n
search_list.append((\'Organisation\', \'Organisation\'))\n
\n
search_list = map(lambda x: (translateString(x[1]), x[0]), search_list) \n
\n
return search_list\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebSite_getQuickSearchableTypeItemList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -121,7 +121,7 @@
<string>my_layout_display_header_title_widget</string>
<string>my_layout_display_toolbar_widget</string>
<string>my_layout_display_search_widget</string>
<string>my_layout_search_portal_type</string>
<string>my_layout_search_portal_type_list</string>
<string>my_layout_display_anonymous_user_registration</string>
</list>
</value>
......
......@@ -11,13 +11,15 @@
<value>
<list>
<string>description</string>
<string>items</string>
<string>size</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_layout_search_portal_type</string> </value>
<value> <string>my_layout_search_portal_type_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -53,6 +55,10 @@
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
......@@ -61,10 +67,24 @@
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>size</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
......@@ -78,12 +98,22 @@
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
<value> <string>my_multi_list_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>5</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
......@@ -98,4 +128,17 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [[x, x] for x in context.getPortalDocumentTypeList()]</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -118,9 +118,7 @@
</item>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -133,7 +131,7 @@
<item>
<key> <string>enabled</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
......@@ -154,14 +152,12 @@
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
......@@ -268,19 +264,6 @@
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: context.getLayoutProperty(\'layout_search_portal_type\',None)</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
......@@ -293,20 +276,7 @@
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: context.getLayoutProperty(\'layout_search_portal_type\',\'\') != \'\'</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
......@@ -314,7 +284,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/WebSite_getQuickSearchableTypeItemList</string> </value>
<value> <string>python:[[ context.Base_translateString(\'All Documents\'), \'all\'], [context.Base_translateString(\'Everything\'), \'\']] + [[context.Base_translateString(x), x] for x in context.getLayoutProperty(\'layout_search_portal_type_list\', [])]</string> </value>
</item>
</dictionary>
</pickle>
......
1727
\ No newline at end of file
1728
\ 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