Commit b00ecf34 authored by Jérome Perrin's avatar Jérome Perrin

*: explicitly use activity="SQLDict" in activate 🤔

generated with nexedi/erp5$1185

I don't know if this is good or bad, but it shows all the places where
we implicitly use SQLDict.
parent e29c3c8c
...@@ -13,4 +13,4 @@ portal.portal_catalog.searchAndActivate( ...@@ -13,4 +13,4 @@ portal.portal_catalog.searchAndActivate(
activate_kw={'tag': tag}, activate_kw={'tag': tag},
) )
context.activate(after_tag=tag).getId() context.activate(activity='SQLDict', after_tag=tag).getId()
...@@ -317,4 +317,4 @@ with context.defaultActivateParameterDict({'tag': activity_tag}, placeless=True) ...@@ -317,4 +317,4 @@ with context.defaultActivateParameterDict({'tag': activity_tag}, placeless=True)
# make sure this Accounting Period has an activity pending during the indexing # make sure this Accounting Period has an activity pending during the indexing
# of the balance transaction. # of the balance transaction.
context.activate(after_tag=activity_tag).getTitle() context.activate(activity='SQLDict', after_tag=activity_tag).getTitle()
...@@ -42,7 +42,7 @@ for obj in object_list: ...@@ -42,7 +42,7 @@ for obj in object_list:
'portal_status_message': translateString('Payment creation already in progress, abandon.'), 'portal_status_message': translateString('Payment creation already in progress, abandon.'),
'portal_status_level': 'error', 'portal_status_level': 'error',
}) })
obj.activate(tag=tag).Invoice_createRelatedPaymentTransaction( obj.activate(activity='SQLDict', tag=tag).Invoice_createRelatedPaymentTransaction(
node=node, node=node,
payment_mode=payment_mode, payment_mode=payment_mode,
payment=payment, payment=payment,
...@@ -58,7 +58,7 @@ if not activated: ...@@ -58,7 +58,7 @@ if not activated:
}) })
# activate something on the folder # activate something on the folder
context.activate(after_tag=tag).getTitle() context.activate(activity='SQLDict', after_tag=tag).getTitle()
return context.Base_redirect( return context.Base_redirect(
form_id, form_id,
......
...@@ -30,7 +30,7 @@ for obj in object_list: ...@@ -30,7 +30,7 @@ for obj in object_list:
"portal_status_message": translateString('Reversal creation already in progress, abandon.'), "portal_status_message": translateString('Reversal creation already in progress, abandon.'),
"portal_status_level": 'error' "portal_status_level": 'error'
}) })
obj.activate(tag=tag).AccountingTransaction_createReversalTransaction( obj.activate(activity='SQLDict', tag=tag).AccountingTransaction_createReversalTransaction(
cancellation_amount=cancellation_amount, cancellation_amount=cancellation_amount,
date=date, date=date,
plan=plan) plan=plan)
...@@ -45,7 +45,7 @@ if not activated: ...@@ -45,7 +45,7 @@ if not activated:
)) ))
# activate something on the folder # activate something on the folder
context.activate(after_tag=tag).getTitle() context.activate(activity='SQLDict', after_tag=tag).getTitle()
return context.Base_redirect(form_id, return context.Base_redirect(form_id,
keep_items=dict(portal_status_message= keep_items=dict(portal_status_message=
......
...@@ -6,5 +6,6 @@ tag = script.getId() ...@@ -6,5 +6,6 @@ tag = script.getId()
sci['object'].reindexObject(activate_kw={'tag': tag}) sci['object'].reindexObject(activate_kw={'tag': tag})
sci['object'].getPortalObject().account_module.activate( sci['object'].getPortalObject().account_module.activate(
activity='SQLDict',
after_tag=tag after_tag=tag
).newCacheCookie("account_list") ).newCacheCookie("account_list")
...@@ -10,5 +10,5 @@ portal = accounting_period.getPortalObject() ...@@ -10,5 +10,5 @@ portal = accounting_period.getPortalObject()
profit_and_loss_account = portal.portal_workflow.getInfoFor( profit_and_loss_account = portal.portal_workflow.getInfoFor(
accounting_period, 'profit_and_loss_account') accounting_period, 'profit_and_loss_account')
accounting_period.activate(after_method_id='unindexObject').AccountingPeriod_createBalanceTransaction( accounting_period.activate(activity='SQLDict', after_method_id='unindexObject').AccountingPeriod_createBalanceTransaction(
profit_and_loss_account=profit_and_loss_account) profit_and_loss_account=profit_and_loss_account)
...@@ -6,4 +6,4 @@ accounting_period = sci['object'] ...@@ -6,4 +6,4 @@ accounting_period = sci['object']
if accounting_period.getParentValue().getPortalType() == accounting_period.getPortalType(): if accounting_period.getParentValue().getPortalType() == accounting_period.getPortalType():
return return
accounting_period.activate().AccountingPeriod_deleteBalanceTransaction() accounting_period.activate(activity='SQLDict').AccountingPeriod_deleteBalanceTransaction()
...@@ -17,7 +17,7 @@ if portal.portal_activities.countMessageWithTag(tag) or \ ...@@ -17,7 +17,7 @@ if portal.portal_activities.countMessageWithTag(tag) or \
return context.Base_redirect(form_id, keep_items=dict( return context.Base_redirect(form_id, keep_items=dict(
portal_status_message=translateString("Report already in progress."))) portal_status_message=translateString("Report already in progress.")))
context.activate().AccountingTransactionModule_viewFrenchAccountingTransactionFileActive( context.activate(activity='SQLDict').AccountingTransactionModule_viewFrenchAccountingTransactionFileActive(
section_category, section_category,
section_category_strict, section_category_strict,
from_date, from_date,
......
...@@ -106,7 +106,7 @@ for journal_code, journal_lib, journal_search_kw in _groupedJournalTupleDict(): ...@@ -106,7 +106,7 @@ for journal_code, journal_lib, journal_search_kw in _groupedJournalTupleDict():
# Proxy Role needed to create an 'Active Process' # Proxy Role needed to create an 'Active Process'
this_journal_active_process=this_journal_active_process.getRelativeUrl()) this_journal_active_process=this_journal_active_process.getRelativeUrl())
context.activate(after_tag=(tag, aggregate_tag)).AccountingTransactionModule_aggregateFrenchAccountingTransactionFile( context.activate(activity='SQLDict', after_tag=(tag, aggregate_tag)).AccountingTransactionModule_aggregateFrenchAccountingTransactionFile(
at_date, at_date,
active_process.getRelativeUrl(), active_process.getRelativeUrl(),
user_name=user_name, user_name=user_name,
......
...@@ -207,7 +207,7 @@ for section in section_list: ...@@ -207,7 +207,7 @@ for section in section_list:
for line in payment.getMovementList( for line in payment.getMovementList(
portal_type=payment.getPortalAccountingMovementTypeList()): portal_type=payment.getPortalAccountingMovementTypeList()):
if line.getGroupingReference(): if line.getGroupingReference():
line.activate(after_tag=tag).AccountingTransactionLine_resetGroupingReference() line.activate(activity='SQLDict', after_tag=tag).AccountingTransactionLine_resetGroupingReference()
else: else:
# other cases not supported for now # other cases not supported for now
......
...@@ -120,7 +120,7 @@ for month in range(1, month_count + 1): ...@@ -120,7 +120,7 @@ for month in range(1, month_count + 1):
for line in ptr.getMovementList( for line in ptr.getMovementList(
portal_type=ptr.getPortalAccountingMovementTypeList()): portal_type=ptr.getPortalAccountingMovementTypeList()):
if line.getGroupingReference(): if line.getGroupingReference():
line.activate(after_tag=tag).AccountingTransactionLine_resetGroupingReference() line.activate(activity='SQLDict', after_tag=tag).AccountingTransactionLine_resetGroupingReference()
accounting_module.setProperty('current_content_script', accounting_module.setProperty('current_content_script',
......
...@@ -28,4 +28,4 @@ portal.portal_catalog.searchAndActivate( ...@@ -28,4 +28,4 @@ portal.portal_catalog.searchAndActivate(
activate_kw={'tag':tag, 'priority': 8}, activate_kw={'tag':tag, 'priority': 8},
**kw) **kw)
context.activate(after_tag=tag).getId() context.activate(activity='SQLDict', after_tag=tag).getId()
ap = context.newActiveProcess() ap = context.newActiveProcess()
context.activate( context.activate(
activity='SQLDict',
active_process=ap.getRelativeUrl(), active_process=ap.getRelativeUrl(),
tag=tag, tag=tag
).Alarm_checkSkinCacheActive(fixit=fixit) ).Alarm_checkSkinCacheActive(fixit=fixit)
...@@ -3,7 +3,7 @@ def checkTopLevel(): ...@@ -3,7 +3,7 @@ def checkTopLevel():
for o in portal.objectValues(): for o in portal.objectValues():
error_list = o.checkFolderHandler(fixit=fixit) error_list = o.checkFolderHandler(fixit=fixit)
if len(error_list): if len(error_list):
portal.portal_activities.activate(active_process=active_process, priority=2) \ portal.portal_activities.activate(activity='SQLDict', active_process=active_process, priority=2) \
.Base_makeActiveResult(title=o.absolute_url_path(), error_list=error_list) .Base_makeActiveResult(title=o.absolute_url_path(), error_list=error_list)
if 'tag' not in kwargs: if 'tag' not in kwargs:
......
...@@ -25,6 +25,7 @@ for builder_id in builder_id_list: ...@@ -25,6 +25,7 @@ for builder_id in builder_id_list:
'_updateSimulation') '_updateSimulation')
activate_kw = dict(tag=index_tag) activate_kw = dict(tag=index_tag)
builder.activate( builder.activate(
activity='SQLDict',
limit=100, limit=100,
serialization_tag=serialization_tag, serialization_tag=serialization_tag,
after_tag=after_tag, after_tag=after_tag,
......
...@@ -201,7 +201,7 @@ class ArchiveTool(BaseTool): ...@@ -201,7 +201,7 @@ class ArchiveTool(BaseTool):
# Create inventory just before finish of hot reindexing # Create inventory just before finish of hot reindexing
inventory_date = archive.getStopDateRangeMax() inventory_date = archive.getStopDateRangeMax()
self.activate(after_method_id=('playBackRecordedObjectList'), self.activate(activity='SQLDict', after_method_id=('playBackRecordedObjectList'),
priority=5).runInventoryMethod(archive.id, priority=5).runInventoryMethod(archive.id,
source_connection_id, source_connection_id,
destination_sql_catalog_id, destination_sql_catalog_id,
...@@ -209,7 +209,7 @@ class ArchiveTool(BaseTool): ...@@ -209,7 +209,7 @@ class ArchiveTool(BaseTool):
) )
self.activate(after_method_id=('runInventoryMethod'), self.activate(activity='SQLDict', after_method_id=('runInventoryMethod'),
after_tag="runInventoryMethod", after_tag="runInventoryMethod",
priority=5).InventoryModule_reindexMovementList(sql_catalog_id=destination_sql_catalog_id, priority=5).InventoryModule_reindexMovementList(sql_catalog_id=destination_sql_catalog_id,
final_activity_tag="InventoryModule_reindexMovementList" final_activity_tag="InventoryModule_reindexMovementList"
......
...@@ -20,5 +20,5 @@ failure_list = portal.portal_catalog(**kw) ...@@ -20,5 +20,5 @@ failure_list = portal.portal_catalog(**kw)
for failure in failure_list: for failure in failure_list:
tag = 'expire_%s' %failure.getUid() tag = 'expire_%s' %failure.getUid()
failure.activate(tag = tag).expire(comment='System expire.') failure.activate(activity='SQLDict', tag=tag).expire(comment='System expire.')
failure.activate(after_tag = tag).reindexObject() failure.activate(activity='SQLDict', after_tag=tag).reindexObject()
...@@ -7,7 +7,7 @@ if context.getPortalObject().portal_activities.countMessageWithTag(tag): ...@@ -7,7 +7,7 @@ if context.getPortalObject().portal_activities.countMessageWithTag(tag):
return context.Base_redirect(form_id, return context.Base_redirect(form_id,
keep_items={'portal_status_message': translateString("Reconciliation already in progress"),}) keep_items={'portal_status_message': translateString("Reconciliation already in progress"),})
context.activate(tag=tag).BankReconciliation_selectNonReconciledTransactionListActive(tag=tag) context.activate(activity='SQLDict', tag=tag).BankReconciliation_selectNonReconciledTransactionListActive(tag=tag)
context.activate(after_tag=tag, activity='SQLQueue').BankReconciliation_notifySelectNonReconciledFinished() context.activate(after_tag=tag, activity='SQLQueue').BankReconciliation_notifySelectNonReconciledFinished()
......
...@@ -94,7 +94,7 @@ if use_activity: ...@@ -94,7 +94,7 @@ if use_activity:
method_kw['extra_header_dict'] = extra_header_dict method_kw['extra_header_dict'] = extra_header_dict
tag = script.id + '_reindex_' + context.getPath() tag = script.id + '_reindex_' + context.getPath()
context.reindexObject(activate_kw={'tag': tag}) context.reindexObject(activate_kw={'tag': tag})
context.activate(after_tag=tag).MailMessage_sendByActivity( context.activate(activity='SQLDict', after_tag=tag).MailMessage_sendByActivity(
method_kw=method_kw, **kw) method_kw=method_kw, **kw)
if download: if download:
......
...@@ -12,5 +12,5 @@ if plugin_id in acl_users.plugins.getAllPlugins(plugin_type='IAuthenticationPlug ...@@ -12,5 +12,5 @@ if plugin_id in acl_users.plugins.getAllPlugins(plugin_type='IAuthenticationPlug
method_id='Person_migrateToERP5Login', method_id='Person_migrateToERP5Login',
method_kw={'tag': tag}, method_kw={'tag': tag},
) )
portal.portal_activities.activate(after_tag=tag).ERP5Site_disableERP5UserManager() portal.portal_activities.activate(activity='SQLDict', after_tag=tag).ERP5Site_disableERP5UserManager()
return error_list return error_list
...@@ -9,7 +9,7 @@ if document.getMetaType() == 'ERP5 OOo Document': ...@@ -9,7 +9,7 @@ if document.getMetaType() == 'ERP5 OOo Document':
# Clear base_data # Clear base_data
document.setBaseData(None) document.setBaseData(None)
tag = 'document_%s_convert' % document.getPath() tag = 'document_%s_convert' % document.getPath()
document.activate(tag=tag).Document_tryToConvertToBaseFormat() document.activate(activity='SQLDict', tag=tag).Document_tryToConvertToBaseFormat()
else: else:
# do not run it in activity but not with try except statement # do not run it in activity but not with try except statement
# Transaction must fail, otherwise data will be lost # Transaction must fail, otherwise data will be lost
......
...@@ -23,4 +23,4 @@ if document.hasBaseData(): ...@@ -23,4 +23,4 @@ if document.hasBaseData():
if new_metadata: if new_metadata:
# edit metadata via server # edit metadata via server
after_tag = 'document_%s_convert' % document.getPath() after_tag = 'document_%s_convert' % document.getPath()
document.activate(after_tag=after_tag).Document_tryToUpdateBaseMetadata(**new_metadata) document.activate(activity='SQLDict', after_tag=after_tag).Document_tryToUpdateBaseMetadata(**new_metadata)
...@@ -4,4 +4,4 @@ ...@@ -4,4 +4,4 @@
that will update security groups. that will update security groups.
""" """
role_definition_parent = state_change['object'].getParentValue() role_definition_parent = state_change['object'].getParentValue()
role_definition_parent.activate().updateLocalRolesOnSecurityGroups() role_definition_parent.activate(activity='SQLDict').updateLocalRolesOnSecurityGroups()
...@@ -2,4 +2,4 @@ document = state_change['object'] ...@@ -2,4 +2,4 @@ document = state_change['object']
if document.isSupportBaseDataConversion() and not document.hasBaseData(): if document.isSupportBaseDataConversion() and not document.hasBaseData():
document.processFile() document.processFile()
document.activate().convertToBaseFormat() document.activate(activity='SQLDict').convertToBaseFormat()
...@@ -3,4 +3,4 @@ try: ...@@ -3,4 +3,4 @@ try:
delivery.aq_explicit.getCausalityState delivery.aq_explicit.getCausalityState
except AttributeError: except AttributeError:
return return
delivery.activate(tag='build:'+delivery.getPath()).Delivery_calculate() delivery.activate(activity='SQLDict', tag='build:'+delivery.getPath()).Delivery_calculate()
...@@ -6,5 +6,5 @@ solver_process = state_change['object'].getParentValue() ...@@ -6,5 +6,5 @@ solver_process = state_change['object'].getParentValue()
# could lead to the case where solver_process is never moved to succeeded # could lead to the case where solver_process is never moved to succeeded
# Instead of using serialize (which may lead to conflicts), just use # Instead of using serialize (which may lead to conflicts), just use
# activities in queue. # activities in queue.
solver_process.activate(serialization_tag=solver_process.getRelativeUrl() solver_process.activate(activity='SQLDict', serialization_tag=solver_process.getRelativeUrl()
).SolverProcess_tryToSucceed() ).SolverProcess_tryToSucceed()
...@@ -18,6 +18,7 @@ for builder_id in builder_id_list: ...@@ -18,6 +18,7 @@ for builder_id in builder_id_list:
'Delivery_updateAppliedRule') 'Delivery_updateAppliedRule')
activate_kw = dict(tag=index_tag) activate_kw = dict(tag=index_tag)
builder.activate( builder.activate(
activity='SQLDict',
serialization_tag=serialization_tag, serialization_tag=serialization_tag,
after_tag=after_tag, after_tag=after_tag,
after_method_id=after_method_id).build(activate_kw=activate_kw) after_method_id=after_method_id).build(activate_kw=activate_kw)
...@@ -572,7 +572,7 @@ class BusinessConfiguration(Item): ...@@ -572,7 +572,7 @@ class BusinessConfiguration(Item):
self.activate(**kw).ERP5Site_afterConfigurationSetup() self.activate(**kw).ERP5Site_afterConfigurationSetup()
if self.portal_workflow.isTransitionPossible(self, 'install'): if self.portal_workflow.isTransitionPossible(self, 'install'):
self.activate(after_tag=kw["tag"]).install() self.activate(activity='SQLDict', after_tag=kw["tag"]).install()
# Business Configuration are Item, which inherits from Amount and expect the # Business Configuration are Item, which inherits from Amount and expect the
# resource category document to be an actual resource, but in the case of # resource category document to be an actual resource, but in the case of
......
...@@ -351,6 +351,7 @@ class ConfiguratorTool(BaseTool): ...@@ -351,6 +351,7 @@ class ConfiguratorTool(BaseTool):
active_process = self.portal_activities.newActiveProcess() active_process = self.portal_activities.newActiveProcess()
REQUEST.set('active_process_id', active_process.getId()) REQUEST.set('active_process_id', active_process.getId())
business_configuration.activate( business_configuration.activate(
activity='SQLDict',
active_process=active_process, tag='initialERP5Setup' active_process=active_process, tag='initialERP5Setup'
).build() ).build()
return self.ConfiguratorTool_viewInstallationStatus(REQUEST) return self.ConfiguratorTool_viewInstallationStatus(REQUEST)
...@@ -7,7 +7,7 @@ bt = portal.portal_templates.getInstalledBusinessTemplate("erp5_demo_maxma_sampl ...@@ -7,7 +7,7 @@ bt = portal.portal_templates.getInstalledBusinessTemplate("erp5_demo_maxma_sampl
isTransitionPossible = portal.portal_workflow.isTransitionPossible isTransitionPossible = portal.portal_workflow.isTransitionPossible
for obj in portal.portal_catalog(path=["%%/%s" % i.replace("**", "%") for i in bt.getTemplatePathList()]): for obj in portal.portal_catalog(path=["%%/%s" % i.replace("**", "%") for i in bt.getTemplatePathList()]):
obj.activate().updateLocalRolesOnSecurityGroups() obj.activate(activity='SQLDict').updateLocalRolesOnSecurityGroups()
for document in portal.portal_catalog(portal_type=bt.getTemplatePortalTypeRoleList()): for document in portal.portal_catalog(portal_type=bt.getTemplatePortalTypeRoleList()):
document.updateLocalRolesOnSecurityGroups() document.updateLocalRolesOnSecurityGroups()
......
...@@ -37,6 +37,7 @@ for builder_id in builder_id_list: ...@@ -37,6 +37,7 @@ for builder_id in builder_id_list:
'_updateSimulation') '_updateSimulation')
activate_kw = dict(tag=index_tag) activate_kw = dict(tag=index_tag)
builder.activate( builder.activate(
activity='SQLDict',
limit=100, limit=100,
serialization_tag=serialization_tag, serialization_tag=serialization_tag,
after_tag=after_tag, after_tag=after_tag,
......
...@@ -34,6 +34,7 @@ for builder_id in builder_id_list: ...@@ -34,6 +34,7 @@ for builder_id in builder_id_list:
'_updateSimulation') '_updateSimulation')
activate_kw = dict(tag=index_tag) activate_kw = dict(tag=index_tag)
builder.activate( builder.activate(
activity='SQLDict',
limit=100, limit=100,
serialization_tag=serialization_tag, serialization_tag=serialization_tag,
after_tag=after_tag, after_tag=after_tag,
......
...@@ -1146,7 +1146,7 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -1146,7 +1146,7 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional):
# Call once more to check cache. # Call once more to check cache.
self.assertEqual(pers.getDummyTypeBaseMethod(), pers.getId()) self.assertEqual(pers.getDummyTypeBaseMethod(), pers.getId())
pers.activate().Person_getDummyTypeBaseMethodByActivity() pers.activate(activity='SQLDict').Person_getDummyTypeBaseMethodByActivity()
self.tic() self.tic()
def test_translate_table(self): def test_translate_table(self):
......
...@@ -134,7 +134,7 @@ class TestLocalizer(ERP5TypeTestCase): ...@@ -134,7 +134,7 @@ class TestLocalizer(ERP5TypeTestCase):
) )
tmp_obj = self.portal.portal_templates.newContent() tmp_obj = self.portal.portal_templates.newContent()
self.tic() self.tic()
tmp_obj.activate().test_activity() tmp_obj.activate(activity='SQLDict').test_activity()
# here we don't call self.tic() that calls self.portal that # here we don't call self.tic() that calls self.portal that
# reinvoke setSite(portal). # reinvoke setSite(portal).
setSite() setSite()
...@@ -181,7 +181,7 @@ assertEquals("This is 1€.", context.Base_translateString("This is 1€.")) ...@@ -181,7 +181,7 @@ assertEquals("This is 1€.", context.Base_translateString("This is 1€."))
""") """)
# normal activity # normal activity
portal.portal_activities.activate().test_script() portal.portal_activities.activate(activity='SQLDict').test_script()
self.tic() self.tic()
# after activity execution we are still in english # after activity execution we are still in english
self.assertEqual('en', localizer.get_selected_language()) self.assertEqual('en', localizer.get_selected_language())
...@@ -189,7 +189,7 @@ assertEquals("This is 1€.", context.Base_translateString("This is 1€.")) ...@@ -189,7 +189,7 @@ assertEquals("This is 1€.", context.Base_translateString("This is 1€."))
self.portal.Base_translateString("This is 1€.")) self.portal.Base_translateString("This is 1€."))
# execute activity with group_method # execute activity with group_method
portal.portal_activities.activate(group_method_id=None).test_script() portal.portal_activities.activate(activity='SQLDict', group_method_id=None).test_script()
self.tic() self.tic()
# after activity execution we are still in english # after activity execution we are still in english
self.assertEqual('en', localizer.get_selected_language()) self.assertEqual('en', localizer.get_selected_language())
......
...@@ -20,8 +20,9 @@ if prefs.getPreferredDeferredReportStoredAsDocument(): ...@@ -20,8 +20,9 @@ if prefs.getPreferredDeferredReportStoredAsDocument():
# pre-convert document before sending notification # pre-convert document before sending notification
if format: if format:
document.activate( document.activate(
activity='SQLDict',
node=portal.portal_preferences.getPreferredDeferredReportActivityFamily(), node=portal.portal_preferences.getPreferredDeferredReportActivityFamily(),
tag=pre_convert_tag, tag=pre_convert_tag
).convert(format=format) ).convert(format=format)
url_base = portal.ERP5Site_getAbsoluteUrl() url_base = portal.ERP5Site_getAbsoluteUrl()
......
...@@ -10,7 +10,7 @@ date_dict = {} ...@@ -10,7 +10,7 @@ date_dict = {}
# Shared function # Shared function
def updateDocumentList(**sql_kw): def updateDocumentList(**sql_kw):
for document in context.portal_catalog(**sql_kw): for document in context.portal_catalog(**sql_kw):
document.getObject().activate().updateContentFromURL() document.getObject().activate(activity='SQLDict').updateContentFromURL()
#Step1: convert the alarm date into hours #Step1: convert the alarm date into hours
alarm_date = convertDateToHour() alarm_date = convertDateToHour()
......
...@@ -37,7 +37,7 @@ if candidate_type_list and current_type not in candidate_type_list: ...@@ -37,7 +37,7 @@ if candidate_type_list and current_type not in candidate_type_list:
'cancel_url': cancel_url}) 'cancel_url': cancel_url})
context.edit(file=file) context.edit(file=file)
context.activate().Document_convertToBaseFormatAndDiscoverMetadata(file_name=file_name) context.activate(activity='SQLDict').Document_convertToBaseFormatAndDiscoverMetadata(file_name=file_name)
# Return to view mode # Return to view mode
return context.Base_redirect(form_id, keep_items={'portal_status_message': translateString('File uploaded.')}) return context.Base_redirect(form_id, keep_items={'portal_status_message': translateString('File uploaded.')})
...@@ -8,4 +8,4 @@ if portal.portal_preferences.getPreferredDocumentConversionServerUrl(): ...@@ -8,4 +8,4 @@ if portal.portal_preferences.getPreferredDocumentConversionServerUrl():
document_relative_url = getRelativeUrl[index_uid] document_relative_url = getRelativeUrl[index_uid]
document = portal.restrictedTraverse(document_relative_url) document = portal.restrictedTraverse(document_relative_url)
if document.Base_isConvertible(): if document.Base_isConvertible():
document.activate(priority=4, tag="conversion").Base_callPreConvert() document.activate(activity='SQLDict', priority=4, tag="conversion").Base_callPreConvert()
...@@ -8,5 +8,5 @@ if context.hasBaseData(): ...@@ -8,5 +8,5 @@ if context.hasBaseData():
quality = portal.portal_preferences.getPreferredImageQuality() quality = portal.portal_preferences.getPreferredImageQuality()
# empty documents do not need pre conversion # empty documents do not need pre conversion
context.activate(serialization_tag='pre_convert').convert(**{'format': 'html'}) context.activate(activity='SQLDict', serialization_tag='pre_convert').convert(**{'format': 'html'})
context.activate(serialization_tag='pre_convert').Base_preConvert(format, quality, display_list) context.activate(activity='SQLDict', serialization_tag='pre_convert').Base_preConvert(format, quality, display_list)
...@@ -7,7 +7,7 @@ format_kw = {'format': format, ...@@ -7,7 +7,7 @@ format_kw = {'format': format,
'quality': quality} 'quality': quality}
for display in display_list: for display in display_list:
format_kw['display'] = display format_kw['display'] = display
context.activate(serialization_tag='pre_convert').convert(**format_kw) context.activate(activity='SQLDict', serialization_tag='pre_convert').convert(**format_kw)
# try to convert all relative referenced (i.e. by <img> tag) documents # try to convert all relative referenced (i.e. by <img> tag) documents
context.activate().WebPage_preConvertReferencedImageList(**format_kw) context.activate(activity='SQLDict').WebPage_preConvertReferencedImageList(**format_kw)
...@@ -7,7 +7,7 @@ format_kw = {'format': format, ...@@ -7,7 +7,7 @@ format_kw = {'format': format,
'quality': quality} 'quality': quality}
for display in display_list: for display in display_list:
format_kw['display'] = display format_kw['display'] = display
context.activate(serialization_tag='pre_convert').convert(**format_kw) context.activate(activity='SQLDict', serialization_tag='pre_convert').convert(**format_kw)
# try to convert all relative referenced (i.e. by <img> tag) documents # try to convert all relative referenced (i.e. by <img> tag) documents
context.activate().WebPage_preConvertReferencedImageList(**format_kw) context.activate(activity='SQLDict').WebPage_preConvertReferencedImageList(**format_kw)
for email in context.portal_catalog(portal_type="Email Thread", validation_state="outgoing"): for email in context.portal_catalog(portal_type="Email Thread", validation_state="outgoing"):
email.getObject().activate().upload() email.getObject().activate(activity='SQLDict').upload()
...@@ -12,4 +12,5 @@ for day in day_list[1:]: ...@@ -12,4 +12,5 @@ for day in day_list[1:]:
activate_kw={"tag": tag}) activate_kw={"tag": tag})
# after indexing, make sure to update periodicity stop date # after indexing, make sure to update periodicity stop date
context.getPortalObject().portal_alarms.update_time_table_end_periodicity.activate( context.getPortalObject().portal_alarms.update_time_table_end_periodicity.activate(
activity='SQLDict',
after_tag=tag, priority=5).activeSense() after_tag=tag, priority=5).activeSense()
...@@ -8,4 +8,4 @@ if public_holiday_line.getValidationState() == "validated": ...@@ -8,4 +8,4 @@ if public_holiday_line.getValidationState() == "validated":
start_date = public_holiday_line.getStartDate() start_date = public_holiday_line.getStartDate()
quantity = public_holiday_line.getQuantity() quantity = public_holiday_line.getQuantity()
if not(None in (start_date, quantity)): if not(None in (start_date, quantity)):
context.getPortalObject().portal_alarms.update_time_table_end_periodicity.activate(priority=5).activeSense() context.getPortalObject().portal_alarms.update_time_table_end_periodicity.activate(activity='SQLDict', priority=5).activeSense()
# When updating public holidays, we have to recatalog group calendar # When updating public holidays, we have to recatalog group calendar
# assignments since they could be affected # assignments since they could be affected
context.getPortalObject().portal_alarms.update_time_table_end_periodicity.activate(priority=5).activeSense() context.getPortalObject().portal_alarms.update_time_table_end_periodicity.activate(activity='SQLDict', priority=5).activeSense()
...@@ -18,4 +18,5 @@ if not(None in (day_of_week, quantity)): ...@@ -18,4 +18,5 @@ if not(None in (day_of_week, quantity)):
time_table_line.setStopDate(stop_date) time_table_line.setStopDate(stop_date)
# after change, make sure to update group calendars through the usual alarm # after change, make sure to update group calendars through the usual alarm
context.getPortalObject().portal_alarms.update_time_table_end_periodicity.activate( context.getPortalObject().portal_alarms.update_time_table_end_periodicity.activate(
activity='SQLDict',
priority=5).activeSense() priority=5).activeSense()
...@@ -507,6 +507,7 @@ class AmortisationRule(RuleMixin): ...@@ -507,6 +507,7 @@ class AmortisationRule(RuleMixin):
# Finally notify modified deliveries in order to update causality state # Finally notify modified deliveries in order to update causality state
for delivery_value in to_notify_delivery_list: for delivery_value in to_notify_delivery_list:
delivery_value.activate( delivery_value.activate(
activity='SQLDict',
after_tag='disconnect_amortisation_transaction' after_tag='disconnect_amortisation_transaction'
).AmortisationTransaction_afterBuild() ).AmortisationTransaction_afterBuild()
delivery_value.edit() delivery_value.edit()
......
...@@ -3,6 +3,7 @@ form_id='AccountingTransactionModule_viewAccountingTransactionList' ...@@ -3,6 +3,7 @@ form_id='AccountingTransactionModule_viewAccountingTransactionList'
message='Building of Amortisation Transactions in progress...' message='Building of Amortisation Transactions in progress...'
context.accounting_module.activate( context.accounting_module.activate(
activity='SQLDict',
after_tag='expand_amortisation' after_tag='expand_amortisation'
).AccountingTransactionModule_buildAmortisationTransaction(item_uid_list=item_uid_list,at_date=at_date) ).AccountingTransactionModule_buildAmortisationTransaction(item_uid_list=item_uid_list,at_date=at_date)
......
context.activate( context.activate(
activity='SQLDict',
tag='after_amortisation_build', tag='after_amortisation_build',
after_tag=('build_amortisation_transaction', after_tag=('build_amortisation_transaction',
'disconnect_amortisation_transaction'), 'disconnect_amortisation_transaction')
).AmortisationTransaction_afterBuild(**kw) ).AmortisationTransaction_afterBuild(**kw)
...@@ -29,4 +29,4 @@ if context.getSimulationState() in context.getPortalUpdatableAmortisationTransac ...@@ -29,4 +29,4 @@ if context.getSimulationState() in context.getPortalUpdatableAmortisationTransac
#Test Add by Nicolas #Test Add by Nicolas
if getattr(context, 'startBuilding', None) is not None: if getattr(context, 'startBuilding', None) is not None:
context.startBuilding() context.startBuilding()
context.activate(after_tag='after_amortisation_build').updateCausalityState() context.activate(activity='SQLDict', after_tag='after_amortisation_build').updateCausalityState()
...@@ -11,4 +11,4 @@ for movement in movement_list: ...@@ -11,4 +11,4 @@ for movement in movement_list:
if item not in item_list: if item not in item_list:
item_list.append(item) item_list.append(item)
for item in item_list: for item in item_list:
item.activate(tag='expand_amortisation', after_tag=tag, after_path_and_method_id=(movemement_path_list, ('updateImmobilisationState',) )).expandAmortisation() item.activate(activity='SQLDict', tag='expand_amortisation', after_tag=tag, after_path_and_method_id=(movemement_path_list, ('updateImmobilisationState',) )).expandAmortisation()
...@@ -9,4 +9,4 @@ for movement in transaction.getMovementList(): ...@@ -9,4 +9,4 @@ for movement in transaction.getMovementList():
"ProfitAndLoss") "ProfitAndLoss")
# Automatic workflow # Automatic workflow
transaction.activate().updateCausalityState() transaction.activate(activity='SQLDict').updateCausalityState()
...@@ -9,7 +9,7 @@ for movement in transaction.getMovementList(): ...@@ -9,7 +9,7 @@ for movement in transaction.getMovementList():
# Update from simulation, then adapt causality value # Update from simulation, then adapt causality value
transaction.getPortalObject().portal_deliveries.amortisation_transaction_builder.updateFromSimulation(transaction.getRelativeUrl()) transaction.getPortalObject().portal_deliveries.amortisation_transaction_builder.updateFromSimulation(transaction.getRelativeUrl())
tag = relative_url + '_afterBuild' tag = relative_url + '_afterBuild'
transaction.activate(tag=tag, after_tag=indexation_tag).AmortisationTransaction_afterBuild() transaction.activate(activity='SQLDict', tag=tag, after_tag=indexation_tag).AmortisationTransaction_afterBuild()
# Automatic workflow # Automatic workflow
transaction.activate(after_tag=tag).updateCausalityState() transaction.activate(activity='SQLDict', after_tag=tag).updateCausalityState()
...@@ -5,4 +5,4 @@ for movement in pl.getAggregatedItemsNextImmobilisationMovementValueList(): ...@@ -5,4 +5,4 @@ for movement in pl.getAggregatedItemsNextImmobilisationMovementValueList():
if movement.getImmobilisationState() != 'calculating': if movement.getImmobilisationState() != 'calculating':
movement.calculateImmobilisationValidity() movement.calculateImmobilisationValidity()
pl.activate(after_method_id=('recursiveReindexObject', 'immediateReindexObject',)).updateImmobilisationState() pl.activate(activity='SQLDict', after_method_id=('recursiveReindexObject', 'immediateReindexObject',)).updateImmobilisationState()
...@@ -15,7 +15,8 @@ if person_value.getDefaultEmailText('') in ('', None): ...@@ -15,7 +15,8 @@ if person_value.getDefaultEmailText('') in ('', None):
portal_status_message=N_("You haven't defined your email address"))) portal_status_message=N_("You haven't defined your email address")))
context.activate( context.activate(
tag=script.id, activity='SQLDict',
tag=script.id
).LetterPostModule_exportExportableLetterPostActivity( ).LetterPostModule_exportExportableLetterPostActivity(
user.getUserId(), user.getUserId(),
comment, comment,
......
...@@ -69,13 +69,13 @@ class MailevaSOAPConnector(XMLObject): ...@@ -69,13 +69,13 @@ class MailevaSOAPConnector(XMLObject):
max_retry=0) max_retry=0)
try: try:
response = suds.client.Client(url = self.getProperty('submit_url_string'), transport=authenticated).service.submit(__inject={'msg': maileva_exchange.getRequest()}) response = suds.client.Client(url = self.getProperty('submit_url_string'), transport=authenticated).service.submit(__inject={'msg': maileva_exchange.getRequest()})
maileva_exchange.activate().MailevaExchange_processResponse(response) maileva_exchange.activate(activity='SQLDict').MailevaExchange_processResponse(response)
except socket.error as e: except socket.error as e:
if e.errno == socket.errno.ECONNREFUSED: if e.errno == socket.errno.ECONNREFUSED:
if runtime_environment: if runtime_environment:
runtime_environment.edit(max_retry=None) runtime_environment.edit(max_retry=None)
except Exception as e: except Exception as e:
maileva_exchange.activate().MailevaExchange_processResponse(str(e), failed = True) maileva_exchange.activate(activity='SQLDict').MailevaExchange_processResponse(str(e), failed = True)
......
...@@ -8,13 +8,13 @@ for event in portal.portal_catalog( ...@@ -8,13 +8,13 @@ for event in portal.portal_catalog(
validation_state="confirmed" validation_state="confirmed"
): ):
if event.getReference() in notification_dict: if event.getReference() in notification_dict:
event.activate().MailevaExchange_checkStatus(track_id= notification_dict[event.getReference()]["id"]) event.activate(activity='SQLDict').MailevaExchange_checkStatus(track_id= notification_dict[event.getReference()]["id"])
elif getattr(event, 'track_id', ""): elif getattr(event, 'track_id', ""):
event.activate().MailevaExchange_checkStatus(track_id= getattr(event, 'track_id')) event.activate(activity='SQLDict').MailevaExchange_checkStatus(track_id= getattr(event, 'track_id'))
else: else:
if int(DateTime()) - int(event.getCreationDate()) > 60*60*24: if int(DateTime()) - int(event.getCreationDate()) > 60*60*24:
document = event.getFollowUpValue() document = event.getFollowUpValue()
document.fail() document.fail()
event.acknowledge(comment="No Response") event.acknowledge(comment="No Response")
context.activate(after_tag=tag).getId() context.activate(activity='SQLDict', after_tag=tag).getId()
...@@ -29,6 +29,6 @@ maileva_exchange = context.system_event_module.newContent( ...@@ -29,6 +29,6 @@ maileva_exchange = context.system_event_module.newContent(
request = xml request = xml
) )
maileva_exchange.activate().MailevaExchange_submitMailevaRequest() maileva_exchange.activate(activity='SQLDict').MailevaExchange_submitMailevaRequest()
context.send() context.send()
...@@ -4,4 +4,4 @@ context.getPortalObject().portal_catalog.searchAndActivate( ...@@ -4,4 +4,4 @@ context.getPortalObject().portal_catalog.searchAndActivate(
method_id='SoftwarePublication_submitSoftwarePublication', method_id='SoftwarePublication_submitSoftwarePublication',
activate_kw={'tag': tag} activate_kw={'tag': tag}
) )
context.activate(after_tag=tag).getId() context.activate(activity='SQLDict', after_tag=tag).getId()
software_release = context.SoftwarePublication_getRelatedSoftwareRelease() software_release = context.SoftwarePublication_getRelatedSoftwareRelease()
tag = "publish_" + software_release.getRelativeUrl() tag = "publish_" + software_release.getRelativeUrl()
software_release.activate(tag=tag).SoftwareRelease_publishRelatedWebDocument() software_release.activate(activity='SQLDict', tag=tag).SoftwareRelease_publishRelatedWebDocument()
software_release.activate(after_tag=tag).publish() software_release.activate(activity='SQLDict', after_tag=tag).publish()
software_product = software_release.getFollowUpValue(portal_type="Software Product") software_product = software_release.getFollowUpValue(portal_type="Software Product")
if software_product.getValidationStateTitle() == 'Draft': if software_product.getValidationStateTitle() == 'Draft':
software_product.validate() software_product.validate()
...@@ -115,7 +115,7 @@ for name in zip_reader.namelist(): ...@@ -115,7 +115,7 @@ for name in zip_reader.namelist():
if url in ("index.html", "index.htm"): if url in ("index.html", "index.htm"):
default_page = document.getRelativeUrl() default_page = document.getRelativeUrl()
web_manifest_url = extractWebManifest(document.getData()) web_manifest_url = extractWebManifest(document.getData())
document.activate(tag=tag, after_tag=doc_tag).publish() document.activate(activity='SQLDict', tag=tag, after_tag=doc_tag).publish()
software_release.SoftwareRelease_fixRelatedWebSection(default_page=default_page, web_manifest = web_manifest_url) software_release.SoftwareRelease_fixRelatedWebSection(default_page=default_page, web_manifest = web_manifest_url)
...@@ -123,4 +123,4 @@ if portal.portal_workflow.isTransitionPossible(zip_file, 'publish'): ...@@ -123,4 +123,4 @@ if portal.portal_workflow.isTransitionPossible(zip_file, 'publish'):
zip_file.publish() zip_file.publish()
if portal.portal_workflow.isTransitionPossible(software_release, 'submit'): if portal.portal_workflow.isTransitionPossible(software_release, 'submit'):
software_release.submit() software_release.submit()
software_publication.activate(after_tag=tag).submit() software_publication.activate(activity='SQLDict', after_tag=tag).submit()
...@@ -4,6 +4,7 @@ if web_page.getPublicationSection() == "application/landing_page": ...@@ -4,6 +4,7 @@ if web_page.getPublicationSection() == "application/landing_page":
if software_product: if software_product:
# XXX Should be using an alarm # XXX Should be using an alarm
software_product.activate( software_product.activate(
activity='SQLDict',
after_path_and_method_id=( after_path_and_method_id=(
(web_page.getPath(),), (web_page.getPath(),),
("immediateReindexObject", ) ("immediateReindexObject", )
......
...@@ -3,4 +3,4 @@ web_site = software_product.getFollowUpValue(portal_type="Web Section") ...@@ -3,4 +3,4 @@ web_site = software_product.getFollowUpValue(portal_type="Web Section")
if web_site: if web_site:
tag = "SoftwareProduct_setReference_%s" % software_product.getUid() tag = "SoftwareProduct_setReference_%s" % software_product.getUid()
software_product.reindexObject(activate_kw={"tag": tag}) software_product.reindexObject(activate_kw={"tag": tag})
software_product.activate(after_tag=tag).SoftwareProduct_fixRelatedWebSite() software_product.activate(activity='SQLDict', after_tag=tag).SoftwareProduct_fixRelatedWebSite()
...@@ -51,8 +51,9 @@ if file not in ("undefined", None): # XXX "undefined" ? should also be fixed in ...@@ -51,8 +51,9 @@ if file not in ("undefined", None): # XXX "undefined" ? should also be fixed in
# XXX contribution API should allow to call a method on the final ingested document # XXX contribution API should allow to call a method on the final ingested document
# after ingestion is complete. # after ingestion is complete.
document.activate( document.activate(
activity='SQLDict',
after_tag=ingest_document_tag, after_tag=ingest_document_tag,
tag=after_ingest_document_tag, tag=after_ingest_document_tag
).Document_afterSupportRequestFilePostIngestion( ).Document_afterSupportRequestFilePostIngestion(
post_relative_url=post.getRelativeUrl(), ) post_relative_url=post.getRelativeUrl(), )
else: else:
...@@ -60,6 +61,7 @@ else: ...@@ -60,6 +61,7 @@ else:
post.publish() post.publish()
post.activate( post.activate(
activity='SQLDict',
after_tag=after_ingest_document_tag after_tag=after_ingest_document_tag
# XXX This API is not agreed. Also, we need to consider the possibility # XXX This API is not agreed. Also, we need to consider the possibility
# of ingesting posts through alarm, which is required when we want to ingest # of ingesting posts through alarm, which is required when we want to ingest
......
...@@ -9,4 +9,4 @@ for payline_transaction in portal.payline_transaction_module.searchFolder( ...@@ -9,4 +9,4 @@ for payline_transaction in portal.payline_transaction_module.searchFolder(
# expiration_date=DateTime().strftime('<"%Y/%m/%d %H:%M:%S"'), # expiration_date=DateTime().strftime('<"%Y/%m/%d %H:%M:%S"'),
): ):
if countMessage(tag=tag, path=payline_transaction.path) == 0 and now > payline_transaction.getExpirationDate(): if countMessage(tag=tag, path=payline_transaction.path) == 0 and now > payline_transaction.getExpirationDate():
payline_transaction.activate(tag=tag).PaylineTransaction_inquiry(http_exchange_value=None) payline_transaction.activate(activity='SQLDict', tag=tag).PaylineTransaction_inquiry(http_exchange_value=None)
...@@ -14,4 +14,4 @@ http_exchange = container.newContent( ...@@ -14,4 +14,4 @@ http_exchange = container.newContent(
http_exchange.confirm() http_exchange.confirm()
tag = script.id + '-' + http_exchange.getId() tag = script.id + '-' + http_exchange.getId()
http_exchange.reindexObject(activate_kw={'tag': tag}) http_exchange.reindexObject(activate_kw={'tag': tag})
portal.portal_alarms.handle_confirmed_http_exchanges.activate(after_tag=tag).activeSense() portal.portal_alarms.handle_confirmed_http_exchanges.activate(activity='SQLDict', after_tag=tag).activeSense()
...@@ -7,7 +7,7 @@ if context.getPortalObject().portal_activities.countMessageWithTag(tag,): ...@@ -7,7 +7,7 @@ if context.getPortalObject().portal_activities.countMessageWithTag(tag,):
return context.Base_redirect(form_id, keep_items=dict(portal_status_message=translateString( return context.Base_redirect(form_id, keep_items=dict(portal_status_message=translateString(
"Some payments are still beeing processed in the background, please retry later"))) "Some payments are still beeing processed in the background, please retry later")))
context.activate(tag=tag).PaymentTransactionGroup_selectPaymentTransactionLineListActive( context.activate(activity='SQLDict', tag=tag).PaymentTransactionGroup_selectPaymentTransactionLineListActive(
uids=uids, uids=uids,
select_limit=select_limit, select_limit=select_limit,
start_date_range_min=start_date_range_min, start_date_range_min=start_date_range_min,
......
tag="PaymentTransactionGroup_cancel" tag="PaymentTransactionGroup_cancel"
sci['object'].activate(after_tag="PaymentTransactionGroup_close", tag=tag).PaymentTransactionGroup_cancel(tag=tag) sci['object'].activate(activity='SQLDict', after_tag="PaymentTransactionGroup_close", tag=tag).PaymentTransactionGroup_cancel(tag=tag)
...@@ -5,7 +5,7 @@ if len(uids): ...@@ -5,7 +5,7 @@ if len(uids):
for alarm in context.portal_alarms.searchFolder(uid=uids): for alarm in context.portal_alarms.searchFolder(uid=uids):
alarm.solve() alarm.solve()
# Invoke activiveSense a bit later # Invoke activiveSense a bit later
alarm.activate().activeSense() alarm.activate(activity='SQLDict').activeSense()
portal_status_message = N_("Site Configuration is going to be fixed by Activities.") portal_status_message = N_("Site Configuration is going to be fixed by Activities.")
else: else:
portal_status_message = N_("No Site Configuration fix was request.") portal_status_message = N_("No Site Configuration fix was request.")
......
...@@ -43,11 +43,11 @@ if configurator.getSimulationState() == "draft": ...@@ -43,11 +43,11 @@ if configurator.getSimulationState() == "draft":
# create users if installation is done # create users if installation is done
try: try:
if create_test_data: if create_test_data:
context.portal_categories.activate(after_method_id = ('ERP5Site_afterConfigurationSetup', context.portal_categories.activate(activity='SQLDict', after_method_id=('ERP5Site_afterConfigurationSetup',
'immediateReindexObject') 'immediateReindexObject')
).ERP5Site_createTestData(user_quantity, password) ).ERP5Site_createTestData(user_quantity, password)
if set_id_generator: if set_id_generator:
context.portal_categories.activate(after_method_id = ('ERP5Site_afterConfigurationSetup', context.portal_categories.activate(activity='SQLDict', after_method_id=('ERP5Site_afterConfigurationSetup',
'immediateReindexObject') 'immediateReindexObject')
).ERP5Site_setIdGenerator() ).ERP5Site_setIdGenerator()
except Exception as e: except Exception as e:
......
...@@ -6,6 +6,6 @@ if solver_process is not None: ...@@ -6,6 +6,6 @@ if solver_process is not None:
solver_process.buildTargetSolverList() solver_process.buildTargetSolverList()
solver_tag = '%s_solve' % delivery.getPath() solver_tag = '%s_solve' % delivery.getPath()
solver_process.solve(activate_kw={'tag':solver_tag}) solver_process.solve(activate_kw={'tag':solver_tag})
delivery.activate(after_tag=solver_tag).updateCausalityState(solve_automatically=False) delivery.activate(activity='SQLDict', after_tag=solver_tag).updateCausalityState(solve_automatically=False)
else: else:
delivery.updateCausalityState(solve_automatically=False) delivery.updateCausalityState(solve_automatically=False)
...@@ -5,4 +5,4 @@ if not (hasattr(portal, 'portal_solvers') and hasattr(portal, 'portal_solver_pro ...@@ -5,4 +5,4 @@ if not (hasattr(portal, 'portal_solvers') and hasattr(portal, 'portal_solver_pro
delivery.diverge() delivery.diverge()
else: else:
solver_tag = '%s_solve' % delivery.getPath() solver_tag = '%s_solve' % delivery.getPath()
delivery.activate(tag=solver_tag).Delivery_solveDivergenceAutomatically() delivery.activate(activity='SQLDict', tag=solver_tag).Delivery_solveDivergenceAutomatically()
...@@ -733,7 +733,7 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor): ...@@ -733,7 +733,7 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor):
for packing_list in module.contentValues(portal_type='Sale Packing List'): for packing_list in module.contentValues(portal_type='Sale Packing List'):
divergence = packing_list.getDivergenceList()[0] divergence = packing_list.getDivergenceList()[0]
self.assertEqual(divergence.tested_property, solver_target) self.assertEqual(divergence.tested_property, solver_target)
packing_list.activate().SalePackingList_solveForTesting( packing_list.activate(activity='SQLDict').SalePackingList_solveForTesting(
solver_target, divergence.prevision_value) solver_target, divergence.prevision_value)
# XXX: Because divergence is ignored for 'destination_decision', # XXX: Because divergence is ignored for 'destination_decision',
# its value is actually undefined after solving. # its value is actually undefined after solving.
...@@ -754,7 +754,7 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor): ...@@ -754,7 +754,7 @@ class TestSimulationPerformance(ERP5TypeTestCase, LogInterceptor):
for packing_list in module.contentValues(portal_type='Sale Packing List'): for packing_list in module.contentValues(portal_type='Sale Packing List'):
divergence = packing_list.getDivergenceList()[0] divergence = packing_list.getDivergenceList()[0]
self.assertEqual(divergence.tested_property, solver_target) self.assertEqual(divergence.tested_property, solver_target)
packing_list.activate().SalePackingList_solveForTesting( packing_list.activate(activity='SQLDict').SalePackingList_solveForTesting(
solver_target, divergence.decision_value) solver_target, divergence.decision_value)
# Make sure that the same taget is not used again. # Make sure that the same taget is not used again.
sequence.edit(solver_target=None) sequence.edit(solver_target=None)
......
...@@ -13,6 +13,7 @@ after_method_id = ('immediateReindexObject', ...@@ -13,6 +13,7 @@ after_method_id = ('immediateReindexObject',
'_updateSimulation') '_updateSimulation')
activate_kw = dict(tag=index_tag) activate_kw = dict(tag=index_tag)
builder.activate( builder.activate(
activity='SQLDict',
serialization_tag=serialization_tag, serialization_tag=serialization_tag,
after_tag=index_tag, after_tag=index_tag,
after_method_id=after_method_id).build(activate_kw=activate_kw) after_method_id=after_method_id).build(activate_kw=activate_kw)
...@@ -25,6 +25,7 @@ for builder_id in builder_id_list: ...@@ -25,6 +25,7 @@ for builder_id in builder_id_list:
'_updateSimulation') '_updateSimulation')
activate_kw = dict(tag=index_tag) activate_kw = dict(tag=index_tag)
builder.activate( builder.activate(
activity='SQLDict',
limit=100, limit=100,
tag='invoice_builder_alarm', tag='invoice_builder_alarm',
serialization_tag=serialization_tag, serialization_tag=serialization_tag,
...@@ -33,4 +34,4 @@ for builder_id in builder_id_list: ...@@ -33,4 +34,4 @@ for builder_id in builder_id_list:
# add a dummy activity so alarm calling can detect we still have a pending activity # add a dummy activity so alarm calling can detect we still have a pending activity
# and do not start this script again before previous call is finished # and do not start this script again before previous call is finished
context.activate(after_tag='invoice_builder_alarm').getId() context.activate(activity='SQLDict', after_tag='invoice_builder_alarm').getId()
...@@ -26,6 +26,7 @@ for builder_id in builder_id_list: ...@@ -26,6 +26,7 @@ for builder_id in builder_id_list:
'_updateSimulation') '_updateSimulation')
activate_kw = dict(tag=index_tag) activate_kw = dict(tag=index_tag)
builder.activate( builder.activate(
activity='SQLDict',
limit=100, limit=100,
tag='packing_list_builder_alarm', tag='packing_list_builder_alarm',
serialization_tag=serialization_tag, serialization_tag=serialization_tag,
...@@ -34,4 +35,4 @@ for builder_id in builder_id_list: ...@@ -34,4 +35,4 @@ for builder_id in builder_id_list:
# add a dummy activity so alarm calling can detect we still have a pending activity # add a dummy activity so alarm calling can detect we still have a pending activity
# and do not start this script again before previous call is finished # and do not start this script again before previous call is finished
context.activate(after_tag='packing_list_builder_alarm').getId() context.activate(activity='SQLDict', after_tag='packing_list_builder_alarm').getId()
...@@ -10,5 +10,6 @@ for brain in portal.portal_catalog( ...@@ -10,5 +10,6 @@ for brain in portal.portal_catalog(
): ):
stripe_payment_session = brain.getObject() stripe_payment_session = brain.getObject()
stripe_payment_session.activate( stripe_payment_session.activate(
tag=tag, activity='SQLDict',
tag=tag
).StripePaymentSession_checkStripeSessionOpen() ).StripePaymentSession_checkStripeSessionOpen()
...@@ -25,4 +25,4 @@ context.setFollowUpValue(stripe_payment_session) ...@@ -25,4 +25,4 @@ context.setFollowUpValue(stripe_payment_session)
# activate alarm after the payment session is reindexed # activate alarm after the payment session is reindexed
alarm = portal.portal_alarms.check_stripe_payment_session alarm = portal.portal_alarms.check_stripe_payment_session
alarm.activate(queue='SQLQueue', after_tag=tag).activeSense() alarm.activate(activity='SQLDict', queue='SQLQueue', after_tag=tag).activeSense()
...@@ -3,7 +3,7 @@ import json ...@@ -3,7 +3,7 @@ import json
response = connector.createSession(data=data) response = connector.createSession(data=data)
assert "id" in response, response assert "id" in response, response
context.activate().StripePaymentSessionModule_storeStripeSession( context.activate(activity='SQLDict').StripePaymentSessionModule_storeStripeSession(
reference=response["id"], reference=response["id"],
expiration_date=context.getTypeBasedMethod('getStripePaymentSessionExpirationDate')(), expiration_date=context.getTypeBasedMethod('getStripePaymentSessionExpirationDate')(),
resource=resource, resource=resource,
......
...@@ -262,10 +262,10 @@ class SyncMLAsynchronousEngine(SyncMLEngineMixin): ...@@ -262,10 +262,10 @@ class SyncMLAsynchronousEngine(SyncMLEngineMixin):
) )
# then send the final message of this sync part # then send the final message of this sync part
if pref.getPreferredCheckDeleteAtEnd(): if pref.getPreferredCheckDeleteAtEnd():
subscription.activate(after_tag=tag, subscription.activate(activity='SQLDict', after_tag=tag,
priority=ACTIVITY_PRIORITY+1).getDeletedSyncMLData() priority=ACTIVITY_PRIORITY+1).getDeletedSyncMLData()
else: else:
subscription.activate(after_tag=tag, subscription.activate(activity='SQLDict', after_tag=tag,
priority=ACTIVITY_PRIORITY+1)._sendFinalMessage() priority=ACTIVITY_PRIORITY+1)._sendFinalMessage()
return True return True
......
...@@ -4,5 +4,5 @@ for exchange in context.getPortalObject().system_event_module.searchFolder( ...@@ -4,5 +4,5 @@ for exchange in context.getPortalObject().system_event_module.searchFolder(
validation_state='confirmed', validation_state='confirmed',
): ):
if exchange.getValidationState() == 'confirmed': if exchange.getValidationState() == 'confirmed':
exchange.activate(tag=tag).HTTPExchange_setFollowUpAndInquiry() exchange.activate(activity='SQLDict', tag=tag).HTTPExchange_setFollowUpAndInquiry()
exchange.acknowledge() exchange.acknowledge()
...@@ -34,4 +34,4 @@ for section_info in context.TaxReturn_getSectionInformationList(): ...@@ -34,4 +34,4 @@ for section_info in context.TaxReturn_getSectionInformationList():
movement.getObject().edit(activate_kw=dict(tag=tag), movement.getObject().edit(activate_kw=dict(tag=tag),
aggregate_value=context) aggregate_value=context)
context.activate(after_tag=tag).getTitle() context.activate(activity='SQLDict', after_tag=tag).getTitle()
vat_return = sci['object'] vat_return = sci['object']
vat_return.activate().VatReturn_setAggregateList() vat_return.activate(activity='SQLDict').VatReturn_setAggregateList()
...@@ -277,7 +277,7 @@ class ERP5ProjectUnitTestDistributor(XMLObject): ...@@ -277,7 +277,7 @@ class ERP5ProjectUnitTestDistributor(XMLObject):
test_node = test_node_module.newContent(portal_type="Test Node", title=title, computer_guid=computer_guid, test_node = test_node_module.newContent(portal_type="Test Node", title=title, computer_guid=computer_guid,
specialise=self.getRelativeUrl(), specialise=self.getRelativeUrl(),
activate_kw={'tag': tag}) activate_kw={'tag': tag})
self.activate(after_tag=tag).optimizeConfiguration() self.activate(activity='SQLDict', after_tag=tag).optimizeConfiguration()
test_node.setPingDate() test_node.setPingDate()
if batch_mode: if batch_mode:
return config return config
...@@ -357,7 +357,7 @@ class ERP5ProjectUnitTestDistributor(XMLObject): ...@@ -357,7 +357,7 @@ class ERP5ProjectUnitTestDistributor(XMLObject):
test_node = test_node_module.newContent(portal_type="Test Node", title=title, test_node = test_node_module.newContent(portal_type="Test Node", title=title,
specialise=self.getRelativeUrl(), specialise=self.getRelativeUrl(),
activate_kw={'tag': tag}) activate_kw={'tag': tag})
self.activate(after_tag=tag).optimizeConfiguration() self.activate(activity='SQLDict', after_tag=tag).optimizeConfiguration()
test_node.setPingDate() test_node.setPingDate()
choice_list = self._getSortedNodeTestSuiteToRun(test_node) choice_list = self._getSortedNodeTestSuiteToRun(test_node)
for test_suite in choice_list: for test_suite in choice_list:
......
...@@ -31,7 +31,7 @@ portal = context.getPortalObject() ...@@ -31,7 +31,7 @@ portal = context.getPortalObject()
distributor_list = portal.portal_task_distribution.objectValues() distributor_list = portal.portal_task_distribution.objectValues()
for distributor in distributor_list: for distributor in distributor_list:
distributor.activate(tag=tag).optimizeConfiguration() distributor.activate(activity='SQLDict', tag=tag).optimizeConfiguration()
context.activate(after_tag=tag).getId() context.activate(activity='SQLDict', after_tag=tag).getId()
return list_node return list_node
#Clean-up inactive Test Nodes #Clean-up inactive Test Nodes
context.portal_alarms.task_distributor_alarm_optimize.activate(after_path=context.getPath()).activeSense() context.portal_alarms.task_distributor_alarm_optimize.activate(activity='SQLDict', after_path=context.getPath()).activeSense()
...@@ -8,4 +8,4 @@ testnode will do the job. ...@@ -8,4 +8,4 @@ testnode will do the job.
portal = context.getPortalObject() portal = context.getPortalObject()
for test_result in portal.portal_catalog(portal_type="Test Result", for test_result in portal.portal_catalog(portal_type="Test Result",
simulation_state="started"): simulation_state="started"):
test_result.getObject().activate(priority=5).TestResult_restartStuckLine() test_result.getObject().activate(activity='SQLDict', priority=5).TestResult_restartStuckLine()
...@@ -259,7 +259,7 @@ class TaskDistributionTool(BaseTool): ...@@ -259,7 +259,7 @@ class TaskDistributionTool(BaseTool):
line.stop(**status_dict) line.stop(**status_dict)
# Check by activity is all lines are finished. Do not check synchrnonously # Check by activity is all lines are finished. Do not check synchrnonously
# in case another test line is stopped in parallel # in case another test line is stopped in parallel
test_result.activate().TestResult_stopIfFinished() test_result.activate(activity='SQLDict').TestResult_stopIfFinished()
def _extractXMLRPCDict(self, xmlrpc_dict): def _extractXMLRPCDict(self, xmlrpc_dict):
""" """
......
...@@ -58,7 +58,7 @@ if test_result.getPortalType() == 'Test Result': ...@@ -58,7 +58,7 @@ if test_result.getPortalType() == 'Test Result':
else: else:
status = 'PASS' status = 'PASS'
test_result.edit(string_index=status, **edit_kw) test_result.edit(string_index=status, **edit_kw)
test_result.activate().TestResult_afterComplete() test_result.activate(activity='SQLDict').TestResult_afterComplete()
elif test_result.getPortalType() == 'Test Result Line': elif test_result.getPortalType() == 'Test Result Line':
all_tests = kw.get('test_count') all_tests = kw.get('test_count')
errors = kw.get('error_count', 0) errors = kw.get('error_count', 0)
......
...@@ -290,8 +290,8 @@ class ERP5ResourceConduit(TioSafeBaseConduit): ...@@ -290,8 +290,8 @@ class ERP5ResourceConduit(TioSafeBaseConduit):
document.portal_workflow.doActionFor(document, action) document.portal_workflow.doActionFor(document, action)
except WorkflowException: except WorkflowException:
if current_state == 'draft': if current_state == 'draft':
document.activate().validate() document.activate(activity='SQLDict').validate()
document.activate().invalidate() document.activate(activity='SQLDict').invalidate()
# Remove related line from sale supply # Remove related line from sale supply
sync_name = self.getIntegrationSite(kw['domain']).getTitle() sync_name = self.getIntegrationSite(kw['domain']).getTitle()
......
...@@ -38,7 +38,7 @@ for sync in sync_list: ...@@ -38,7 +38,7 @@ for sync in sync_list:
portal_status_message = translateString("Synchronization started.") portal_status_message = translateString("Synchronization started.")
# Add to the integration site view the clock which show activities -Aurel : really necessary ? # Add to the integration site view the clock which show activities -Aurel : really necessary ?
context.activate(after_tag=after_tag).getTitle() context.activate(activity='SQLDict', after_tag=after_tag).getTitle()
if not batch_mode: if not batch_mode:
context.Base_redirect(form_id, keep_items = dict(portal_status_message=portal_status_message)) context.Base_redirect(form_id, keep_items = dict(portal_status_message=portal_status_message))
......
...@@ -4,7 +4,7 @@ context.setTotalAssetPrice(0) ...@@ -4,7 +4,7 @@ context.setTotalAssetPrice(0)
context.calculate() context.calculate()
context.activate().InventoryReport_recordProductStock() context.activate(activity='SQLDict').InventoryReport_recordProductStock()
if not batch_mode: if not batch_mode:
message = context.Base_translateString("Product Stock is creating") message = context.Base_translateString("Product Stock is creating")
return context.Base_redirect('view',keep_items={'portal_status_message': message}) return context.Base_redirect('view',keep_items={'portal_status_message': message})
...@@ -27,7 +27,8 @@ for inventory in inventory_list: ...@@ -27,7 +27,8 @@ for inventory in inventory_list:
total_asset_price=0 total_asset_price=0
) )
inventory_report_line.activate( inventory_report_line.activate(
tag = line_tag activity='SQLDict',
tag=line_tag
).InventoryReportLine_updateTotalAssetPrice( ).InventoryReportLine_updateTotalAssetPrice(
section_uid = section_uid, section_uid = section_uid,
node_uid = node_uid, node_uid = node_uid,
...@@ -39,5 +40,5 @@ for inventory in inventory_list: ...@@ -39,5 +40,5 @@ for inventory in inventory_list:
) )
tag = '%s:updateTotalAssetPrice' % relative_url tag = '%s:updateTotalAssetPrice' % relative_url
context.activate(after_tag=line_tag, tag=tag).InventoryReport_updateTotalAssetPrice() context.activate(activity='SQLDict', after_tag=line_tag, tag=tag).InventoryReport_updateTotalAssetPrice()
context.activate(after_tag=tag).record() context.activate(activity='SQLDict', after_tag=tag).record()
...@@ -81,7 +81,7 @@ select_params = { ...@@ -81,7 +81,7 @@ select_params = {
active_process_value = portal.portal_activities.newContent( active_process_value = portal.portal_activities.newContent(
portal_type='Active Process',) portal_type='Active Process',)
catalog_params.update(select_params) catalog_params.update(select_params)
portal.portal_catalog.activate(tag=tag).searchAndActivate( portal.portal_catalog.activate(activity='SQLDict', tag=tag).searchAndActivate(
method_id="OrderModule_processOrderStat", method_id="OrderModule_processOrderStat",
method_kw = {'active_process' : active_process_value.getPath(), method_kw = {'active_process' : active_process_value.getPath(),
'line_params' : line_params, 'line_params' : line_params,
......
...@@ -117,9 +117,10 @@ class TestERP5Simulation(TestPackingListMixin, SecurityTestCase): ...@@ -117,9 +117,10 @@ class TestERP5Simulation(TestPackingListMixin, SecurityTestCase):
if previous_tag: if previous_tag:
after_tag.append(previous_tag) after_tag.append(previous_tag)
delivery_builder.activate( delivery_builder.activate(
activity='SQLDict',
after_method_id=('solve', after_method_id=('solve',
'immediateReindexObject'), # XXX too brutal. 'immediateReindexObject'), # XXX too brutal.
after_tag=after_tag, after_tag=after_tag
).build(explanation_uid=packing_list.getCausalityValue().getUid()) ).build(explanation_uid=packing_list.getCausalityValue().getUid())
def stepCheckPackingListSplitted(self, sequence=None, sequence_list=None, **kw): def stepCheckPackingListSplitted(self, sequence=None, sequence_list=None, **kw):
......
...@@ -986,9 +986,10 @@ class TestPackingListMixin(TestOrderMixin): ...@@ -986,9 +986,10 @@ class TestPackingListMixin(TestOrderMixin):
if previous_tag: if previous_tag:
after_tag.append(previous_tag) after_tag.append(previous_tag)
delivery_builder.activate( delivery_builder.activate(
activity='SQLDict',
after_method_id=('solve', after_method_id=('solve',
'immediateReindexObject'), # XXX too brutal. 'immediateReindexObject'), # XXX too brutal.
after_tag=after_tag, after_tag=after_tag
).build(explanation_uid=packing_list.getCausalityValue().getUid()) ).build(explanation_uid=packing_list.getCausalityValue().getUid())
def stepMergeSplittedPackingList(self, sequence=None): def stepMergeSplittedPackingList(self, sequence=None):
......
...@@ -11,4 +11,4 @@ if getattr(delivery, 'calculatePacking', None) is not None: ...@@ -11,4 +11,4 @@ if getattr(delivery, 'calculatePacking', None) is not None:
tag = script.id + '_' + container.getPath() tag = script.id + '_' + container.getPath()
# XXX: Tagged reindexation added to replace after_path_and_method_id. May be unnecessary. # XXX: Tagged reindexation added to replace after_path_and_method_id. May be unnecessary.
container.recursiveReindexObject(activate_kw={'tag': tag}) container.recursiveReindexObject(activate_kw={'tag': tag})
delivery.activate(after_tag=tag).calculatePacking() delivery.activate(activity='SQLDict', after_tag=tag).calculatePacking()
...@@ -9,4 +9,4 @@ portal.portal_catalog.searchAndActivate( ...@@ -9,4 +9,4 @@ portal.portal_catalog.searchAndActivate(
creation_date = Query(creation_date=addToDate(DateTime(), to_add={'day': -120}), range="min"), creation_date = Query(creation_date=addToDate(DateTime(), to_add={'day': -120}), range="min"),
activate_kw={'tag': tag}, activate_kw={'tag': tag},
) )
context.activate(after_tag=tag).getId() context.activate(activity='SQLDict', after_tag=tag).getId()
...@@ -9,4 +9,4 @@ portal.portal_catalog.searchAndActivate( ...@@ -9,4 +9,4 @@ portal.portal_catalog.searchAndActivate(
creation_date = Query(creation_date=addToDate(DateTime(), to_add={'day': -90}), range="min"), creation_date = Query(creation_date=addToDate(DateTime(), to_add={'day': -90}), range="min"),
activate_kw={'tag': tag}, activate_kw={'tag': tag},
) )
context.activate(after_tag=tag).getId() context.activate(activity='SQLDict', after_tag=tag).getId()
...@@ -4,4 +4,4 @@ portal.portal_catalog.searchAndActivate( ...@@ -4,4 +4,4 @@ portal.portal_catalog.searchAndActivate(
method_id='TravelRequest_createRepresentativeRecord', method_id='TravelRequest_createRepresentativeRecord',
activate_kw={'tag': tag}, activate_kw={'tag': tag},
) )
context.activate(after_tag=tag).getId() context.activate(activity='SQLDict', after_tag=tag).getId()
...@@ -47,7 +47,7 @@ if fixit: ...@@ -47,7 +47,7 @@ if fixit:
# start another activity to collect the results from each upgrader step # start another activity to collect the results from each upgrader step
context.activate(after_tag=(upgrade_tag, post_upgrade_tag)).Alarm_postFullUpgradeNeed( context.activate(activity='SQLDict', after_tag=(upgrade_tag, post_upgrade_tag)).Alarm_postFullUpgradeNeed(
active_process=active_process.getRelativeUrl()) active_process=active_process.getRelativeUrl())
# Nothing else to do, so we can disable. # Nothing else to do, so we can disable.
......
...@@ -95,6 +95,7 @@ pref.setPreferredAccountingTransactionSourceSection(my_organisation.getRelativeU ...@@ -95,6 +95,7 @@ pref.setPreferredAccountingTransactionSourceSection(my_organisation.getRelativeU
pref.setPreferredHtmlStyleUnsavedFormWarning(False) pref.setPreferredHtmlStyleUnsavedFormWarning(False)
my_organisation.activate( my_organisation.activate(
activity='SQLDict',
after_path_and_method_id=( after_path_and_method_id=(
my_organisation.getPath(), ('immediateRecusriveReindexObject', 'immediateReindexObject'))) \ my_organisation.getPath(), ('immediateRecusriveReindexObject', 'immediateReindexObject'))) \
.Organisation_addConditionallyAccountingPeriod() .Organisation_addConditionallyAccountingPeriod()
......
...@@ -10,4 +10,4 @@ for path in path_list: ...@@ -10,4 +10,4 @@ for path in path_list:
filename = document.getFilename() filename = document.getFilename()
# Now starts metadata discovery process # Now starts metadata discovery process
document.activate().discoverMetadata(filename=filename, input_parameter_dict=input_parameter_dict) document.activate(activity='SQLDict').discoverMetadata(filename=filename, input_parameter_dict=input_parameter_dict)
...@@ -33,7 +33,7 @@ module.activate(tag=tag, activity='SQLQueue').EventModule_addWebMessage(**edit_k ...@@ -33,7 +33,7 @@ module.activate(tag=tag, activity='SQLQueue').EventModule_addWebMessage(**edit_k
# Trigger explicitly the alarm which will run discoverMetadata on created event, then # Trigger explicitly the alarm which will run discoverMetadata on created event, then
# Fill in discoverable properties (sender, recipient, ...) and change workflow states. # Fill in discoverable properties (sender, recipient, ...) and change workflow states.
# XXX hardcoded id, must be picked up by reference and version API # XXX hardcoded id, must be picked up by reference and version API
portal.portal_alarms.fetch_incoming_web_message_list.activate(after_tag=tag).activeSense() portal.portal_alarms.fetch_incoming_web_message_list.activate(activity='SQLDict', after_tag=tag).activeSense()
portal_status_message = translate('Your message has been successfully submitted.') portal_status_message = translate('Your message has been successfully submitted.')
context.getWebSectionValue().getParentValue().Base_redirect(keep_items={'portal_status_message': portal_status_message}) context.getWebSectionValue().getParentValue().Base_redirect(keep_items={'portal_status_message': portal_status_message})
...@@ -15,4 +15,4 @@ if not portal_preferences.isPreferredHtmlStyleDisabled(): ...@@ -15,4 +15,4 @@ if not portal_preferences.isPreferredHtmlStyleDisabled():
preferred_html_style_disabled=True preferred_html_style_disabled=True
) )
context.activate(after_tag=tag).getId() context.activate(activity='SQLDict', after_tag=tag).getId()
...@@ -15,4 +15,4 @@ if portal_preferences.isPreferredHtmlStyleDisabled(): ...@@ -15,4 +15,4 @@ if portal_preferences.isPreferredHtmlStyleDisabled():
preferred_html_style_disabled=False preferred_html_style_disabled=False
) )
context.activate(after_tag=tag).getId() context.activate(activity='SQLDict', after_tag=tag).getId()
...@@ -5,5 +5,5 @@ with context.foo_module.defaultActivateParameterDict({'tag': activity_tag}, plac ...@@ -5,5 +5,5 @@ with context.foo_module.defaultActivateParameterDict({'tag': activity_tag}, plac
foo1.setTitle('hasAccessUnauthorized') foo1.setTitle('hasAccessUnauthorized')
foo1.setSuccessorValue(foo2) foo1.setSuccessorValue(foo2)
foo2.activate(after_tag=activity_tag).manage_permission('Access contents information', 'Manager', 0) foo2.activate(activity='SQLDict', after_tag=activity_tag).manage_permission('Access contents information', 'Manager', 0)
return 'Done' return 'Done'
...@@ -719,7 +719,7 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor): ...@@ -719,7 +719,7 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor):
user = uf.getUserById('toto').__of__(uf) user = uf.getUserById('toto').__of__(uf)
newSecurityManager(None, user) newSecurityManager(None, user)
# Execute something as toto # Execute something as toto
organisation.activate().newContent(portal_type='Email',id='email') organisation.activate(activity='SQLDict').newContent(portal_type='Email',id='email')
# Then execute activities as seb # Then execute activities as seb
user = uf.getUserById('seb').__of__(uf) user = uf.getUserById('seb').__of__(uf)
newSecurityManager(None, user) newSecurityManager(None, user)
...@@ -829,7 +829,7 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor): ...@@ -829,7 +829,7 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor):
self.assertEqual(len(activity_tool.getMessageList()), 0) self.assertEqual(len(activity_tool.getMessageList()), 0)
# Insert a failing active object. # Insert a failing active object.
obj.activate().failingMethod() obj.activate(activity='SQLDict').failingMethod()
self.commit() self.commit()
self.assertEqual(len(activity_tool.getMessageList()), 1) self.assertEqual(len(activity_tool.getMessageList()), 1)
...@@ -1030,7 +1030,7 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor): ...@@ -1030,7 +1030,7 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor):
if property_id.startswith('_v_'): if property_id.startswith('_v_'):
delattr(activity_tool, property_id) delattr(activity_tool, property_id)
organisation_module = self.getOrganisationModule() organisation_module = self.getOrganisationModule()
active_organisation_module = organisation_module.activate() active_organisation_module = organisation_module.activate(activity='SQLDict')
delete_volatiles() delete_volatiles()
# Cause a message to be created # Cause a message to be created
# If the buffer cannot be created, this will raise # If the buffer cannot be created, this will raise
...@@ -1361,8 +1361,9 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor): ...@@ -1361,8 +1361,9 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor):
] ]
def activate(serialization_tag='a'): def activate(serialization_tag='a'):
organisation.activate( organisation.activate(
activity='SQLDict',
serialization_tag=serialization_tag, serialization_tag=serialization_tag,
group_method_id='portal_catalog/catalogObjectList', group_method_id='portal_catalog/catalogObjectList'
).getTitle() ).getTitle()
organisation = self.portal.organisation_module.newContent(portal_type='Organisation') organisation = self.portal.organisation_module.newContent(portal_type='Organisation')
self.tic() self.tic()
...@@ -1560,7 +1561,7 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor): ...@@ -1560,7 +1561,7 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor):
portal_type='Organisation', id='test_obj') portal_type='Organisation', id='test_obj')
self.assertEqual(o.absolute_url(), self.assertEqual(o.absolute_url(),
'http://test.erp5.org:9080/virtual_root/test_obj') 'http://test.erp5.org:9080/virtual_root/test_obj')
o.activate().checkAbsoluteUrl() o.activate(activity='SQLDict').checkAbsoluteUrl()
# Reset server URL and virtual root before executing messages. # Reset server URL and virtual root before executing messages.
# This simulates the case of activities beeing executed with different # This simulates the case of activities beeing executed with different
...@@ -1864,7 +1865,7 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor): ...@@ -1864,7 +1865,7 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor):
from Products.ZMySQLDA.db import DB from Products.ZMySQLDA.db import DB
DB.original_query = DB.query DB.original_query = DB.query
try: try:
active_object.activate().getTitle() active_object.activate(activity='SQLDict').getTitle()
self.commit() self.commit()
self.assertTrue(active_object.hasActivity()) self.assertTrue(active_object.hasActivity())
# Make the sql request not working # Make the sql request not working
...@@ -2451,9 +2452,9 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor): ...@@ -2451,9 +2452,9 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor):
def test_getMessageList(self): def test_getMessageList(self):
activity_tool = self.portal.portal_activities activity_tool = self.portal.portal_activities
module = self.portal.person_module module = self.portal.person_module
module.activate(after_tag="foo").getUid() module.activate(activity='SQLDict', after_tag="foo").getUid()
module.activate(activity='SQLQueue', tag="foo").getId() module.activate(activity='SQLQueue', tag="foo").getId()
activity_tool.activate(priority=-1).getId() activity_tool.activate(activity='SQLDict', priority=-1).getId()
def check(expected, **kw): def check(expected, **kw):
self.assertEqual(expected, len(activity_tool.getMessageList(**kw))) self.assertEqual(expected, len(activity_tool.getMessageList(**kw)))
def test(check=lambda _, **kw: check(0, **kw)): def test(check=lambda _, **kw: check(0, **kw)):
...@@ -2518,13 +2519,13 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor): ...@@ -2518,13 +2519,13 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor):
def test_activateOnZsqlBrain(self): def test_activateOnZsqlBrain(self):
organisation, = self.getOrganisationModule().searchFolder( organisation, = self.getOrganisationModule().searchFolder(
id=self.company_id) id=self.company_id)
organisation.activate().getTitle() organisation.activate(activity='SQLDict').getTitle()
self.tic() self.tic()
def test_flushActivitiesOnDelete(self): def test_flushActivitiesOnDelete(self):
organisation = self.getOrganisation() organisation = self.getOrganisation()
organisation.getParentValue()._delObject(organisation.getId()) organisation.getParentValue()._delObject(organisation.getId())
organisation.activate().getTitle() organisation.activate(activity='SQLDict').getTitle()
self.tic() self.tic()
def test_flushActivitiesOnDeleteWithAcquierableObject(self): def test_flushActivitiesOnDeleteWithAcquierableObject(self):
...@@ -2760,9 +2761,9 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor): ...@@ -2760,9 +2761,9 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor):
organisation = self.portal.organisation_module.newContent(portal_type='Organisation') organisation = self.portal.organisation_module.newContent(portal_type='Organisation')
self.tic() self.tic()
activity_tool = self.getActivityTool() activity_tool = self.getActivityTool()
organisation.activate(tag='1').getId() organisation.activate(activity='SQLDict', tag='1').getId()
organisation.activate(tag='2', after_tag=None).getId() organisation.activate(activity='SQLDict', tag='2', after_tag=None).getId()
organisation.activate(tag='3', after_tag='foo').getId() organisation.activate(activity='SQLDict', tag='3', after_tag='foo').getId()
self.commit() self.commit()
activity_tool.getMessageList() activity_tool.getMessageList()
self.assertItemsEqual( self.assertItemsEqual(
...@@ -2790,7 +2791,7 @@ return [x.getObject() for x in context.portal_catalog(limit=100)] ...@@ -2790,7 +2791,7 @@ return [x.getObject() for x in context.portal_catalog(limit=100)]
import Products.ERP5Type.Timeout import Products.ERP5Type.Timeout
Products.ERP5Type.Timeout.activity_timeout = 2.0 Products.ERP5Type.Timeout.activity_timeout = 2.0
self.portal.portal_templates.activate().Base_getSlowObjectList() self.portal.portal_templates.activate(activity='SQLDict').Base_getSlowObjectList()
with self.assertRaises(RuntimeError): with self.assertRaises(RuntimeError):
self.tic() self.tic()
message, = self.getMessageList('SQLDict') message, = self.getMessageList('SQLDict')
......
...@@ -186,7 +186,7 @@ class Alarm(XMLObject, PeriodicityMixin): ...@@ -186,7 +186,7 @@ class Alarm(XMLObject, PeriodicityMixin):
# Old API # Old API
getattr(self.activate(**activate_kw), method_id)() getattr(self.activate(**activate_kw), method_id)()
if self.isAlarmNotificationMode(): if self.isAlarmNotificationMode():
self.activate(after_tag=tag).notify(include_active=True, params=params) self.activate(activity='SQLDict', after_tag=tag).notify(include_active=True, params=params)
# switch to nobody temporarily so that unrestricted _activeSense # switch to nobody temporarily so that unrestricted _activeSense
# is always invoked by system user. # is always invoked by system user.
...@@ -294,7 +294,7 @@ class Alarm(XMLObject, PeriodicityMixin): ...@@ -294,7 +294,7 @@ class Alarm(XMLObject, PeriodicityMixin):
""" """
method_id = self.getSolveMethodId() method_id = self.getSolveMethodId()
if method_id not in (None, ''): if method_id not in (None, ''):
method = getattr(self.activate(), method_id) method = getattr(self.activate(activity='SQLDict'), method_id)
return method() return method()
return self.activeSense(fixit=1) return self.activeSense(fixit=1)
......
...@@ -69,4 +69,4 @@ class MetaNode(Node): ...@@ -69,4 +69,4 @@ class MetaNode(Node):
Lookup for capacities children of self and update capacity attributes Lookup for capacities children of self and update capacity attributes
by calling portal simulation (deferred) by calling portal simulation (deferred)
""" """
self.activate().immediateUpdateCapacity() self.activate(activity='SQLDict').immediateUpdateCapacity()
...@@ -1994,7 +1994,7 @@ class ERP5Site(ResponseHeaderGenerator, FolderMixIn, PortalObjectBase, CacheCook ...@@ -1994,7 +1994,7 @@ class ERP5Site(ResponseHeaderGenerator, FolderMixIn, PortalObjectBase, CacheCook
tool_id = tool.id tool_id = tool.id
if tool_id not in ('portal_property_sheets', 'portal_components'): if tool_id not in ('portal_property_sheets', 'portal_components'):
if tool_id in ('portal_categories', ): if tool_id in ('portal_categories', ):
tool = tool.activate() tool = tool.activate(activity='SQLDict')
tool.migrateToPortalTypeClass(tool_id not in ( tool.migrateToPortalTypeClass(tool_id not in (
'portal_activities', 'portal_simulation', 'portal_templates', 'portal_activities', 'portal_simulation', 'portal_templates',
'portal_trash', 'portal_catalog')) 'portal_trash', 'portal_catalog'))
...@@ -2158,15 +2158,18 @@ class ERP5Generator(PortalGenerator): ...@@ -2158,15 +2158,18 @@ class ERP5Generator(PortalGenerator):
p.portal_templates.repository_dict = dict.fromkeys(bt5_repository_url.split()) p.portal_templates.repository_dict = dict.fromkeys(bt5_repository_url.split())
if bt5: if bt5:
p.portal_templates.activate( p.portal_templates.activate(
# XXX: Is it useful to wait for indexing ?
activity='SQLDict',
# XXX: Is it useful to wait for indexing ? # XXX: Is it useful to wait for indexing ?
after_tag=reindex_all_tag, after_tag=reindex_all_tag,
tag=upgrade_tag, tag=upgrade_tag
).upgradeSite(bt5.split(), update_catalog=True) ).upgradeSite(bt5.split(), update_catalog=True)
# XXX: workaround for the above BT installation not using the upgrader, # XXX: workaround for the above BT installation not using the upgrader,
# and hence not triggering post-install constraints. # and hence not triggering post-install constraints.
if 'erp5_oauth2_authorisation' in bt5: if 'erp5_oauth2_authorisation' in bt5:
p.portal_templates.activate( p.portal_templates.activate(
after_tag=upgrade_tag, activity='SQLDict',
after_tag=upgrade_tag
).ERP5Site_checkOAuth2AuthorisationServerPostUpgradeConsistency(fixit=True) ).ERP5Site_checkOAuth2AuthorisationServerPostUpgradeConsistency(fixit=True)
if id_store_interval != '': if id_store_interval != '':
id_store_interval = int(id_store_interval) id_store_interval = int(id_store_interval)
......
...@@ -127,7 +127,7 @@ def updateBalanceTransactionClass(self): ...@@ -127,7 +127,7 @@ def updateBalanceTransactionClass(self):
# XXX 'something' activates some unindexObject calls, so activate our # XXX 'something' activates some unindexObject calls, so activate our
# reindexing after ... # reindexing after ...
newobj.activate(after_method_id='unindexObject').recursiveReindexObject() newobj.activate(activity='SQLDict', after_method_id='unindexObject').recursiveReindexObject()
def updateCareerValidationState(self): def updateCareerValidationState(self):
......
...@@ -52,4 +52,4 @@ class ProfitAndLoss(CopyToTarget): ...@@ -52,4 +52,4 @@ class ProfitAndLoss(CopyToTarget):
simulation_movement.edit(profit_quantity=added_quantity) simulation_movement.edit(profit_quantity=added_quantity)
tag = 'ProfitAndLoss_solve_' + simulation_movement.getPath() tag = 'ProfitAndLoss_solve_' + simulation_movement.getPath()
simulation_movement.reindexObject(activate_kw={'tag': tag}) simulation_movement.reindexObject(activate_kw={'tag': tag})
delivery_line.activate(after_tag=tag).edit() delivery_line.activate(activity='SQLDict', after_tag=tag).edit()
...@@ -357,8 +357,9 @@ class Delivery(XMLObject, ImmobilisationDelivery, SimulableMixin, ...@@ -357,8 +357,9 @@ class Delivery(XMLObject, ImmobilisationDelivery, SimulableMixin,
if calculate: if calculate:
path = self.getPath() path = self.getPath()
self.activate( self.activate(
activity='SQLDict',
after_tag='build:'+path, after_tag='build:'+path,
after_path_and_method_id=(path, '_localBuild'), after_path_and_method_id=(path, '_localBuild')
).updateCausalityState() ).updateCausalityState()
if kw: if kw:
super(Delivery, self).updateSimulation(**kw) super(Delivery, self).updateSimulation(**kw)
...@@ -402,7 +403,7 @@ class Delivery(XMLObject, ImmobilisationDelivery, SimulableMixin, ...@@ -402,7 +403,7 @@ class Delivery(XMLObject, ImmobilisationDelivery, SimulableMixin,
build_tag = '%s_splitAndDefer_build' % self.getRelativeUrl() build_tag = '%s_splitAndDefer_build' % self.getRelativeUrl()
# call solver and expand on deferrd movements # call solver and expand on deferrd movements
for movement in movement_list: for movement in movement_list:
movement.activate(tag=solver_tag).Movement_solveMovement( movement.activate(activity='SQLDict', tag=solver_tag).Movement_solveMovement(
delivery_solver, target_solver) delivery_solver, target_solver)
tag_list.append(solver_tag) tag_list.append(solver_tag)
kw = {'after_tag': tag_list[:], 'tag': expand_tag} kw = {'after_tag': tag_list[:], 'tag': expand_tag}
...@@ -420,14 +421,14 @@ class Delivery(XMLObject, ImmobilisationDelivery, SimulableMixin, ...@@ -420,14 +421,14 @@ class Delivery(XMLObject, ImmobilisationDelivery, SimulableMixin,
for s_m in movement.getDeliveryRelatedValueList(): for s_m in movement.getDeliveryRelatedValueList():
delivery_list = \ delivery_list = \
[x for x in s_m.getDeliveryList() if x != movement_url] [x for x in s_m.getDeliveryList() if x != movement_url]
s_m.activate(after_tag=tag_list[:], tag=detach_tag).setDeliveryList( s_m.activate(activity='SQLDict', after_tag=tag_list[:], tag=detach_tag).setDeliveryList(
delivery_list) delivery_list)
detached_movement_url_list.append(s_m.getRelativeUrl()) detached_movement_url_list.append(s_m.getRelativeUrl())
tag_list.append(detach_tag) tag_list.append(detach_tag)
#delete delivery movements #delete delivery movements
# deleteContent uses the uid as a activity tag # deleteContent uses the uid as a activity tag
self.activate(after_tag=tag_list[:]).deleteContent([movement.getId() for self.activate(activity='SQLDict', after_tag=tag_list[:]).deleteContent([movement.getId() for
movement in movement_list]) movement in movement_list])
tag_list.extend(deleted_movement_uid_list) tag_list.extend(deleted_movement_uid_list)
...@@ -437,7 +438,7 @@ class Delivery(XMLObject, ImmobilisationDelivery, SimulableMixin, ...@@ -437,7 +438,7 @@ class Delivery(XMLObject, ImmobilisationDelivery, SimulableMixin,
# call builder on detached movements # call builder on detached movements
builder = getattr(self.portal_deliveries, delivery_builder) builder = getattr(self.portal_deliveries, delivery_builder)
builder.activate(after_tag=tag_list[:], tag=build_tag).build( builder.activate(activity='SQLDict', after_tag=tag_list[:], tag=build_tag).build(
movement_relative_url_list=detached_movement_url_list) movement_relative_url_list=detached_movement_url_list)
......
...@@ -1081,6 +1081,7 @@ class ImmobilisableItem(Item, Amount): ...@@ -1081,6 +1081,7 @@ class ImmobilisableItem(Item, Amount):
activate_kw={'tag': 'expand_amortisation'}, activate_kw={'tag': 'expand_amortisation'},
) )
self.activate( self.activate(
activity='SQLDict',
after_path_and_method_id=( after_path_and_method_id=(
[x.getPath() for x in related_packing_list_list], [x.getPath() for x in related_packing_list_list],
('updateImmobilisationState', ), ('updateImmobilisationState', ),
...@@ -1103,7 +1104,7 @@ class ImmobilisableItem(Item, Amount): ...@@ -1103,7 +1104,7 @@ class ImmobilisableItem(Item, Amount):
for delivery in delivery_list: for delivery in delivery_list:
if getattr(delivery, 'updateImmobilisationState', None) is not None: if getattr(delivery, 'updateImmobilisationState', None) is not None:
delivery.updateImmobilisationState() delivery.updateImmobilisationState()
self.activate().expandAmortisation(activate_kw=activate_kw) self.activate(activity='SQLDict').expandAmortisation(activate_kw=activate_kw)
security.declareProtected(Permissions.AccessContentsInformation, 'getSectionMovementValueList') security.declareProtected(Permissions.AccessContentsInformation, 'getSectionMovementValueList')
def getSectionMovementValueList(self, include_to_date=0, **kw): def getSectionMovementValueList(self, include_to_date=0, **kw):
......
...@@ -92,7 +92,7 @@ class _Policy(object): ...@@ -92,7 +92,7 @@ class _Policy(object):
self.test = self.activate self.test = self.activate
def activate(self, context): def activate(self, context):
context.activate(merge_parent=self.merge_parent) \ context.activate(activity='SQLDict', merge_parent=self.merge_parent) \
.expand(activate_kw=self.activate_kw) .expand(activate_kw=self.activate_kw)
def __call__(self, *args): def __call__(self, *args):
......
...@@ -20,9 +20,10 @@ def reindex(document_list, tag, after_tag): ...@@ -20,9 +20,10 @@ def reindex(document_list, tag, after_tag):
for document in document_list: for document in document_list:
print('#### Indexing %s ####') print('#### Indexing %s ####')
document.activate( document.activate(
activity='SQLDict',
priority=additional_priority, priority=additional_priority,
tag=tag, tag=tag,
after_tag=after_tag, after_tag=after_tag
).recursiveReindexObject( ).recursiveReindexObject(
activate_kw={ activate_kw={
'tag': tag, 'tag': tag,
...@@ -110,7 +111,8 @@ print(reindex( ...@@ -110,7 +111,8 @@ print(reindex(
)) ))
portal.portal_activities.activate( portal.portal_activities.activate(
after_tag=(user_tag, category_tag, document_tag, preference_tag, inventory_tag, simulation_tag), activity='SQLDict',
after_tag=(user_tag, category_tag, document_tag, preference_tag, inventory_tag, simulation_tag)
).InventoryModule_reindexMovementList( ).InventoryModule_reindexMovementList(
sql_catalog_id=sql_catalog_id, sql_catalog_id=sql_catalog_id,
final_activity_tag=last_inventory_tag, final_activity_tag=last_inventory_tag,
...@@ -119,11 +121,13 @@ portal.portal_activities.activate( ...@@ -119,11 +121,13 @@ portal.portal_activities.activate(
# restore alarm node # restore alarm node
if clear_catalog and is_subscribed: if clear_catalog and is_subscribed:
portal.portal_alarms.activate( portal.portal_alarms.activate(
after_tag=(user_tag, category_tag, document_tag, preference_tag, inventory_tag, simulation_tag, last_inventory_tag), activity='SQLDict',
after_tag=(user_tag, category_tag, document_tag, preference_tag, inventory_tag, simulation_tag, last_inventory_tag)
).subscribe() ).subscribe()
portal.portal_activities.activate( portal.portal_activities.activate(
activity='SQLDict',
tag=final_activity_tag, tag=final_activity_tag,
after_tag=(user_tag, category_tag, document_tag, preference_tag, inventory_tag, simulation_tag, last_inventory_tag), after_tag=(user_tag, category_tag, document_tag, preference_tag, inventory_tag, simulation_tag, last_inventory_tag)
).getId() ).getId()
return printed return printed
...@@ -52,7 +52,7 @@ portal.portal_catalog.searchAndActivate( ...@@ -52,7 +52,7 @@ portal.portal_catalog.searchAndActivate(
# activate something on the module after everything, so that user can know that # activate something on the module after everything, so that user can know that
# something is happening in the background # something is happening in the background
context.activate(after_tag=tag).getId() context.activate(activity='SQLDict', after_tag=tag).getId()
return context.Base_redirect(form_id, return context.Base_redirect(form_id,
keep_items=dict(portal_status_message=translate("Workflow modification in progress."))) keep_items=dict(portal_status_message=translate("Workflow modification in progress.")))
...@@ -82,7 +82,7 @@ for i in xrange(0, path_list_len, batch_size): ...@@ -82,7 +82,7 @@ for i in xrange(0, path_list_len, batch_size):
# activate something on the module after everything, so that user can know that # activate something on the module after everything, so that user can know that
# something is happening in the background # something is happening in the background
context.activate(after_tag=tag).getTitle() context.activate(activity='SQLDict', after_tag=tag).getTitle()
# reset selection checked uids # reset selection checked uids
context.portal_selections.setSelectionCheckedUidsFor(selection_name, []) context.portal_selections.setSelectionCheckedUidsFor(selection_name, [])
......
...@@ -29,4 +29,4 @@ for inventory in portal.portal_catalog(portal_type=portal_type_list, ...@@ -29,4 +29,4 @@ for inventory in portal.portal_catalog(portal_type=portal_type_list,
if final_activity_tag is not None and previous_tag is not None: if final_activity_tag is not None and previous_tag is not None:
# Dummy activity used to determine if the previously started activities are over. # Dummy activity used to determine if the previously started activities are over.
context.activate(tag=final_activity_tag, after_tag=previous_tag).getId() context.activate(activity='SQLDict', tag=final_activity_tag, after_tag=previous_tag).getId()
...@@ -212,7 +212,7 @@ class ContributionTool(BaseTool): ...@@ -212,7 +212,7 @@ class ContributionTool(BaseTool):
# if _setObject is not called # if _setObject is not called
document = container.newContent(document_id, portal_type, **kw) document = container.newContent(document_id, portal_type, **kw)
if discover_metadata: if discover_metadata:
document.activate(after_path_and_method_id=(document.getPath(), document.activate(activity='SQLDict', after_path_and_method_id=(document.getPath(),
('convertToBaseFormat', 'Document_tryToConvertToBaseFormat')))\ ('convertToBaseFormat', 'Document_tryToConvertToBaseFormat')))\
.discoverMetadata(filename=filename, .discoverMetadata(filename=filename,
user_login=user_login, user_login=user_login,
...@@ -404,10 +404,11 @@ class ContributionTool(BaseTool): ...@@ -404,10 +404,11 @@ class ContributionTool(BaseTool):
# be for user interface and should thus be handled by # be for user interface and should thus be handled by
# ZODB scripts # ZODB scripts
document.activate( document.activate(
activity='SQLDict',
after_path_and_method_id=( after_path_and_method_id=(
document.getPath(), document.getPath(),
('convertToBaseFormat', 'Document_tryToConvertToBaseFormat'), ('convertToBaseFormat', 'Document_tryToConvertToBaseFormat'),
), )
).discoverMetadata(filename=filename, ).discoverMetadata(filename=filename,
user_login=user_login, user_login=user_login,
input_parameter_dict=input_parameter_dict) input_parameter_dict=input_parameter_dict)
...@@ -552,7 +553,7 @@ class ContributionTool(BaseTool): ...@@ -552,7 +553,7 @@ class ContributionTool(BaseTool):
if repeat == 0 or not batch_mode: if repeat == 0 or not batch_mode:
# XXX - Call the extendBadURLList method,--NOT Implemented-- # XXX - Call the extendBadURLList method,--NOT Implemented--
raise raise
content.activate(at_date=DateTime() + repeat_interval).updateContentFromURL(repeat=repeat - 1) content.activate(activity='SQLDict', at_date=DateTime() + repeat_interval).updateContentFromURL(repeat=repeat - 1)
return return
content._edit(file=file_object, content_type=content_type) content._edit(file=file_object, content_type=content_type)
...@@ -562,17 +563,17 @@ class ContributionTool(BaseTool): ...@@ -562,17 +563,17 @@ class ContributionTool(BaseTool):
# not here (look at _edit in Base) # not here (look at _edit in Base)
# Step 2: convert to base format # Step 2: convert to base format
if content.isSupportBaseDataConversion(): if content.isSupportBaseDataConversion():
content.activate().Document_tryToConvertToBaseFormat() content.activate(activity='SQLDict').Document_tryToConvertToBaseFormat()
# Step 3: run discoverMetadata # Step 3: run discoverMetadata
content.activate(after_path_and_method_id=(content.getPath(), content.activate(activity='SQLDict', after_path_and_method_id=(content.getPath(),
('convertToBaseFormat', 'Document_tryToConvertToBaseFormat'))) \ ('convertToBaseFormat', 'Document_tryToConvertToBaseFormat'))) \
.discoverMetadata(filename=filename) .discoverMetadata(filename=filename)
# Step 4: activate populate (unless interaction workflow does it) # Step 4: activate populate (unless interaction workflow does it)
content.activate().populateContent() content.activate(activity='SQLDict').populateContent()
# Step 5: activate crawlContent # Step 5: activate crawlContent
depth = content.getCrawlingDepth() depth = content.getCrawlingDepth()
if depth > 0: if depth > 0:
content.activate().crawlContent() content.activate(activity='SQLDict').crawlContent()
security.declareProtected(Permissions.AddPortalContent, 'newContentFromURL') security.declareProtected(Permissions.AddPortalContent, 'newContentFromURL')
def newContentFromURL(self, url, container_path=None, id=None, repeat=MAX_REPEAT, def newContentFromURL(self, url, container_path=None, id=None, repeat=MAX_REPEAT,
...@@ -593,10 +594,10 @@ class ContributionTool(BaseTool): ...@@ -593,10 +594,10 @@ class ContributionTool(BaseTool):
document = self.newContent(container_path=container_path, url=url, **kw) document = self.newContent(container_path=container_path, url=url, **kw)
if document.isIndexContent() and document.getCrawlingDepth() >= 0: if document.isIndexContent() and document.getCrawlingDepth() >= 0:
# If this is an index document, keep on crawling even if crawling_depth is 0 # If this is an index document, keep on crawling even if crawling_depth is 0
document.activate().crawlContent() document.activate(activity='SQLDict').crawlContent()
elif document.getCrawlingDepth() > 0: elif document.getCrawlingDepth() > 0:
# If this is an index document, stop crawling if crawling_depth is 0 # If this is an index document, stop crawling if crawling_depth is 0
document.activate().crawlContent() document.activate(activity='SQLDict').crawlContent()
except urllib.error.HTTPError: except urllib.error.HTTPError:
if repeat == 0 or not batch_mode: if repeat == 0 or not batch_mode:
# here we must call the extendBadURLList method,--NOT Implemented-- # here we must call the extendBadURLList method,--NOT Implemented--
......
...@@ -4,10 +4,10 @@ from Products.CMFCore.utils import getToolByName ...@@ -4,10 +4,10 @@ from Products.CMFCore.utils import getToolByName
if cache_plugin_list: if cache_plugin_list:
cache_tool = getToolByName(document.getPortalObject(), 'portal_caches') cache_tool = getToolByName(document.getPortalObject(), 'portal_caches')
if cache_tool is not None: if cache_tool is not None:
cache_tool.activate().updateCache() cache_tool.activate(activity='SQLDict').updateCache()
selection_tool = document.getPortalObject().portal_selections selection_tool = document.getPortalObject().portal_selections
if selection_tool.getStorage() == document.getRelativeUrl(): if selection_tool.getStorage() == document.getRelativeUrl():
selection_tool.activate().clearCachedContainer() selection_tool.activate(activity='SQLDict').clearCachedContainer()
if selection_tool.getAnonymousStorage() == document.getRelativeUrl(): if selection_tool.getAnonymousStorage() == document.getRelativeUrl():
selection_tool.activate().clearCachedContainer(is_anonymous=True) selection_tool.activate(activity='SQLDict').clearCachedContainer(is_anonymous=True)
sci['object'].activate().Preference_disableOtherPreferences() sci['object'].activate(activity='SQLDict').Preference_disableOtherPreferences()
...@@ -410,7 +410,7 @@ class CopyContainer: ...@@ -410,7 +410,7 @@ class CopyContainer:
# changed, so that it updates related objects. # changed, so that it updates related objects.
old_url = getattr(self, '_v_category_url_before_move', None) old_url = getattr(self, '_v_category_url_before_move', None)
if old_url is not None: if old_url is not None:
self.activate(after_method_id='unindexObject').updateRelatedContent( self.activate(activity='SQLDict', after_method_id='unindexObject').updateRelatedContent(
old_url, old_url,
self.getRelativeUrl()) self.getRelativeUrl())
elif op == 0: elif op == 0:
......
...@@ -426,7 +426,7 @@ class OldTypesTool(OFSFolder): ...@@ -426,7 +426,7 @@ class OldTypesTool(OFSFolder):
parent.portal_categories._setObject(action_type.id, action_type) parent.portal_categories._setObject(action_type.id, action_type)
for type_info in self.objectValues(): for type_info in self.objectValues():
self._migratePortalType(types_tool, type_info) self._migratePortalType(types_tool, type_info)
types_tool.activate()._finalizeMigration() types_tool.activate(activity='SQLDict')._finalizeMigration()
LOG('OldTypesTool', WARNING, "... portal_types converted.") LOG('OldTypesTool', WARNING, "... portal_types converted.")
return types_tool return types_tool
......
...@@ -345,14 +345,14 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -345,14 +345,14 @@ class ZCatalog(Folder, Persistent, Implicit):
# Re-schedule the same action in case there are remaining rows in the # Re-schedule the same action in case there are remaining rows in the
# table. This can happen if the database connector limits the number # table. This can happen if the database connector limits the number
# of rows in the result. # of rows in the result.
self.activate(priority=5).\ self.activate(activity='SQLDict', priority=5).\
playBackRecordedObjectList(sql_catalog_id=sql_catalog_id, playBackRecordedObjectList(sql_catalog_id=sql_catalog_id,
catalog=catalog) catalog=catalog)
else: else:
# If there is nothing to do, go to next step. # If there is nothing to do, go to next step.
if catalog == 0: if catalog == 0:
# If we were replaying unindex actions, time to replay index actions. # If we were replaying unindex actions, time to replay index actions.
self.activate(priority=5).\ self.activate(activity='SQLDict', priority=5).\
playBackRecordedObjectList(sql_catalog_id=sql_catalog_id, playBackRecordedObjectList(sql_catalog_id=sql_catalog_id,
catalog=1) catalog=1)
# If we were replaying index actions, there is nothing else to do. # If we were replaying index actions, there is nothing else to do.
...@@ -498,18 +498,18 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -498,18 +498,18 @@ class ZCatalog(Folder, Persistent, Implicit):
additional_priority=base_priority) additional_priority=base_priority)
# Once reindexing is finished, change the hot reindexing state so that # Once reindexing is finished, change the hot reindexing state so that
# new catalog changes are applied in both catalogs. # new catalog changes are applied in both catalogs.
self.activate(after_tag=final_activity_tag, self.activate(activity='SQLDict', after_tag=final_activity_tag,
priority=base_priority)._setHotReindexingState(HOT_REINDEXING_DOUBLE_INDEXING_STATE, priority=base_priority)._setHotReindexingState(HOT_REINDEXING_DOUBLE_INDEXING_STATE,
source_sql_catalog_id=source_sql_catalog_id, source_sql_catalog_id=source_sql_catalog_id,
destination_sql_catalog_id=destination_sql_catalog_id, destination_sql_catalog_id=destination_sql_catalog_id,
archive_path=archive_path) archive_path=archive_path)
# Once in double-indexing mode, planned reindex can be replayed. # Once in double-indexing mode, planned reindex can be replayed.
self.activate(after_method_id='_setHotReindexingState', self.activate(activity='SQLDict', after_method_id='_setHotReindexingState',
priority=base_priority).playBackRecordedObjectList( priority=base_priority).playBackRecordedObjectList(
sql_catalog_id=destination_sql_catalog_id) sql_catalog_id=destination_sql_catalog_id)
# Once there is nothing to replay, databases are sync'ed, so the new # Once there is nothing to replay, databases are sync'ed, so the new
# catalog can become current. # catalog can become current.
self.activate(after_method_id=('playBackRecordedObjectList', self.activate(activity='SQLDict', after_method_id=('playBackRecordedObjectList',
'InventoryModule_reindexMovementList'), 'InventoryModule_reindexMovementList'),
after_tag='InventoryModule_reindexMovementList', after_tag='InventoryModule_reindexMovementList',
priority=base_priority)._finishHotReindexing( priority=base_priority)._finishHotReindexing(
......
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