parameters: (self, migration_generate_id_method=None, new_generate_id_method='_generatePerDayId', bundle_count=10, REQUEST=None)
docstring: Function to migrate from a BTree folder to HBTree folder.
      It will first call setId on all folder objects to have right id
      to be used with an hbtreefolder.
      Then it will migrate foder from btree to hbtree.
docstring_summary: Function to migrate from a BTree folder to HBTree folder.
      It will first call setId on all folder objects to have right id
      to be used with an hbtreefolder.
      Then it will migrate foder from btree to hbtree.
docstring_tokens: Function to migrate from a BTree folder to HBTree folder . It will first call setId on all folder objects to have right id to be used with an hbtreefolder . Then it will migrate foder from btree to hbtree .
function: def migrateToHBTree(self, migration_generate_id_method=None, new_generate_id_method='_generatePerDayId', bundle_count=10, REQUEST=None):
      """
      Function to migrate from a BTree folder to HBTree folder.
      It will first call setId on all folder objects to have right id
      to be used with an hbtreefolder.
      Then it will migrate foder from btree to hbtree.
      """
  
      # if folder is already migrated or migration process is in progress
      # do not do anything beside logging
      if self._migration_in_progress or self.isHBTree():
        LOG('migrateToHBTree', WARNING,
          'Folder %s already migrated'%(self.getPath(),))
        return
      # lock folder migration
      self._migration_in_progress = True
  
      # we may want to change all objects ids before migrating to new folder type
      # set new id generator here so that object created while migration
      # got a right id
      if new_generate_id_method is not None:
        self.setIdGenerator(new_generate_id_method)
      if migration_generate_id_method not in (None, ''):
        tag = "%s/%s/migrate" %(self.getId(),migration_generate_id_method)
        id_list  = list(self.objectIds())
        # set new id by bundle
        for x in xrange(len(self) / bundle_count):
          self.activate(activity="SQLQueue", tag=tag, priority=3, serialization_tag='ERP5Site_setNewIdPerBundle').ERP5Site_setNewIdPerBundle(
            self.getPath(),
            id_list[x*bundle_count:(x+1)*bundle_count],
            migration_generate_id_method, tag)
  
        remaining_id_count = len(self) % bundle_count
        if remaining_id_count:
          self.activate(activity="SQLQueue", tag=tag, priority=3, serialization_tag='ERP5Site_setNewIdPerBundle').ERP5Site_setNewIdPerBundle(
            self.getPath(),
            id_list[-remaining_id_count:],
            migration_generate_id_method, tag)
      else:
        tag = 'nothing'
      # copy from btree to hbtree
      self.activate(activity="SQLQueue", after_tag=tag)._launchCopyObjectToHBTree(tag)
  
      if REQUEST is not None:
        psm = translateString('Migration to HBTree is running.')
        ret_url = '%s/%s?portal_status_message=%s' % \
                  (self.absolute_url(),
                   REQUEST.get('form_id', 'view'), psm)
        return REQUEST.RESPONSE.redirect( ret_url )
function_tokens: def migrateToHBTree ( self , migration_generate_id_method = None , new_generate_id_method = '_generatePerDayId' , bundle_count = 10 , REQUEST = None ) : # if folder is already migrated or migration process is in progress # do not do anything beside logging if self . _migration_in_progress or self . isHBTree ( ) : LOG ( 'migrateToHBTree' , WARNING , 'Folder %s already migrated' % ( self . getPath ( ) , ) ) return # lock folder migration self . _migration_in_progress = True # we may want to change all objects ids before migrating to new folder type # set new id generator here so that object created while migration # got a right id if new_generate_id_method is not None : self . setIdGenerator ( new_generate_id_method ) if migration_generate_id_method not in ( None , '' ) : tag = "%s/%s/migrate" % ( self . getId ( ) , migration_generate_id_method ) id_list = list ( self . objectIds ( ) ) # set new id by bundle for x in xrange ( len ( self ) / bundle_count ) : self . activate ( activity = "SQLQueue" , tag = tag , priority = 3 , serialization_tag = 'ERP5Site_setNewIdPerBundle' ) . ERP5Site_setNewIdPerBundle ( self . getPath ( ) , id_list [ x * bundle_count : ( x + 1 ) * bundle_count ] , migration_generate_id_method , tag ) remaining_id_count = len ( self ) % bundle_count if remaining_id_count : self . activate ( activity = "SQLQueue" , tag = tag , priority = 3 , serialization_tag = 'ERP5Site_setNewIdPerBundle' ) . ERP5Site_setNewIdPerBundle ( self . getPath ( ) , id_list [ - remaining_id_count : ] , migration_generate_id_method , tag ) else : tag = 'nothing' # copy from btree to hbtree self . activate ( activity = "SQLQueue" , after_tag = tag ) . _launchCopyObjectToHBTree ( tag ) if REQUEST is not None : psm = translateString ( 'Migration to HBTree is running.' ) ret_url = '%s/%s?portal_status_message=%s' % ( self . absolute_url ( ) , REQUEST . get ( 'form_id' , 'view' ) , psm ) return REQUEST . RESPONSE . redirect ( ret_url )