Commit 28f00d2e authored by Aurel's avatar Aurel

allow to give start_tree and stop_tree id when reindexing HBTree folder in...

allow to give start_tree and stop_tree id when reindexing HBTree folder in order not to reindex all the module

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17559 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 39b89e89
...@@ -85,7 +85,10 @@ if person_module is not None :\n ...@@ -85,7 +85,10 @@ if person_module is not None :\n
object_tag=tag,\n object_tag=tag,\n
object_priority=higher_priority,\n object_priority=higher_priority,\n
sql_catalog_id=sql_catalog_id,\n sql_catalog_id=sql_catalog_id,\n
passive_commit=passive_commit)\n passive_commit=passive_commit,\n
start_tree=start_tree,\n
stop_tree=stop_tree,)\n
\n
\n \n
print "#### Indexing translations ####"\n print "#### Indexing translations ####"\n
context.ERP5Site_updateTranslationTable(sql_catalog_id=sql_catalog_id)\n context.ERP5Site_updateTranslationTable(sql_catalog_id=sql_catalog_id)\n
...@@ -107,7 +110,7 @@ context.portal_categories.activate(\n ...@@ -107,7 +110,7 @@ context.portal_categories.activate(\n
object_after_tag=object_after_tag,\n object_after_tag=object_after_tag,\n
object_priority=higher_priority,\n object_priority=higher_priority,\n
sql_catalog_id=sql_catalog_id,\n sql_catalog_id=sql_catalog_id,\n
passive_commit=passive_commit)\n passive_commit=passive_commit,)\n
\n \n
print "#### Indexing alarms ####"\n print "#### Indexing alarms ####"\n
print "#### Indexing preferences ####"\n print "#### Indexing preferences ####"\n
...@@ -127,7 +130,7 @@ for folder in [context.portal_alarms, context.portal_preferences]:\n ...@@ -127,7 +130,7 @@ for folder in [context.portal_alarms, context.portal_preferences]:\n
object_after_tag=object_after_tag,\n object_after_tag=object_after_tag,\n
object_priority=object_priority,\n object_priority=object_priority,\n
sql_catalog_id=sql_catalog_id,\n sql_catalog_id=sql_catalog_id,\n
passive_commit=passive_commit)\n passive_commit=passive_commit,)\n
\n \n
# We index simulation first to make sure we can calculate tests\n # We index simulation first to make sure we can calculate tests\n
# (ie. related quantity)\n # (ie. related quantity)\n
...@@ -147,7 +150,7 @@ context.portal_simulation.activate(\n ...@@ -147,7 +150,7 @@ context.portal_simulation.activate(\n
object_after_tag=object_after_tag,\n object_after_tag=object_after_tag,\n
object_priority=higher_priority,\n object_priority=higher_priority,\n
sql_catalog_id=sql_catalog_id,\n sql_catalog_id=sql_catalog_id,\n
passive_commit=passive_commit)\n passive_commit=passive_commit,)\n
\n \n
# We index templates secondly\n # We index templates secondly\n
print "#### Indexing templates ####"\n print "#### Indexing templates ####"\n
...@@ -180,7 +183,7 @@ for folder in [context.portal_templates, context.portal_trash,\n ...@@ -180,7 +183,7 @@ for folder in [context.portal_templates, context.portal_trash,\n
object_after_tag=object_after_tag,\n object_after_tag=object_after_tag,\n
object_priority=object_priority,\n object_priority=object_priority,\n
sql_catalog_id=sql_catalog_id,\n sql_catalog_id=sql_catalog_id,\n
passive_commit=passive_commit)\n passive_commit=passive_commit,)\n
\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
...@@ -196,7 +199,9 @@ for folder in portal.objectValues(("ERP5 Folder",)):\n ...@@ -196,7 +199,9 @@ for folder in portal.objectValues(("ERP5 Folder",)):\n
object_after_tag=object_after_tag,\n object_after_tag=object_after_tag,\n
object_priority=object_priority,\n object_priority=object_priority,\n
sql_catalog_id=sql_catalog_id,\n sql_catalog_id=sql_catalog_id,\n
passive_commit=passive_commit)\n passive_commit=passive_commit,\n
start_tree=start_tree,\n
stop_tree=stop_tree,)\n
\n \n
# Then we index inventories\n # Then we index inventories\n
object_tag = \'inventory\'\n object_tag = \'inventory\'\n
...@@ -214,7 +219,9 @@ for folder in portal.objectValues(("ERP5 Folder",)):\n ...@@ -214,7 +219,9 @@ for folder in portal.objectValues(("ERP5 Folder",)):\n
object_after_tag=object_after_tag,\n object_after_tag=object_after_tag,\n
object_priority=object_priority,\n object_priority=object_priority,\n
sql_catalog_id=sql_catalog_id,\n sql_catalog_id=sql_catalog_id,\n
passive_commit=passive_commit)\n passive_commit=passive_commit,\n
start_tree=start_tree,\n
stop_tree=stop_tree,)\n
\n \n
# start activty from simulation because the erp5site is not an active object\n # start activty from simulation because the erp5site is not an active object\n
context.portal_simulation.activate(\n context.portal_simulation.activate(\n
...@@ -261,7 +268,7 @@ return printed\n ...@@ -261,7 +268,7 @@ return printed\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>sql_catalog_id=None, additional_priority=0, passive_commit=1, clear_catalog=0, final_activity_tag=None</string> </value> <value> <string>sql_catalog_id=None, additional_priority=0, passive_commit=1, clear_catalog=0, final_activity_tag=None, start_tree=None, stop_tree=None</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -281,7 +288,7 @@ return printed\n ...@@ -281,7 +288,7 @@ return printed\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>5</int> </value> <value> <int>7</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
...@@ -292,6 +299,8 @@ return printed\n ...@@ -292,6 +299,8 @@ return printed\n
<string>passive_commit</string> <string>passive_commit</string>
<string>clear_catalog</string> <string>clear_catalog</string>
<string>final_activity_tag</string> <string>final_activity_tag</string>
<string>start_tree</string>
<string>stop_tree</string>
<string>_print_</string> <string>_print_</string>
<string>_print</string> <string>_print</string>
<string>_getattr_</string> <string>_getattr_</string>
...@@ -327,6 +336,8 @@ return printed\n ...@@ -327,6 +336,8 @@ return printed\n
<int>1</int> <int>1</int>
<int>0</int> <int>0</int>
<none/> <none/>
<none/>
<none/>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -122,11 +122,29 @@ except (NotImplementedError, AttributeError):\n ...@@ -122,11 +122,29 @@ except (NotImplementedError, AttributeError):\n
id_list_list = []\n id_list_list = []\n
for bundle_index in xrange(len(id_list) / BUNDLE_ITEM_COUNT):\n for bundle_index in xrange(len(id_list) / BUNDLE_ITEM_COUNT):\n
id_list_list.append(id_list[bundle_index * BUNDLE_ITEM_COUNT:((bundle_index + 1) * BUNDLE_ITEM_COUNT)])\n id_list_list.append(id_list[bundle_index * BUNDLE_ITEM_COUNT:((bundle_index + 1) * BUNDLE_ITEM_COUNT)])\n
\n
remaining_object_id_count = len(id_list) % BUNDLE_ITEM_COUNT\n remaining_object_id_count = len(id_list) % BUNDLE_ITEM_COUNT\n
if remaining_object_id_count > 0:\n if remaining_object_id_count > 0:\n
id_list_list.append(id_list[-remaining_object_id_count:])\n id_list_list.append(id_list[-remaining_object_id_count:])\n
Folder_reindexObjectList(id_list_list)\n Folder_reindexObjectList(id_list_list)\n
else:\n else: \n
if start_tree is not None:\n
new_tree_id_list = [] \n
for tree_id in tree_id_list:\n
if tree_id >= start_tree:\n
new_tree_id_list.append(tree_id)\n
tree_id_list = new_tree_id_list\n
\n
if stop_tree is not None:\n
new_tree_id_list = [] \n
for tree_id in tree_id_list:\n
if tree_id < stop_tree:\n
new_tree_id_list.append(tree_id)\n
tree_id_list = new_tree_id_list\n
\n
if len(tree_id_list) == 0:\n
return\n
\n
i = 0\n i = 0\n
\n \n
tree_tag = "%s_tree" % folder_id\n tree_tag = "%s_tree" % folder_id\n
...@@ -183,7 +201,7 @@ else:\n ...@@ -183,7 +201,7 @@ else:\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>folder_tag=None, folder_after_tag=None, object_tag=None, object_after_tag=None, object_priority=1, sql_catalog_id=None, passive_commit=1</string> </value> <value> <string>folder_tag=None, folder_after_tag=None, object_tag=None, object_after_tag=None, object_priority=1, sql_catalog_id=None, passive_commit=1, start_tree=None, stop_tree=None</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -203,7 +221,7 @@ else:\n ...@@ -203,7 +221,7 @@ else:\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>7</int> </value> <value> <int>9</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
...@@ -216,6 +234,8 @@ else:\n ...@@ -216,6 +234,8 @@ else:\n
<string>object_priority</string> <string>object_priority</string>
<string>sql_catalog_id</string> <string>sql_catalog_id</string>
<string>passive_commit</string> <string>passive_commit</string>
<string>start_tree</string>
<string>stop_tree</string>
<string>context</string> <string>context</string>
<string>folder</string> <string>folder</string>
<string>activate_kw</string> <string>activate_kw</string>
...@@ -242,6 +262,8 @@ else:\n ...@@ -242,6 +262,8 @@ else:\n
<string>bundle_index</string> <string>bundle_index</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>remaining_object_id_count</string> <string>remaining_object_id_count</string>
<string>new_tree_id_list</string>
<string>tree_id</string>
<string>i</string> <string>i</string>
<string>tree_tag</string> <string>tree_tag</string>
<string>tree_after_tag</string> <string>tree_after_tag</string>
...@@ -268,6 +290,8 @@ else:\n ...@@ -268,6 +290,8 @@ else:\n
<int>1</int> <int>1</int>
<none/> <none/>
<int>1</int> <int>1</int>
<none/>
<none/>
</tuple> </tuple>
</value> </value>
</item> </item>
......
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