<?xml version="1.0"?>
<ZopeData>
  <record id="1" aka="AAAAAAAAAAE=">
    <pickle>
      <tuple>
        <tuple>
          <string>Products.PythonScripts.PythonScript</string>
          <string>PythonScript</string>
        </tuple>
        <none/>
      </tuple>
    </pickle>
    <pickle>
      <dictionary>
        <item>
            <key> <string>Python_magic</string> </key>
            <value>
              <none/>
            </value>
        </item>
        <item>
            <key> <string>Script_magic</string> </key>
            <value> <int>3</int> </value>
        </item>
        <item>
            <key> <string>__ac_local_roles__</string> </key>
            <value>
              <none/>
            </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>portal = context.getPortalObject()\n
if clear_catalog:\n
  # clear the catalog before reindexing\n
  catalog = portal.portal_catalog.getSQLCatalog(sql_catalog_id)\n
  catalog.manage_catalogClear()\n
  # redirect to commit transaction\n
  from ZTUtils import make_query\n
  query_kw={\'passive_commit\': passive_commit}\n
  if sql_catalog_id:\n
    # XXX make_query doesn\'t support None as an argument\n
    query_kw[\'sql_catalog_id\'] = sql_catalog_id\n
  qstring = make_query(**query_kw)\n
  return context.REQUEST.RESPONSE.redirect(\n
              \'%s?%s\' % (script.absolute_url(), qstring))\n
\n
print "#### Indexing person_module, stage 1 ####"\n
person_module=getattr(portal, \'person_module\', None)\n
if person_module is not None :\n
  person_module.reindexObject(tag=\'person_stage_1\',\n
                              sql_catalog_id=sql_catalog_id,\n
                              passive_commit=passive_commit)\n
  for o in person_module.objectValues():\n
    o.recursiveReindexObject(tag=\'person_stage_1\',\n
                             sql_catalog_id=sql_catalog_id,\n
                             passive_commit=passive_commit)\n
\n
print "#### Indexing translations ####"\n
context.ERP5Site_updateTranslationTable(sql_catalog_id=sql_catalog_id)\n
\n
print "#### Indexing categories ####"\n
context.portal_categories.reindexObject(tag=\'module\',\n
                                        after_tag=(\'person_stage_1\', ),\n
                                        sql_catalog_id=sql_catalog_id,\n
                                        passive_commit=passive_commit)\n
for o in context.portal_categories.objectValues():\n
  o.recursiveReindexObject(after_tag=(\'module\', \'person_stage_1\', ),\n
                           tag=\'category\',\n
                           sql_catalog_id=sql_catalog_id,\n
                           passive_commit=passive_commit)\n
\n
print "#### Indexing alarms ####"\n
context.portal_alarms.reindexObject(tag=\'module\',\n
                                    after_tag=(\'person_stage_1\', ),\n
                                    sql_catalog_id=sql_catalog_id,\n
                                    passive_commit=passive_commit)\n
for o in context.portal_alarms.objectValues():\n
  o.recursiveReindexObject(after_tag=(\'module\',\'category\', \'person_stage_1\'),\n
                           tag=\'document\',\n
                           priority=2,\n
                           sql_catalog_id=sql_catalog_id,\n
                           passive_commit=passive_commit)\n
\n
print "#### Indexing preferences ####"\n
context.portal_preferences.reindexObject(tag=\'module\',\n
                                         after_tag=(\'person_stage_1\', ),\n
                                         sql_catalog_id=sql_catalog_id,\n
                                         passive_commit=passive_commit)\n
for o in context.portal_preferences.objectValues():\n
  o.recursiveReindexObject(after_tag=(\'module\',\'category\', \'person_stage_1\'),\n
                           tag=\'document\',\n
                           priority=2,\n
                           sql_catalog_id=sql_catalog_id,\n
                           passive_commit=passive_commit)\n
\n
# We index simulation first to make sure we can calculate tests\n
# (ie. related quantity)\n
print "#### Indexing simulation ####"\n
context.portal_simulation.reindexObject(tag=\'module\',\n
                                        after_tag=(\'person_stage_1\', ),\n
                                        sql_catalog_id=sql_catalog_id,\n
                                        passive_commit=passive_commit)\n
for o in context.portal_simulation.objectValues():\n
  o.recursiveReindexObject(after_tag=(\'module\', \'category\',\n
                                      \'document\', \'person_stage_1\'),\n
                           tag=\'simulation\',\n
                           priority=3,\n
                           sql_catalog_id=sql_catalog_id,\n
                           passive_commit=passive_commit)\n
\n
# We index templates secondly\n
print "#### Indexing templates ####"\n
context.portal_templates.reindexObject(tag=\'module\',\n
                                       after_tag=(\'person_stage_1\', ),\n
                                       sql_catalog_id=sql_catalog_id,\n
                                       passive_commit=passive_commit)\n
for o in context.portal_templates.objectValues():\n
  o.reindexObject(after_tag=(\'module\', \'category\', \'person_stage_1\'),\n
                  tag=\'document\',\n
                  priority=2,\n
                  sql_catalog_id=sql_catalog_id,\n
                  passive_commit=passive_commit)\n
\n
# Next we index trash bins\n
print "#### Indexing trash bins ####"\n
context.portal_trash.reindexObject(tag=\'module\',\n
                                   after_tag=(\'person_stage_1\', ),\n
                                   sql_catalog_id=sql_catalog_id,\n
                                   passive_commit=passive_commit)\n
for o in context.portal_trash.objectValues():\n
  o.reindexObject(after_tag=(\'module\', \'category\', \'person_stage_1\'),\n
                  tag=\'document\',\n
                  priority=2,\n
                  sql_catalog_id=sql_catalog_id,\n
                  passive_commit=passive_commit)\n
\n
# Next we index domains\n
print "#### Indexing domains ####"\n
context.portal_domains.reindexObject(tag=\'module\',\n
                                     after_tag=(\'person_stage_1\', ),\n
                                     sql_catalog_id=sql_catalog_id,\n
                                     passive_commit=passive_commit)\n
for o in context.portal_domains.objectValues():\n
  o.reindexObject(after_tag=(\'module\', \'category\', \'person_stage_1\'),\n
                  tag=\'document\',\n
                  priority=2,\n
                  sql_catalog_id=sql_catalog_id,\n
                  passive_commit=passive_commit)\n
\n
# Next we index applied rules\n
print "#### Indexing applied rules ####"\n
context.portal_rules.reindexObject(tag=\'module\',\n
                                   after_tag=(\'person_stage_1\', ),\n
                                   sql_catalog_id=sql_catalog_id,\n
                                   passive_commit=passive_commit)\n
for o in context.portal_rules.objectValues():\n
  o.recursiveReindexObject(after_tag=(\'module\',\'category\', \'person_stage_1\'),\n
                           tag=\'document\',\n
                           priority=2,\n
                           sql_catalog_id=sql_catalog_id,\n
                           passive_commit=passive_commit)\n
\n
# Next we index delivery builders\n
print "#### Indexing delivery builders ####"\n
context.portal_deliveries.reindexObject(tag=\'module\',\n
                                        after_tag=(\'person_stage_1\', ),\n
                                        sql_catalog_id=sql_catalog_id,\n
                                        passive_commit=passive_commit)\n
for o in context.portal_deliveries.objectValues():\n
  o.reindexObject(after_tag=(\'module\', \'category\', \'person_stage_1\'),\n
                  tag=\'document\',\n
                  priority=2,\n
                  sql_catalog_id=sql_catalog_id,\n
                  passive_commit=passive_commit)\n
\n
# Next we index order builders\n
print "#### Indexing order builders ####"\n
context.portal_orders.reindexObject(tag=\'module\',\n
                                    after_tag=(\'person_stage_1\', ),\n
                                    sql_catalog_id=sql_catalog_id,\n
                                    passive_commit=passive_commit)\n
for o in context.portal_orders.objectValues():\n
  o.reindexObject(after_tag=(\'module\',\'category\', \'person_stage_1\'),\n
                  tag=\'document\',\n
                  priority=2,\n
                  sql_catalog_id=sql_catalog_id,\n
                  passive_commit=passive_commit)\n
\n
# Then we index everything except inventories\n
for folder in portal.objectValues(("ERP5 Folder",)):\n
  print "#### Indexing contents inside folder %s ####" % folder.id\n
  if folder.getId() not in (\'inventory_module\',):\n
    folder.reindexObject(tag=\'module\',\n
                         after_tag=(\'person_stage_1\', ),\n
                         sql_catalog_id=sql_catalog_id,\n
                         passive_commit=passive_commit)\n
    for o in folder.objectValues():\n
      try:\n
        o.recursiveReindexObject(after_tag=(\'module\', \'category\',\n
                                            \'person_stage_1\'),\n
                                 tag=\'document\',\n
                                 priority=2,\n
                                 sql_catalog_id=sql_catalog_id,\n
                                 passive_commit=passive_commit)\n
      except:\n
        context.log(\'Unable to reindex\', \'error: folder=%s, o=%s\' %\n
                                      (repr(folder.getId()), repr(o)))\n
        raise\n
\n
# Then we index inventories\n
for folder in portal.objectValues(("ERP5 Folder",)):\n
  if folder.getId() in (\'inventory_module\',):\n
    print "#### Indexing contents inside folder %s ####" % folder.id\n
    folder.reindexObject(tag=\'module\',\n
                         after_tag=(\'person_stage_1\', ),\n
                         sql_catalog_id=sql_catalog_id,\n
                         passive_commit=passive_commit)\n
    for o in folder.objectValues():\n
      o.recursiveReindexObject(after_tag=(\'module\', \'document\',\n
                                          \'category\', \'person_stage_1\'),\n
                              tag=\'inventory\',\n
                              priority=2,\n
                              sql_catalog_id=sql_catalog_id,\n
                              passive_commit=passive_commit)\n
\n
# start activty from simulation because the erp5site is not an active object\n
context.portal_simulation.activate(\n
      after_tag=(\'inventory\', \'simulation\', \'person_stage_1\'),\n
      priority=3\n
      ).InventoryModule_reindexMovementList(\n
                            sql_catalog_id=sql_catalog_id,\n
                            passive_commit=passive_commit)\n
\n
return printed\n
</string> </value>
        </item>
        <item>
            <key> <string>_code</string> </key>
            <value>
              <none/>
            </value>
        </item>
        <item>
            <key> <string>_dav_writelocks</string> </key>
            <value>
              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
            </value>
        </item>
        <item>
            <key> <string>_filepath</string> </key>
            <value>
              <none/>
            </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
            <value> <string>sql_catalog_id=None, passive_commit=1, clear_catalog=0</string> </value>
        </item>
        <item>
            <key> <string>errors</string> </key>
            <value>
              <tuple/>
            </value>
        </item>
        <item>
            <key> <string>func_code</string> </key>
            <value>
              <object>
                <klass>
                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
                </klass>
                <tuple/>
                <state>
                  <dictionary>
                    <item>
                        <key> <string>co_argcount</string> </key>
                        <value> <int>3</int> </value>
                    </item>
                    <item>
                        <key> <string>co_varnames</string> </key>
                        <value>
                          <tuple>
                            <string>sql_catalog_id</string>
                            <string>passive_commit</string>
                            <string>clear_catalog</string>
                            <string>_print_</string>
                            <string>_print</string>
                            <string>_getattr_</string>
                            <string>context</string>
                            <string>portal</string>
                            <string>catalog</string>
                            <string>ZTUtils</string>
                            <string>make_query</string>
                            <string>query_kw</string>
                            <string>_write_</string>
                            <string>_apply_</string>
                            <string>qstring</string>
                            <string>script</string>
                            <string>getattr</string>
                            <string>None</string>
                            <string>person_module</string>
                            <string>_getiter_</string>
                            <string>o</string>
                            <string>folder</string>
                            <string>repr</string>
                          </tuple>
                        </value>
                    </item>
                  </dictionary>
                </state>
              </object>
            </value>
        </item>
        <item>
            <key> <string>func_defaults</string> </key>
            <value>
              <tuple>
                <none/>
                <int>1</int>
                <int>0</int>
              </tuple>
            </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>ERP5Site_reindexAll</string> </value>
        </item>
        <item>
            <key> <string>warnings</string> </key>
            <value>
              <tuple/>
            </value>
        </item>
      </dictionary>
    </pickle>
  </record>
  <record id="2" aka="AAAAAAAAAAI=">
    <pickle>
      <tuple>
        <tuple>
          <string>Persistence</string>
          <string>PersistentMapping</string>
        </tuple>
        <none/>
      </tuple>
    </pickle>
    <pickle>
      <dictionary>
        <item>
            <key> <string>_container</string> </key>
            <value>
              <dictionary/>
            </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
