Commit 9b22e41d authored by Sebastien Robin's avatar Sebastien Robin

by Fabien, use the library Ft.Xml instead of xml.dom.minidom in order to make...

by Fabien, use the library Ft.Xml instead of xml.dom.minidom in order to make synchronization faster, and use xpath exression, this make the code much more cleaner

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14478 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c08f67d8
This diff is collapsed.
......@@ -29,8 +29,7 @@
import smtplib # to send emails
from Publication import Publication,Subscriber
from Subscription import Signature
from xml.dom.ext.reader.Sax2 import FromXmlStream, FromXml
from xml.dom.minidom import parse, parseString
from Ft.Xml import Parse
from XMLSyncUtils import XMLSyncUtils
from Conduit.ERP5Conduit import ERP5Conduit
from Products.CMFCore.utils import getToolByName
......@@ -221,7 +220,7 @@ class PublicationSynchronization(XMLSyncUtils):
if xml_client is not None:
if isinstance(xml_client, str) or isinstance(xml_client, unicode):
xml_client = parseString(xml_client)
xml_client = Parse(xml_client)
first_node = xml_client.childNodes[0]
if first_node.nodeName != "SyncML":
......
......@@ -28,9 +28,7 @@
import smtplib # to send emails
from Subscription import Subscription,Signature
from xml.dom.ext.reader.Sax2 import FromXmlStream, FromXml
from xml.dom.minidom import parse, parseString
from xml.dom.ext import PrettyPrint
from Ft.Xml import Parse
from XMLSyncUtils import XMLSyncUtils
import commands
from Conduit.ERP5Conduit import ERP5Conduit
......@@ -99,7 +97,7 @@ class SubscriptionSynchronization(XMLSyncUtils):
else:
xml_client = msg
if isinstance(xml_client, str) or isinstance(xml_client, unicode):
xml_client = parseString(xml_client)
xml_client = Parse(xml_client)
next_status = self.getNextSyncBodyStatus(xml_client, None)
#LOG('readResponse, next status :',0,next_status)
if next_status is not None:
......
......@@ -40,8 +40,7 @@ from Products.ERP5SyncML import Conduit
from Publication import Publication,Subscriber
from Products.BTreeFolder2.BTreeFolder2 import BTreeFolder2
from Subscription import Subscription,Signature
from xml.dom.ext.reader.Sax2 import FromXmlStream, FromXml
from xml.dom.minidom import parse, parseString
from Ft.Xml import Parse
from Products.ERP5Type import Permissions
from PublicationSynchronization import PublicationSynchronization
from SubscriptionSynchronization import SubscriptionSynchronization
......@@ -50,7 +49,6 @@ from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import noSecurityManager
from AccessControl.User import UnrestrictedUser
from Acquisition import aq_base
from xml.parsers.expat import ExpatError # parseString error
import urllib
import urllib2
import socket
......@@ -974,7 +972,7 @@ class SynchronizationTool( SubscriptionSynchronization,
commands.getstatusoutput('rm -f /tmp/%s.gz.gpg' % filename)
# Get the target and then find the corresponding publication or
# Subscription
xml = parseString(text)
xml = Parse(text)
#XXX this function is not very optimized and should be improved
url = self.getTarget(xml)
for publication in self.getPublicationList():
......
This diff is collapsed.
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