[Erp5-report] r14957 - /erp5/trunk/products/ERP5SyncML/XMLSyncUtils.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Jun 25 19:40:33 CEST 2007
Author: nicolas
Date: Mon Jun 25 19:40:32 2007
New Revision: 14957
URL: http://svn.erp5.org?rev=14957&view=rev
Log:
Remove useless method, which is allready define on Subscription
Modified:
erp5/trunk/products/ERP5SyncML/XMLSyncUtils.py
Modified: erp5/trunk/products/ERP5SyncML/XMLSyncUtils.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5SyncML/XMLSyncUtils.py?rev=14957&r1=14956&r2=14957&view=diff
==============================================================================
--- erp5/trunk/products/ERP5SyncML/XMLSyncUtils.py (original)
+++ erp5/trunk/products/ERP5SyncML/XMLSyncUtils.py Mon Jun 25 19:40:32 2007
@@ -398,25 +398,6 @@
xupdate = xupdate[xupdate.find('<xupdate:modifications'):]
return xupdate
- def getXMLObject(self, object=None, xml_mapping=None):
- """
- This just allow to get the xml of the object
- """
- if xml_mapping in ['None', None]:
- return ''
- xml_method = None
- xml = ""
- if xml_mapping is not None:
- if hasattr(object,xml_mapping):
- xml_method = getattr(object,xml_mapping)
- #elif hasattr(object,'manage_FTPget'):
- # xml_method = getattr(object,'manage_FTPget')
- if xml_method is not None:
- xml = xml_method()
- else:
- raise ValueError, "Sorry the script or method was not found"
- return xml
-
def getSessionId(self, xml):
"""
We will retrieve the session id of the message
@@ -808,8 +789,7 @@
signature.getStatus() != self.PARTIAL) or \
self.getAlertCode(remote_xml) == self.SLOW_SYNC:
#LOG('PubSyncModif',0,'Current object.getPath: %s' % object.getPath())
- xml_object = self.getXMLObject(object=object,
- xml_mapping=domain.xml_mapping)
+ xml_object = domain.getXMLFromObject(object)
xml_string = xml_object
if isinstance(xml_string, unicode):
xml_string = xml_object.encode('utf-8')
@@ -843,8 +823,7 @@
subscriber.addSignature(signature)
elif signature.getStatus()==self.NOT_SYNCHRONIZED \
or signature.getStatus()==self.PUB_CONFLICT_MERGE: # We don't have synchronized this object yet
- xml_object = self.getXMLObject(object=object,
- xml_mapping=domain.xml_mapping)
+ xml_object = domain.getXMLFromObject(object)
#LOG('getSyncMLData',0,'checkMD5: %s' % str(signature.checkMD5(xml_object)))
#LOG('getSyncMLData',0,'getStatus: %s' % str(signature.getStatus()))
if signature.getStatus()==self.PUB_CONFLICT_MERGE:
@@ -874,8 +853,7 @@
xml_string = '<!--' + short_string + '-->'
signature.setStatus(status)
if subscriber.getMediaType() != self.MEDIA_TYPE['TEXT_XML']:
- xml_string = self.getXMLObject(object=object,
- xml_mapping=domain.xml_mapping)
+ xml_string = domain.getXMLFromObject(object)
gid = signature.getRid()#in fisrt, we try with rid if there is one
if gid == None:
gid = signature.getGid()
@@ -892,8 +870,7 @@
conduit.updateNode(xml=subscriber_xupdate, object=object,
previous_xml=old_xml, force=(domain.getDomainType==self.SUB),
simulate=0)
- xml_object = self.getXMLObject(object=object,
- xml_mapping=domain.xml_mapping)
+ xml_object = domain.getXMLFromObject(object)
signature.setTempXML(xml_object)
if set_synchronized: # We have to do that after this previous update
# We should not have this case when we are in CONFLICT_MERGE
@@ -930,8 +907,7 @@
xml_string = '<!--' + xml_string + '-->'
signature.setStatus(status)
if(subscriber.getMediaType() != self.MEDIA_TYPE['TEXT_XML']):
- xml_string = self.getXMLObject(object=object,
- xml_mapping=domain.xml_mapping)
+ xml_string = domain.getXMLFromObject(object)
#LOG('xml_string =', 0, xml_string)
if signature.getAction()=='Replace':
gid = signature.getRid()#in fisrt, we try with rid if there is one
More information about the Erp5-report
mailing list