Commit 8e1487d0 authored by Sebastien Robin's avatar Sebastien Robin

try to look at modification date for object in repo


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1133 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a1b500d5
...@@ -31,6 +31,7 @@ from Products.ERP5SyncML.SyncCode import SyncCode ...@@ -31,6 +31,7 @@ from Products.ERP5SyncML.SyncCode import SyncCode
from Products.ERP5SyncML.Subscription import Signature from Products.ERP5SyncML.Subscription import Signature
from xml.dom.ext.reader.Sax2 import FromXml from xml.dom.ext.reader.Sax2 import FromXml
from xml.dom.minidom import parse, parseString from xml.dom.minidom import parse, parseString
from DateTime import DateTime
from cStringIO import StringIO from cStringIO import StringIO
from xml.dom.ext import PrettyPrint from xml.dom.ext import PrettyPrint
import random import random
...@@ -572,9 +573,18 @@ class XMLSyncUtilsMixin(SyncCode): ...@@ -572,9 +573,18 @@ class XMLSyncUtilsMixin(SyncCode):
LOG('getSyncMLData',0,'alert_code == slowsync: %s' % str(self.getAlertCode(remote_xml)==self.SLOW_SYNC)) LOG('getSyncMLData',0,'alert_code == slowsync: %s' % str(self.getAlertCode(remote_xml)==self.SLOW_SYNC))
signature = subscriber.getSignature(object_gid) signature = subscriber.getSignature(object_gid)
LOG('getSyncMLData',0,'current object: %s' % str(object.getId())) LOG('getSyncMLData',0,'current object: %s' % str(object.getId()))
# Here we first check if the object was modified or not by looking at dates
if signature is not None: if signature is not None:
LOG('getSyncMLData',0,'signature.status: %s' % str(signature.getStatus())) LOG('getSyncMLData',0,'signature.status: %s' % str(signature.getStatus()))
LOG('getSyncMLData',0,'signature.action: %s' % str(signature.getAction())) LOG('getSyncMLData',0,'signature.action: %s' % str(signature.getAction()))
last_modification = object.ModificationDate()
last_synchronization = signature.getLastSynchronizationDate()
parent = object.aq_parent
# XXX CPS Specific
if parent.id == 'portal_repository':
if last_synchronization is not None and last_modification is not None:
if last_synchronization > last_modification:
signature.setStatus(self.SYNCHRONIZED)
status = self.SENT status = self.SENT
more_data=0 more_data=0
# For the case it was never synchronized, we have to send everything # For the case it was never synchronized, we have to send everything
......
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