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
<?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 @@ ...@@ -121,7 +121,7 @@
<string>my_layout_display_header_title_widget</string> <string>my_layout_display_header_title_widget</string>
<string>my_layout_display_toolbar_widget</string> <string>my_layout_display_toolbar_widget</string>
<string>my_layout_display_search_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> <string>my_layout_display_anonymous_user_registration</string>
</list> </list>
</value> </value>
......
...@@ -11,13 +11,15 @@ ...@@ -11,13 +11,15 @@
<value> <value>
<list> <list>
<string>description</string> <string>description</string>
<string>items</string>
<string>size</string>
<string>title</string> <string>title</string>
</list> </list>
</value> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <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>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
...@@ -53,6 +55,10 @@ ...@@ -53,6 +55,10 @@
<key> <string>tales</string> </key> <key> <string>tales</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -61,10 +67,24 @@ ...@@ -61,10 +67,24 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </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> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -78,12 +98,22 @@ ...@@ -78,12 +98,22 @@
</item> </item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value> <value> <string>my_multi_list_field</string> </value>
</item> </item>
<item> <item>
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value> <value> <string>Base_viewFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>5</int> </value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
...@@ -98,4 +128,17 @@ ...@@ -98,4 +128,17 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </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> </ZopeData>
...@@ -118,9 +118,7 @@ ...@@ -118,9 +118,7 @@
</item> </item>
<item> <item>
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <value> <string></string> </value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -133,7 +131,7 @@ ...@@ -133,7 +131,7 @@
<item> <item>
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -154,14 +152,12 @@ ...@@ -154,14 +152,12 @@
</item> </item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <value> <string></string> </value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>items</string> </key> <key> <string>items</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -268,19 +264,6 @@ ...@@ -268,19 +264,6 @@
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <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> <pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/> <global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle> </pickle>
...@@ -293,20 +276,7 @@ ...@@ -293,20 +276,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="4" aka="AAAAAAAAAAQ="> <record id="3" aka="AAAAAAAAAAM=">
<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=">
<pickle> <pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/> <global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle> </pickle>
...@@ -314,7 +284,7 @@ ...@@ -314,7 +284,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <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> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
1727 1728
\ 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