Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lukas Niegsch
erp5
Commits
9b4d79c0
Commit
9b4d79c0
authored
Jul 05, 2013
by
Aurel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove useless code
parent
4f3c0a5c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
66 deletions
+2
-66
product/ERP5SyncML/SyncMLConstant.py
product/ERP5SyncML/SyncMLConstant.py
+1
-51
product/ERP5SyncML/Tool/SynchronizationTool.py
product/ERP5SyncML/Tool/SynchronizationTool.py
+1
-15
No files found.
product/ERP5SyncML/SyncMLConstant.py
View file @
9b4d79c0
...
...
@@ -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
}
## 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'
# 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_LEN
=
1
<<
16
MAX_DOCUMENT_PER_MESSAGE
=
2
XUPDATE_INSERT_LIST
=
(
'xupdate:insert-after'
,
'xupdate:insert-before'
)
XUPDATE_ADD
=
'xupdate:append'
...
...
@@ -84,20 +47,7 @@ XUPDATE_INSERT_OR_ADD_LIST = XUPDATE_INSERT_LIST + (XUPDATE_ADD,)
ADD_ACTION
=
'Add'
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
class
SynchronizationError
(
Exception
):
pass
product/ERP5SyncML/Tool/SynchronizationTool.py
View file @
9b4d79c0
...
...
@@ -26,7 +26,6 @@
##############################################################################
from
os
import
path
from
lxml
import
etree
from
logging
import
getLogger
,
Formatter
from
AccessControl
import
ClassSecurityInfo
...
...
@@ -36,26 +35,14 @@ from Products.ERP5Type import Permissions
from
Products.ERP5Type.Globals
import
InitializeClass
from
Products.ERP5SyncML.SyncMLConstant
import
ACTIVITY_PRIORITY
,
\
SynchronizationError
from
Products.ERP5SyncML.SyncMLMessage
import
SyncMLRe
sponse
,
SyncMLRe
quest
from
Products.ERP5SyncML.SyncMLMessage
import
SyncMLRequest
from
Products.ERP5SyncML.Engine.SynchronousEngine
import
SyncMLSynchronousEngine
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
synchronous_engine
=
SyncMLSynchronousEngine
()
asynchronous_engine
=
SyncMLAsynchronousEngine
()
transport_scheme_dict
=
{
"http"
:
HTTPTransport
(),
"https"
:
HTTPTransport
(),
"file"
:
FileTransport
(),
"mail"
:
MailTransport
(),
}
parser
=
etree
.
XMLParser
(
remove_blank_text
=
True
)
# Logging channel definitions
# Main logging channel
syncml_logger
=
getLogger
(
'ERP5SyncML'
)
...
...
@@ -390,7 +377,6 @@ class SynchronizationTool(BaseTool):
return
engine
.
processClientSynchronization
(
syncml_request
,
subscription
)
# Send the message
# XXX This must depends on activity enables property, maybe use engine
if
subscription
.
getIsActivityEnabled
():
subscription
.
activate
(
after_tag
=
"%s_reset"
%
(
subscription
.
getPath
(),),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment