From 02f3c08f18aed9001ee216105bdaaa8dfc0b0254 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Tue, 21 Oct 2008 14:04:08 +0000
Subject: [PATCH] reindex portal caches, and portal gadget if present

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24271 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../erp5_core/ERP5Site_reindexAll.xml             | 15 +++++++++++----
 product/ERP5/bootstrap/erp5_core/bt/revision      |  2 +-
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_reindexAll.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_reindexAll.xml
index 0048d64691..f7a204e8e3 100644
--- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_reindexAll.xml
+++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_reindexAll.xml
@@ -55,7 +55,7 @@
             <key> <string>_body</string> </key>
             <value> <string encoding="cdata"><![CDATA[
 
-portal = context.getPortalObject()  \n
+portal = context.getPortalObject()\n
 if clear_catalog:\n
   # clear the catalog before reindexing\n
   catalog = portal.portal_catalog.getSQLCatalog(sql_catalog_id)\n
@@ -159,9 +159,14 @@ folder_after_tag = (\'category\', \'person_stage_1\', \'group_person_stage_1\')\
 object_tag = \'document\'\n
 object_after_tag = folder_after_tag\n
 object_priority = 2 + additional_priority\n
-for folder in [context.portal_templates, context.portal_trash,\n
-               context.portal_domains, context.portal_rules,\n
-               context.portal_deliveries, context.portal_orders]:\n
+tool_list = [portal.portal_templates, portal.portal_trash,\n
+             portal.portal_domains, portal.portal_rules,\n
+             portal.portal_deliveries, portal.portal_orders,\n
+             portal.portal_caches]\n
+if hasattr(portal, \'portal_gadgets\'):\n
+  tool_list.append(portal.portal_gadgets)\n
+\n
+for folder in tool_list:\n
   folder.activate(\n
                     tag=folder_tag,\n
                     priority=object_priority,\n
@@ -296,6 +301,8 @@ return printed\n
                             <string>object_priority</string>
                             <string>_getiter_</string>
                             <string>folder</string>
+                            <string>tool_list</string>
+                            <string>hasattr</string>
                           </tuple>
                         </value>
                     </item>
diff --git a/product/ERP5/bootstrap/erp5_core/bt/revision b/product/ERP5/bootstrap/erp5_core/bt/revision
index b7e8805f4f..6242099cf1 100644
--- a/product/ERP5/bootstrap/erp5_core/bt/revision
+++ b/product/ERP5/bootstrap/erp5_core/bt/revision
@@ -1 +1 @@
-991
\ No newline at end of file
+992
\ No newline at end of file
-- 
2.30.9