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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eteri
erp5
Commits
3e4039c5
Commit
3e4039c5
authored
Mar 19, 2013
by
Aurel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
object_id is no longer provided by synchronization tool
parent
a3e3dacd
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
52 additions
and
32 deletions
+52
-32
bt5/erp5_tiosafe_core/ExtensionTemplateItem/TioSafeBaseConduit.py
..._tiosafe_core/ExtensionTemplateItem/TioSafeBaseConduit.py
+2
-2
bt5/erp5_tiosafe_core/bt/revision
bt5/erp5_tiosafe_core/bt/revision
+1
-1
bt5/erp5_tiosafe_oscommerce/ExtensionTemplateItem/OscommerceERP5NodeConduit.py
...mmerce/ExtensionTemplateItem/OscommerceERP5NodeConduit.py
+1
-1
bt5/erp5_tiosafe_oscommerce/ExtensionTemplateItem/OscommerceERP5TransactionConduit.py
...ExtensionTemplateItem/OscommerceERP5TransactionConduit.py
+2
-2
bt5/erp5_tiosafe_oscommerce/bt/revision
bt5/erp5_tiosafe_oscommerce/bt/revision
+1
-1
bt5/erp5_tiosafe_ubercart_test/ExtensionTemplateItem/ERP5TransactionConduit.py
...cart_test/ExtensionTemplateItem/ERP5TransactionConduit.py
+2
-2
bt5/erp5_tiosafe_ubercart_test/bt/revision
bt5/erp5_tiosafe_ubercart_test/bt/revision
+1
-1
product/ERP5SyncML/Conduit/ERP5Conduit.py
product/ERP5SyncML/Conduit/ERP5Conduit.py
+2
-1
product/ERP5SyncML/Document/SyncMLSubscription.py
product/ERP5SyncML/Document/SyncMLSubscription.py
+27
-9
product/ERP5SyncML/Tool/SynchronizationTool.py
product/ERP5SyncML/Tool/SynchronizationTool.py
+2
-0
product/ERP5TioSafe/Conduit/AccountERP5IntegrationConduit.py
product/ERP5TioSafe/Conduit/AccountERP5IntegrationConduit.py
+2
-2
product/ERP5TioSafe/Conduit/AccountingERP5IntegrationConduit.py
...t/ERP5TioSafe/Conduit/AccountingERP5IntegrationConduit.py
+2
-2
product/ERP5TioSafe/Conduit/ERP5NodeConduit.py
product/ERP5TioSafe/Conduit/ERP5NodeConduit.py
+2
-3
product/ERP5TioSafe/Conduit/ERP5PaymentTransactionConduit.py
product/ERP5TioSafe/Conduit/ERP5PaymentTransactionConduit.py
+2
-2
product/ERP5TioSafe/Conduit/ERP5ResourceConduit.py
product/ERP5TioSafe/Conduit/ERP5ResourceConduit.py
+1
-1
product/ERP5TioSafe/Conduit/ERP5TransactionConduit.py
product/ERP5TioSafe/Conduit/ERP5TransactionConduit.py
+2
-2
No files found.
bt5/erp5_tiosafe_core/ExtensionTemplateItem/TioSafeBaseConduit.py
View file @
3e4039c5
...
...
@@ -28,8 +28,8 @@
#
##############################################################################
from
Products.ERP5SyncML.SyncMLConstant
import
XUPDATE_
ELEMENT
,
\
XUPDATE_INSERT_OR_ADD_LIST
,
XUPDATE_DEL
,
XUPDATE_UPDATE
from
Products.ERP5SyncML.SyncMLConstant
import
XUPDATE_
INSERT_OR_ADD_LIST
,
\
XUPDATE_DEL
,
XUPDATE_UPDATE
from
Products.ERP5Type.XMLExportImport
import
MARSHALLER_NAMESPACE_URI
from
zLOG
import
LOG
,
INFO
from
Products.ERP5SyncML.Conduit.ERP5Conduit
import
ERP5Conduit
...
...
bt5/erp5_tiosafe_core/bt/revision
View file @
3e4039c5
633
\ No newline at end of file
634
\ No newline at end of file
bt5/erp5_tiosafe_oscommerce/ExtensionTemplateItem/OscommerceERP5NodeConduit.py
View file @
3e4039c5
...
...
@@ -114,7 +114,7 @@ class OscommerceERP5NodeConduit(TioSafeBaseConduit):
""" This is the method calling to create an object. """
if
DEBUG
:
LOG
(
"ERP5NodeContuide._createContent"
,
INFO
,
"xml = %s"
%
(
etree
.
tostring
(
xml
,
pretty_print
=
True
),))
if
object_id
is
not
None
:
if
True
:
#
object_id is not None:
sub_object
=
None
if
sub_object
is
None
:
# If so, it doesn't exist
sub_object
,
reset_local_roles
,
reset_workflow
=
self
.
constructContent
(
...
...
bt5/erp5_tiosafe_oscommerce/ExtensionTemplateItem/OscommerceERP5TransactionConduit.py
View file @
3e4039c5
...
...
@@ -59,8 +59,8 @@ class OscommerceERP5TransactionConduit(TioSafeBaseConduit):
"""
if
object_id
is
None
:
object_id
=
self
.
getAttribute
(
xml
,
'id'
)
if
object_id
is
not
None
:
if
sub_object
is
None
:
if
True
:
#
object_id is not None:
if
sub_object
is
None
and
object_id
:
try
:
sub_object
=
object
.
_getOb
(
object_id
)
except
(
AttributeError
,
KeyError
,
TypeError
):
...
...
bt5/erp5_tiosafe_oscommerce/bt/revision
View file @
3e4039c5
292
\ No newline at end of file
293
\ No newline at end of file
bt5/erp5_tiosafe_ubercart_test/ExtensionTemplateItem/ERP5TransactionConduit.py
View file @
3e4039c5
...
...
@@ -59,8 +59,8 @@ class ERP5TransactionConduit(TioSafeBaseConduit):
"""
if
object_id
is
None
:
object_id
=
self
.
getAttribute
(
xml
,
'id'
)
if
object_id
is
not
None
:
if
sub_object
is
None
:
if
True
:
#
object_id is not None:
if
sub_object
is
None
and
object_id
:
try
:
sub_object
=
object
.
_getOb
(
object_id
)
except
(
AttributeError
,
KeyError
,
TypeError
):
...
...
bt5/erp5_tiosafe_ubercart_test/bt/revision
View file @
3e4039c5
33
\ No newline at end of file
34
\ No newline at end of file
product/ERP5SyncML/Conduit/ERP5Conduit.py
View file @
3e4039c5
...
...
@@ -931,7 +931,8 @@ class ERP5Conduit(XMLSyncUtilsMixin):
This
is
really
usefull
if
you
want
to
write
your
own
Conduit
.
"""
#LOG('ERP5Conduit.addNode',0,'portal_type: |%s|' % str(portal_type))
from zLOG import LOG
LOG('ERP5Conduit.addNode',0,'portal_type: |%s|' % str(portal_type))
subobject = object.newContent(portal_type=portal_type, id=object_id)
return subobject, True, True
...
...
product/ERP5SyncML/Document/SyncMLSubscription.py
View file @
3e4039c5
...
...
@@ -129,13 +129,13 @@ class SyncMLSubscription(XMLObject):
result_count
=
len
(
r
)
generated_other_activity
=
False
if
result_count
:
syncml_logger
.
info
(
"getAndActivate : got %d result, limit = %d, packet %d"
%
syncml_logger
.
debug
(
"getAndActivate : got %d result, limit = %d, packet %d"
%
(
result_count
,
limit
,
packet_size
))
if
result_count
==
limit
:
# Recursive call to prevent too many activity generation
next_kw
=
dict
(
activate_kw
,
priority
=
1
+
activate_kw
.
get
(
'priority'
,
1
))
kw
[
"min_id"
]
=
r
[
-
1
].
getId
()
syncml_logger
.
info
(
"--> calling getAndActivate in activity, min = %s"
%
syncml_logger
.
debug
(
"--> calling getAndActivate in activity, min = %s"
%
(
kw
[
"min_id"
],))
self
.
activate
(
**
next_kw
).
getAndActivate
(
...
...
@@ -148,7 +148,7 @@ class SyncMLSubscription(XMLObject):
callback_method
=
getattr
(
activate
(
**
activate_kw
),
callback
)
if
generated_other_activity
:
for
i
in
xrange
(
0
,
result_count
,
packet_size
):
syncml_logger
.
info
(
"-- getAndActivate : recursive call, generating for %s"
syncml_logger
.
debug
(
"-- getAndActivate : recursive call, generating for %s"
%
(
r
[
i
:
i
+
packet_size
],))
callback_method
(
id_list
=
r
[
i
:
i
+
packet_size
],
message_id
=
message_id_list
.
pop
(),
...
...
@@ -157,14 +157,14 @@ class SyncMLSubscription(XMLObject):
else
:
i
=
0
for
i
in
xrange
(
0
,
result_count
-
packet_size
,
packet_size
):
syncml_logger
.
info
(
"-- getAndActivate : call, generating for %s : %s"
%
syncml_logger
.
debug
(
"-- getAndActivate : call, generating for %s : %s"
%
(
r
[
i
:
i
+
packet_size
],
activate_kw
))
callback_method
(
id_list
=
r
[
i
:
i
+
packet_size
],
message_id
=
message_id_list
.
pop
(),
activate_kw
=
activate_kw
,
**
method_kw
)
# Final activity must be executed after all other
syncml_logger
.
info
(
"---- getAndActivate : final call for %s : %s"
%
(
r
[
i
+
packet_size
:],
activate_kw
))
syncml_logger
.
debug
(
"---- getAndActivate : final call for %s : %s"
%
(
r
[
i
+
packet_size
:],
activate_kw
))
callback_method
(
id_list
=
r
[
i
+
packet_size
:],
# XXX Has to be unit tested
# with mock object
message_id
=
message_id_list
.
pop
(),
...
...
@@ -428,7 +428,7 @@ class SyncMLSubscription(XMLObject):
message_ref
=
request_message_id
)
else
:
# We want to retrieve more data
syncml_logger
.
info
(
"we need to retrieve more data for %s"
%
(
signature
,))
syncml_logger
.
debug
(
"we need to retrieve more data for %s"
%
(
signature
,))
if
signature
.
getValidationState
()
!=
'partial'
:
signature
.
changeToPartial
()
signature
.
appendPartialData
(
incoming_data
)
...
...
@@ -481,7 +481,7 @@ class SyncMLSubscription(XMLObject):
XXX Comment to be fixed
"""
if
not
id_list
:
syncml_logger
.
warning
(
"Non optimal call to _getSyncMLData, no id list provided
"
)
syncml_logger
.
warning
(
"Non optimal call to _getSyncMLData, no id list provided
: %r"
%
(
id_list
)
)
else
:
syncml_logger
.
info
(
"getSyncMLData, id list provided %s"
%
(
id_list
,))
...
...
@@ -551,7 +551,7 @@ class SyncMLSubscription(XMLObject):
syncml_logger
.
debug
(
"Created a signature %s for gid = %s, path %s"
%
(
signature
.
getPath
(),
gid
,
document
.
getPath
()))
if
len
(
document_data
)
>
MAX_LEN
:
syncml_logger
.
info
(
"data too big, sending multiple message"
)
syncml_logger
.
debug
(
"data too big, sending multiple message"
)
more_data
=
True
finished
=
False
document_data
,
rest_string
=
cutXML
(
document_data
,
MAX_LEN
)
...
...
@@ -564,6 +564,8 @@ class SyncMLSubscription(XMLObject):
# confirmation that the document was well synchronized
signature
.
setTemporaryData
(
document_data
)
signature
.
doSync
()
syncml_logger
.
debug
(
"signature %s is syncing"
%
(
signature
.
getRelativeUrl
(),))
# Generate the message
syncml_response
.
addSyncCommand
(
...
...
@@ -609,6 +611,9 @@ class SyncMLSubscription(XMLObject):
# but Diff generator will return no diff for it
# in this case, no need to send diff
signature
.
synchronize
()
syncml_logger
.
debug
(
"signature %s is synchronized"
%
(
signature
.
getRelativeUrl
(),))
continue
# Split data if necessary
...
...
@@ -621,12 +626,18 @@ class SyncMLSubscription(XMLObject):
signature
.
setPartialAction
(
REPLACE_ACTION
)
if
signature
.
getValidationState
()
!=
'partial'
:
signature
.
changeToPartial
()
syncml_logger
.
debug
(
"signature %s is partial"
%
(
signature
.
getRelativeUrl
(),))
else
:
# Store the new representation of the document
# It will be copy to "data" property once synchronization
# is confirmed
signature
.
setTemporaryData
(
xml_object
)
signature
.
doSync
()
syncml_logger
.
debug
(
"signature %s is syncing"
%
(
signature
.
getRelativeUrl
(),))
# Generate the command
syncml_logger
.
debug
(
"will send Replace command with %s"
...
...
@@ -640,6 +651,8 @@ class SyncMLSubscription(XMLObject):
elif
signature
.
getValidationState
()
!=
'synchronized'
:
# We should not have this case when we are in CONFLICT_MERGE
syncml_logger
.
debug
(
"signature %s is synchronized"
%
(
signature
.
getRelativeUrl
(),))
signature
.
synchronize
()
elif
signature
.
getValidationState
()
==
\
...
...
@@ -662,6 +675,8 @@ class SyncMLSubscription(XMLObject):
sync_code
=
'conflict_resolved_with_client_command_winning'
,
command
=
'Replace'
)
signature
.
synchronize
()
syncml_logger
.
debug
(
"signature %s is synchronized"
%
(
signature
.
getRelativeUrl
(),))
elif
signature
.
getValidationState
()
==
'partial'
:
# Case of partially sent data
xml_string
=
signature
.
getPartialData
()
...
...
@@ -683,6 +698,8 @@ class SyncMLSubscription(XMLObject):
if
not
more_data
:
signature
.
doSync
()
syncml_logger
.
debug
(
"signature %s is syncing"
%
(
signature
.
getRelativeUrl
(),))
elif
signature
.
getValidationState
()
in
(
'syncing'
,
'synchronized'
):
raise
ValueError
(
"Must not get signature in %s state here, signature is %s"
%
(
signature
.
getValidationState
(),
...
...
@@ -697,7 +714,8 @@ class SyncMLSubscription(XMLObject):
syncml_logger
.
warning
(
"Package is going to be splitted"
)
break
loop
+=
1
syncml_logger
.
debug
(
"_getSyncMLData end with finished %s"
%
(
finished
,))
return
finished
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
...
...
product/ERP5SyncML/Tool/SynchronizationTool.py
View file @
3e4039c5
...
...
@@ -503,6 +503,8 @@ class SynchronizationTool(BaseTool):
# Send the message in activity to prevent recomputing data in case of
# transport failure
syncml_logger
.
info
(
"%s sendDeleteCommand with final tag"
%
(
subscription
.
getRelativeUrl
()))
subscription
.
activate
(
**
activate_kw
).
sendMessage
(
xml
=
str
(
syncml_response
))
...
...
product/ERP5TioSafe/Conduit/AccountERP5IntegrationConduit.py
View file @
3e4039c5
...
...
@@ -53,8 +53,8 @@ class AccountERP5IntegrationConduit(TioSafeBaseConduit):
"""
if
object_id
is
None
:
object_id
=
self
.
getAttribute
(
xml
,
'id'
)
if
object_id
is
not
None
:
if
sub_object
is
None
:
if
True
:
#
object_id is not None:
if
sub_object
is
None
and
object_id
:
try
:
sub_object
=
object
.
_getOb
(
object_id
)
except
(
AttributeError
,
KeyError
,
TypeError
):
...
...
product/ERP5TioSafe/Conduit/AccountingERP5IntegrationConduit.py
View file @
3e4039c5
...
...
@@ -103,8 +103,8 @@ class AccountingERP5IntegrationConduit(TioSafeBaseConduit):
"""
if
object_id
is
None
:
object_id
=
self
.
getAttribute
(
xml
,
'id'
)
if
object_id
is
not
None
:
if
sub_object
is
None
:
if
True
:
#
object_id is not None:
if
sub_object
is
None
and
object_id
:
sub_object
=
object
.
_getOb
(
object_id
,
None
)
if
sub_object
is
None
:
# If so, it does not exist
portal_type
=
''
...
...
product/ERP5TioSafe/Conduit/ERP5NodeConduit.py
View file @
3e4039c5
...
...
@@ -164,7 +164,7 @@ class ERP5NodeConduit(TioSafeBaseConduit):
""" This is the method calling to create an object. """
# if DEBUG:
# LOG("ERP5NodeContuide._createContent", INFO, "xml = %s" %(etree.tostring(xml, pretty_print=True),))
if
object_id
is
not
None
:
if
True
:
#
object_id is not None:
sub_object
=
None
if
sub_object
is
None
:
# If so, it doesn't exist
# Check if we can find it in module
...
...
@@ -288,7 +288,6 @@ class ERP5NodeConduit(TioSafeBaseConduit):
reset_workflow
=
reset_workflow
,
)
self
.
afterCreateMethod
(
sub_object
,
**
kw
)
return
sub_object
...
...
product/ERP5TioSafe/Conduit/ERP5PaymentTransactionConduit.py
View file @
3e4039c5
...
...
@@ -102,8 +102,8 @@ class ERP5PaymentTransactionConduit(TioSafeBaseConduit):
"""
if
object_id
is
None
:
object_id
=
self
.
getAttribute
(
xml
,
'id'
)
if
object_id
is
not
None
:
if
sub_object
is
None
:
if
True
:
#
object_id is not None:
if
sub_object
is
None
and
object_id
:
try
:
sub_object
=
object
.
_getOb
(
object_id
)
except
(
AttributeError
,
KeyError
,
TypeError
):
...
...
product/ERP5TioSafe/Conduit/ERP5ResourceConduit.py
View file @
3e4039c5
...
...
@@ -51,7 +51,7 @@ class ERP5ResourceConduit(TioSafeBaseConduit):
"""
This is the method calling to create an object
"""
if
object_id
is
not
None
:
if
True
:
#
object_id is not None:
if
sub_object
is
None
:
sub_object
=
object
.
_getOb
(
object_id
,
None
)
if
sub_object
is
None
:
# If so, it does not exist
...
...
product/ERP5TioSafe/Conduit/ERP5TransactionConduit.py
View file @
3e4039c5
...
...
@@ -60,8 +60,8 @@ class ERP5TransactionConduit(TioSafeBaseConduit):
"""
if
object_id
is
None
:
object_id
=
self
.
getAttribute
(
xml
,
'id'
)
if
object_id
is
not
None
:
if
sub_object
is
None
:
if
True
:
#
object_id is not None:
if
sub_object
is
None
and
object_id
:
try
:
sub_object
=
object
.
_getOb
(
object_id
)
except
(
AttributeError
,
KeyError
,
TypeError
):
...
...
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