Commit 061549e4 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

fixup: ERP5Site_reindexAll now reindexes everything all tools in portal and...

fixup: ERP5Site_reindexAll now reindexes everything all tools in portal and all ERP5 Python Scripts under portal_skins.
parent 9f1937f0
...@@ -155,45 +155,18 @@ context.portal_simulation.activate(\n ...@@ -155,45 +155,18 @@ context.portal_simulation.activate(\n
start_tree=start_tree,\n start_tree=start_tree,\n
stop_tree=stop_tree,)\n stop_tree=stop_tree,)\n
\n \n
# We index templates secondly\n # We index tools secondly\n
print "#### Indexing templates ####"\n print "#### Indexing tools ####"\n
# Next we index trash bins\n
print "#### Indexing trash bins ####"\n
# Next we index domains\n
print "#### Indexing domains ####"\n
# Next we index applied rules\n
print "#### Indexing applied rules ####"\n
# Next we index delivery builders\n
print "#### Indexing delivery builders ####"\n
# Next we index order builders\n
print "#### Indexing order builders ####"\n
# Next we index portal types\n
print "#### Indexing portal types ####"\n
# Next we index portal_property_sheets\n
print "#### Indexing portal property sheets ####"\n
\n \n
folder_tag = \'module\'\n folder_tag = \'module\'\n
folder_after_tag = (\'category\', \'person_stage_1\', \'group_person_stage_1\', preference_tag)\n folder_after_tag = (\'category\', \'person_stage_1\', \'group_person_stage_1\', preference_tag)\n
object_tag = \'document\'\n object_tag = \'document\'\n
object_after_tag = folder_after_tag\n object_after_tag = folder_after_tag\n
object_priority = 2 + additional_priority\n object_priority = 2 + additional_priority\n
tool_list = [portal.portal_templates, portal.portal_trash,\n tool_list = [x for x in portal.objectValues() if \\\n
portal.portal_domains, portal.portal_rules,\n x.getUid != portal.getUid and \\\n
portal.portal_deliveries, portal.portal_orders,\n x.meta_type != \'ERP5 Folder\' and \\\n
portal.portal_caches, portal.portal_types,\n x.id not in (\'portal_alarms\', \'portal_activities\', \'portal_preferences\', \'portal_simulation\', \'portal_uidhandler\')]\n
portal.portal_property_sheets,\n
portal.portal_ids, portal.portal_memcached,]\n
possible_tool_list = [\n
\'portal_contribution_registry\',\n
\'portal_contributions\',\n
\'portal_gadgets\',\n
\'portal_integrations\',\n
\'portal_roundings\',\n
\'portal_solvers\',\n
]\n
for tool_id in possible_tool_list:\n
if getattr(portal, tool_id, None) is not None:\n
tool_list.append(getattr(portal, tool_id))\n
\n \n
for folder in tool_list:\n for folder in tool_list:\n
folder.activate(\n folder.activate(\n
...@@ -209,6 +182,13 @@ for folder in tool_list:\n ...@@ -209,6 +182,13 @@ for folder in tool_list:\n
start_tree=start_tree,\n start_tree=start_tree,\n
stop_tree=stop_tree,)\n stop_tree=stop_tree,)\n
\n \n
# Then we index ERP5 Python Scripts\n
print "#### Indexing ERP5 Python Scripts ####"\n
for path, obj in portal.portal_skins.ZopeFind(portal.portal_skins, obj_metatypes=(\'ERP5 Python Script\',), search_sub=1):\n
obj.activate(tag=folder_tag,\n
priority=object_priority,\n
after_tag=folder_after_tag).immediateReindexObject(sql_catalog_id=sql_catalog_id)\n
\n
# Then we index everything except inventories\n # Then we index everything except inventories\n
for folder in portal.objectValues(("ERP5 Folder",)):\n for folder in portal.objectValues(("ERP5 Folder",)):\n
if folder.getId().find(\'inventory\') < 0:\n if folder.getId().find(\'inventory\') < 0:\n
......
41057 41060
\ No newline at end of file \ No newline at end of file
...@@ -463,6 +463,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -463,6 +463,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
title="GreatTitle2") title="GreatTitle2")
# Flush message queue # Flush message queue
self.tic() self.tic()
original_path_list = self.getSQLPathList()
# Clear catalog # Clear catalog
portal_catalog = self.getCatalogTool() portal_catalog = self.getCatalogTool()
portal_catalog.manage_catalogClear() portal_catalog.manage_catalogClear()
...@@ -482,10 +483,9 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -482,10 +483,9 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
result = sql_connection.manage_test(sql) result = sql_connection.manage_test(sql)
message_count = result[0]['COUNT(*)'] message_count = result[0]['COUNT(*)']
self.assertEquals(0, message_count) self.assertEquals(0, message_count)
# Check if object are catalogued # Check if all objects are catalogued as before
self.checkRelativeUrlInSQLPathList([ new_path_list = self.getSQLPathList()
organisation.getRelativeUrl(), self.assertEquals(set(original_path_list) - set(new_path_list), set())
'portal_categories/%s' % base_category.getRelativeUrl()])
def test_14_ReindexWithBrokenCategory(self, quiet=quiet, run=run_all_test): def test_14_ReindexWithBrokenCategory(self, quiet=quiet, run=run_all_test):
if not run: return if not run: return
...@@ -1531,6 +1531,9 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -1531,6 +1531,9 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
# Flush message queue # Flush message queue
self.tic() self.tic()
original_path_list = self.getSQLPathList(self.original_connection_id)
new_path_list = self.getSQLPathList(self.new_connection_id)
self.assertEquals(set(original_path_list) - set(new_path_list), set())
self.organisation2 = module.newContent(portal_type='Organisation', self.organisation2 = module.newContent(portal_type='Organisation',
title="GreatTitle2") title="GreatTitle2")
first_deleted_url = self.organisation2.getRelativeUrl() first_deleted_url = self.organisation2.getRelativeUrl()
......
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