diff --git a/product/ERP5SyncML/Conduit/ERP5ConduitTitleGid.py b/product/ERP5SyncML/Conduit/ERP5ConduitTitleGid.py index 5e4eb589a92ab7392a81f9c82ebee6e1d497ab04..d14ac700cc9cfe49aa14a1ca1c93212a910c6ed5 100644 --- a/product/ERP5SyncML/Conduit/ERP5ConduitTitleGid.py +++ b/product/ERP5SyncML/Conduit/ERP5ConduitTitleGid.py @@ -49,9 +49,15 @@ class ERP5ConduitTitleGid(ERP5Conduit): """ return object.getTitle() -# def getGidFromXML(self, xml): -# """ -# return the Gid composed of FirstName and LastName generate with a peace of -# xml -# """ -# #to be defined + def getGidFromXML(self, xml, namespace, gid_from_xml_list): + """ + return the Gid composed of FirstName and LastName generate with a peace of + xml + """ + first_name = xml.xpath('string(.//syncml:object//syncml:first_name)') + last_name = xml.xpath('string(.//syncml:object//syncml:last_name)') + gid = "%s %s" % (first_name, last_name) + if gid in gid_from_xml_list or gid == ' ': + return False + return gid + diff --git a/product/ERP5SyncML/Conduit/SharedVCardConduit.py b/product/ERP5SyncML/Conduit/SharedVCardConduit.py index b1d72f00f98550c065fd7ae79e304bb2a3f283fe..83a38be14c7a395cdac82f5f21ee5bde6b13dc51 100755 --- a/product/ERP5SyncML/Conduit/SharedVCardConduit.py +++ b/product/ERP5SyncML/Conduit/SharedVCardConduit.py @@ -70,7 +70,7 @@ class SharedVCardConduit(VCardConduit, SyncCode): LOG('getGidFromObject gid :', DEBUG, gid) return gid - def getGidFromXML(self, vcard, gid_from_xml_list): + def getGidFromXML(self, vcard, namespace, gid_from_xml_list): """ return the Gid composed of FirstName and LastName generate with a vcard """