Update activity in RAMQUEUE to SQLQUEUE


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28225 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 244ef66b
...@@ -647,12 +647,13 @@ class SynchronizationTool( SubscriptionSynchronization, ...@@ -647,12 +647,13 @@ class SynchronizationTool( SubscriptionSynchronization,
subscriber = conflict.getSubscriber() subscriber = conflict.getSubscriber()
publisher_object_path = conflict.getObjectPath() publisher_object_path = conflict.getObjectPath()
publisher_object = self.unrestrictedTraverse(publisher_object_path) publisher_object = self.unrestrictedTraverse(publisher_object_path)
publisher_xml = subscriber.getXMLFromObject(publisher_object) conduit_name = subscriber.getConduit()
conduit = self.getConduitByName(conduit_name)
publisher_xml = conduit.getXMLFromObjectWithId(publisher_object,\
xml_mapping=subscriber.getXMLMapping())
directory = publisher_object.aq_inner.aq_parent directory = publisher_object.aq_inner.aq_parent
object_id = self._getCopyId(publisher_object) object_id = self._getCopyId(publisher_object)
# Import the conduit and get it # Import the conduit and get it
conduit_name = subscriber.getConduit()
conduit = self.getConduitByName(conduit_name)
conduit.addNode( conduit.addNode(
xml=publisher_xml, xml=publisher_xml,
object=directory, object=directory,
...@@ -855,8 +856,7 @@ class SynchronizationTool( SubscriptionSynchronization, ...@@ -855,8 +856,7 @@ class SynchronizationTool( SubscriptionSynchronization,
return None return None
#use activities to send send an http response #use activities to send send an http response
#LOG('sendResponse, will start sendHttpResponse, xml', DEBUG, '') #LOG('sendResponse, will start sendHttpResponse, xml', DEBUG, '')
activity = self.getActivityType(domain=domain) self.activate(activity='SQLQueue',
self.activate(activity=activity,
tag=domain.getId(), tag=domain.getId(),
priority=self.PRIORITY).sendHttpResponse( priority=self.PRIORITY).sendHttpResponse(
sync_id=sync_id, sync_id=sync_id,
...@@ -931,8 +931,7 @@ class SynchronizationTool( SubscriptionSynchronization, ...@@ -931,8 +931,7 @@ class SynchronizationTool( SubscriptionSynchronization,
url_file = urllib2.urlopen(request) url_file = urllib2.urlopen(request)
result = url_file.read() result = url_file.read()
except socket.error, msg: except socket.error, msg:
activity = self.getActivityType(domain=domain) self.activate(activity='SQLQueue',
self.activate(activity=activity,
tag=domain.getId(), tag=domain.getId(),
priority=self.PRIORITY).sendHttpResponse( priority=self.PRIORITY).sendHttpResponse(
to_url=to_url, to_url=to_url,
...@@ -969,8 +968,7 @@ class SynchronizationTool( SubscriptionSynchronization, ...@@ -969,8 +968,7 @@ class SynchronizationTool( SubscriptionSynchronization,
uf = self.getPortalObject().acl_users uf = self.getPortalObject().acl_users
user = uf.getUserById(user_id).__of__(uf) user = uf.getUserById(user_id).__of__(uf)
newSecurityManager(None, user) newSecurityManager(None, user)
activity = self.getActivityType(domain=subscription) subscription.activate(activity='SQLQueue',
subscription.activate(activity=activity,
tag=subscription.getId(), tag=subscription.getId(),
priority=self.PRIORITY priority=self.PRIORITY
).SubSync(subscription.getPath()) ).SubSync(subscription.getPath())
...@@ -1034,8 +1032,7 @@ class SynchronizationTool( SubscriptionSynchronization, ...@@ -1034,8 +1032,7 @@ class SynchronizationTool( SubscriptionSynchronization,
publication.getTitle() == sync_id: publication.getTitle() == sync_id:
if publication.getActivityEnabled(): if publication.getActivityEnabled():
#use activities to send SyncML data. #use activities to send SyncML data.
activity = self.getActivityType(domain=publication) publication.activate(activity='SQLQueue',
publication.activate(activity=activity,
tag=publication.getId(), tag=publication.getId(),
priority=self.PRIORITY).PubSync( priority=self.PRIORITY).PubSync(
publication.getPath(), publication.getPath(),
...@@ -1053,14 +1050,12 @@ class SynchronizationTool( SubscriptionSynchronization, ...@@ -1053,14 +1050,12 @@ class SynchronizationTool( SubscriptionSynchronization,
if subscription.getSubscriptionUrl() == url and \ if subscription.getSubscriptionUrl() == url and \
subscription.getTitle() == sync_id: subscription.getTitle() == sync_id:
subscription_path = subscription.getPath() subscription_path = subscription.getPath()
activity = self.getActivityType(domain=subscription) self.activate(activity='SQLQueue',
self.activate(activity=activity,
tag=subscription.getId(), tag=subscription.getId(),
priority=self.PRIORITY).SubSync( priority=self.PRIORITY).SubSync(
subscription_path, subscription_path,
text) text)
return ' ' return ' '
# we use from only if we have a file # we use from only if we have a file
elif isinstance(from_url, str): elif isinstance(from_url, str):
if from_url.find('file://') == 0: if from_url.find('file://') == 0:
......
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