Commit e094fef2 authored by Jean-Paul Smets's avatar Jean-Paul Smets

New revision 2 after Savannah crash


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@99 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f6df9376
...@@ -37,6 +37,16 @@ DEFAULT_ACTIVITY = 'SQLDict' ...@@ -37,6 +37,16 @@ DEFAULT_ACTIVITY = 'SQLDict'
#DEFAULT_ACTIVITY = 'RAMDict' #DEFAULT_ACTIVITY = 'RAMDict'
def flushActivity(object, invoke=0, **kw):
# flush all activities related to this object
try:
object.portal_activities.flush(self, invoke=invoke, **kw)
except:
# If the portal_activities were not created
# nothing to do
pass
class ActiveObject(ExtensionClass.Base): class ActiveObject(ExtensionClass.Base):
security = ClassSecurityInfo() security = ClassSecurityInfo()
...@@ -57,17 +67,18 @@ class ActiveObject(ExtensionClass.Base): ...@@ -57,17 +67,18 @@ class ActiveObject(ExtensionClass.Base):
def flushActivity(self, invoke=0, **kw): def flushActivity(self, invoke=0, **kw):
# flush all activities related to this object # flush all activities related to this object
try: #try:
if 1:
self.portal_activities.flush(self, invoke=invoke, **kw) self.portal_activities.flush(self, invoke=invoke, **kw)
except: #except:
# If the portal_activities were not created # # If the portal_activities were not created
# nothing to do # # nothing to do
pass # pass
def recursiveFlushActivity(self, **kw): def recursiveFlushActivity(self, **kw):
# flush all activities related to this object # flush all activities related to this object
# updateAll is defined in ERP5Type # updateAll is defined in ERP5Type
self.updateAll(method=ActiveObject.flushActivity, **kw) self.recursiveApply(method=flushActivity, **kw)
security.declareProtected( CMFCorePermissions.View, 'hasActivity' ) security.declareProtected( CMFCorePermissions.View, 'hasActivity' )
def hasActivity(self, **kw): def hasActivity(self, **kw):
......
...@@ -70,6 +70,7 @@ class SQLDict(RAMDict): ...@@ -70,6 +70,7 @@ class SQLDict(RAMDict):
object_path is a tuple object_path is a tuple
""" """
path = '/'.join(object_path) path = '/'.join(object_path)
# LOG('Flush', 0, str((path, invoke, method_id)))
result = activity_tool.SQLDict_readMessageList(path=path, method_id=method_id) result = activity_tool.SQLDict_readMessageList(path=path, method_id=method_id)
method_dict = {} method_dict = {}
if invoke: if invoke:
......
...@@ -70,8 +70,8 @@ class Message: ...@@ -70,8 +70,8 @@ class Message:
def __call__(self, activity_tool): def __call__(self, activity_tool):
try: try:
#LOG('WARNING ActivityTool', 0, LOG('WARNING ActivityTool', 0,
# 'Trying to call method %s on object %s' % (self.method_id, self.object_path)) 'Trying to call method %s on object %s' % (self.method_id, self.object_path))
object = activity_tool.unrestrictedTraverse(self.object_path) object = activity_tool.unrestrictedTraverse(self.object_path)
getattr(object, self.method_id)(*self.args, **self.kw) getattr(object, self.method_id)(*self.args, **self.kw)
self.__is_executed = 1 self.__is_executed = 1
......
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