Commit 9b4d79c0 authored by Aurel's avatar Aurel

remove useless code

parent 4f3c0a5c
...@@ -28,51 +28,14 @@ ...@@ -28,51 +28,14 @@
############################################################################## ##############################################################################
# Namespaces.
SYNCML_NAMESPACE = 'SYNCML:SYNCML1.2'
# In SyncML Representation Protocol OMA
# we use URN as format of namespace
# List namespaces supported
URN_LIST = ('SYNCML:SYNCML1.1', 'SYNCML:SYNCML1.2')
SYNCML_NAMESPACE = 'SYNCML:SYNCML1.2'
NSMAP = {'syncml': SYNCML_NAMESPACE} NSMAP = {'syncml': SYNCML_NAMESPACE}
## SyncML Alert Codes
#TWO_WAY = 200
#SLOW_SYNC = 201 # This means we get the data from the publication
#ONE_WAY_FROM_SERVER = 204
#CODE_LIST = (TWO_WAY, ONE_WAY_FROM_SERVER,)
# SyncML Status Codes
#SUCCESS = 200
#ITEM_ADDED = 201
#WAITING_DATA = 214
#REFRESH_REQUIRED = 508
#CHUNK_OK = 214
#CONFLICT = 409 # A conflict is detected
#CONFLICT_MERGE = 207 # We have merged the two versions, sending
## whatever is needed to change(replace)
#CONFLICT_CLIENT_WIN = 208 # The client is the "winner", we keep
## the version of the client
#UNAUTHORIZED = 401
#AUTH_REQUIRED = 407
#AUTH_ACCEPTED = 212
NULL_ANCHOR = '00000000T000000Z' NULL_ANCHOR = '00000000T000000Z'
# ERP5 Sync Codes for Signatures
SYNCHRONIZED = 1
#SENT = 2
#NOT_SENT = 3
PARTIAL = 4
NOT_SYNCHRONIZED = 5
PUB_CONFLICT_MERGE = 6
PUB_CONFLICT_CLIENT_WIN = 8
#MAX_LINES = 5000
MAX_OBJECTS = 300 MAX_OBJECTS = 300
MAX_LEN = 1<<16 MAX_LEN = 1<<16
MAX_DOCUMENT_PER_MESSAGE = 2
XUPDATE_INSERT_LIST = ('xupdate:insert-after', 'xupdate:insert-before') XUPDATE_INSERT_LIST = ('xupdate:insert-after', 'xupdate:insert-before')
XUPDATE_ADD = 'xupdate:append' XUPDATE_ADD = 'xupdate:append'
...@@ -84,20 +47,7 @@ XUPDATE_INSERT_OR_ADD_LIST = XUPDATE_INSERT_LIST + (XUPDATE_ADD,) ...@@ -84,20 +47,7 @@ XUPDATE_INSERT_OR_ADD_LIST = XUPDATE_INSERT_LIST + (XUPDATE_ADD,)
ADD_ACTION = 'Add' ADD_ACTION = 'Add'
REPLACE_ACTION = 'Replace' REPLACE_ACTION = 'Replace'
##media types :
#MEDIA_TYPE = {}
#MEDIA_TYPE['TEXT_XML'] = 'text/xml'
#MEDIA_TYPE['TEXT_VCARD'] = 'text/vcard'
#MEDIA_TYPE['TEXT_XVCARD'] = 'text/x-vcard'
##content types :
#CONTENT_TYPE = {}
#CONTENT_TYPE['SYNCML_XML'] = 'application/vnd.syncml+xml'
#CONTENT_TYPE['SYNCML_WBXML'] = 'application/vnd.syncml+wbxml'
#Activity priority
ACTIVITY_PRIORITY = 5 ACTIVITY_PRIORITY = 5
class SynchronizationError(Exception): class SynchronizationError(Exception):
pass pass
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
############################################################################## ##############################################################################
from os import path from os import path
from lxml import etree
from logging import getLogger, Formatter from logging import getLogger, Formatter
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
...@@ -36,26 +35,14 @@ from Products.ERP5Type import Permissions ...@@ -36,26 +35,14 @@ from Products.ERP5Type import Permissions
from Products.ERP5Type.Globals import InitializeClass from Products.ERP5Type.Globals import InitializeClass
from Products.ERP5SyncML.SyncMLConstant import ACTIVITY_PRIORITY, \ from Products.ERP5SyncML.SyncMLConstant import ACTIVITY_PRIORITY, \
SynchronizationError SynchronizationError
from Products.ERP5SyncML.SyncMLMessage import SyncMLResponse, SyncMLRequest from Products.ERP5SyncML.SyncMLMessage import SyncMLRequest
from Products.ERP5SyncML.Engine.SynchronousEngine import SyncMLSynchronousEngine from Products.ERP5SyncML.Engine.SynchronousEngine import SyncMLSynchronousEngine
from Products.ERP5SyncML.Engine.AsynchronousEngine import SyncMLAsynchronousEngine from Products.ERP5SyncML.Engine.AsynchronousEngine import SyncMLAsynchronousEngine
from Products.ERP5SyncML.Transport.HTTP import HTTPTransport
from Products.ERP5SyncML.Transport.File import FileTransport
from Products.ERP5SyncML.Transport.Mail import MailTransport
from Products.ERP5.ERP5Site import getSite from Products.ERP5.ERP5Site import getSite
synchronous_engine = SyncMLSynchronousEngine() synchronous_engine = SyncMLSynchronousEngine()
asynchronous_engine = SyncMLAsynchronousEngine() asynchronous_engine = SyncMLAsynchronousEngine()
transport_scheme_dict = {
"http" : HTTPTransport(),
"https" : HTTPTransport(),
"file" : FileTransport(),
"mail" : MailTransport(),
}
parser = etree.XMLParser(remove_blank_text=True)
# Logging channel definitions # Logging channel definitions
# Main logging channel # Main logging channel
syncml_logger = getLogger('ERP5SyncML') syncml_logger = getLogger('ERP5SyncML')
...@@ -390,7 +377,6 @@ class SynchronizationTool(BaseTool): ...@@ -390,7 +377,6 @@ class SynchronizationTool(BaseTool):
return engine.processClientSynchronization(syncml_request, subscription) return engine.processClientSynchronization(syncml_request, subscription)
# Send the message # Send the message
# XXX This must depends on activity enables property, maybe use engine
if subscription.getIsActivityEnabled(): if subscription.getIsActivityEnabled():
subscription.activate( subscription.activate(
after_tag="%s_reset" %(subscription.getPath(),), after_tag="%s_reset" %(subscription.getPath(),),
......
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