Commit 07f480ed authored by Aurel's avatar Aurel

manage_archive can take more argument as the research of currently

used connection might failed in some cases (no zsql method using a
deferred connection for example)

This should be replace later using a mapping between connection as parameter



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45126 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 20cd4ad5
...@@ -103,6 +103,8 @@ class ArchiveTool(BaseTool): ...@@ -103,6 +103,8 @@ class ArchiveTool(BaseTool):
def manage_archive(self, destination_archive_id, def manage_archive(self, destination_archive_id,
archive_id, archive_id,
source_connection_id=None,
source_deferred_connection_id=None,
update_destination_sql_catalog=None, update_destination_sql_catalog=None,
update_archive_sql_catalog=None, update_archive_sql_catalog=None,
clear_destination_sql_catalog=None, clear_destination_sql_catalog=None,
...@@ -124,13 +126,12 @@ class ArchiveTool(BaseTool): ...@@ -124,13 +126,12 @@ class ArchiveTool(BaseTool):
# Guess connection id from current catalog # Guess connection id from current catalog
source_catalog = portal_catalog.getSQLCatalog() source_catalog = portal_catalog.getSQLCatalog()
source_catalog_id = source_catalog.getId() source_catalog_id = source_catalog.getId()
source_connection_id = None if source_connection_id is None or source_deferred_connection_id is None:
source_deferred_connection_id = None
for method in source_catalog.objectValues(): for method in source_catalog.objectValues():
if method.meta_type == "Z SQL Method": if method.meta_type == "Z SQL Method":
if 'deferred' in method.connection_id: if source_deferred_connection_id is None and 'deferred' in method.connection_id:
source_deferred_connection_id = method.connection_id source_deferred_connection_id = method.connection_id
elif 'transactionless' not in method.connection_id: elif source_connection_id is None and 'transactionless' not in method.connection_id:
source_connection_id = method.connection_id source_connection_id = method.connection_id
if source_connection_id is not None and \ if source_connection_id is not None and \
source_deferred_connection_id is not None: source_deferred_connection_id is not None:
......
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