[Erp5-report] r17679 - /erp5/trunk/products/ZSQLCatalog/ZSQLCatalog.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Nov 19 11:46:13 CET 2007
Author: aurel
Date: Mon Nov 19 11:46:13 2007
New Revision: 17679
URL: http://svn.erp5.org?rev=17679&view=rev
Log:
typo fix
do not put in current catalog when archiving as it must be already
catalogged object in previous archive
cancel archive used as current catalog at the end of archiving
Modified:
erp5/trunk/products/ZSQLCatalog/ZSQLCatalog.py
Modified: erp5/trunk/products/ZSQLCatalog/ZSQLCatalog.py
URL: http://svn.erp5.org/erp5/trunk/products/ZSQLCatalog/ZSQLCatalog.py?rev=17679&r1=17678&r2=17679&view=diff
==============================================================================
--- erp5/trunk/products/ZSQLCatalog/ZSQLCatalog.py (original)
+++ erp5/trunk/products/ZSQLCatalog/ZSQLCatalog.py Mon Nov 19 11:46:13 2007
@@ -283,10 +283,22 @@
"""
Exchange databases and finish reindexing in the same transaction.
"""
+ default_catalog_id = self.default_sql_catalog_id
self.exchangeDatabases(source_sql_catalog_id=source_sql_catalog_id,
destination_sql_catalog_id=destination_sql_catalog_id,
skin_selection_dict=skin_selection_dict,
sql_connection_id_dict=sql_connection_id_dict)
+ # cancel archive use as current catalog before archive
+ if self.archive_path is not None and \
+ getattr(self, "portal_archives", None) is not None:
+ if len(self.portal_archives):
+ archive_list = self.portal_archives.getArchiveList()
+ for archive_path in archive_list:
+ archive = self.unrestrictedTraverse(archive_path)
+ if archive.getCatalogId() == default_catalog_id:
+ # this is the current catalog used for archiving
+ archive.cancel()
+
self.setHotReindexingState(state=HOT_REINDEXING_FINISHED_STATE)
clearCache(cache_factory_list=('erp5_content_short',))
@@ -706,10 +718,10 @@
catalog_dict = {}
- # Create archive obj list if necessary
+ # Create archive object list if necessary
if archiving:
# while archiving only test with the archive we used, do not care
- # of other as they must alredy be ok
+ # of other as they must already be ok
archive = self.unrestrictedTraverse(self.archive_path)
archive_obj_list = [archive,]
for archive_path in archive_list:
@@ -720,7 +732,7 @@
if archive.getCatalogId() == self.destination_sql_catalog_id:
archive_obj_list.append(archive)
else:
- # otherwise take all archive in use to knwo where object must go
+ # otherwise take all archive in use to know where object must go
archive_obj_list = []
for archive_path in archive_list:
try:
@@ -759,8 +771,9 @@
catalog_dict[catalog_id]['obj'].append(obj)
else:
catalog_dict[catalog_id] = {'priority' : priority, 'obj' : [obj,]}
- if catalog_id is None:
+ if catalog_id is None and not archiving:
# at least put object in current catalog if no archive match
+ # and not doing archive
goto_current_catalog = 1
else:
goto_current_catalog = 1
More information about the Erp5-report
mailing list