Commit 4a36579c authored by Aurel's avatar Aurel

update method to last modication & add missing transition

parent 956b26b1
......@@ -52,7 +52,7 @@
<key> <string>_body</string> </key>
<value> <string>from Products.ERP5Type.Utils import UpperCase\n
from ZODB.POSException import ConflictError\n
\n
# XXX à refaire pour optimisation\n
method = context.z_catalog_syncml_document_list\n
property_list = method.arguments_src.split()\n
parameter_dict = {}\n
......@@ -64,10 +64,19 @@ for path in path_list:\n
try:\n
tmp_dict = {}\n
for property in property_list:\n
if property == "gid" and subscription_path: \n
if subscription_path:\n
if property == "gid": \n
# Call specific method to compute GID on source data\n
value = subscription.getGidFromObject(obj)\n
elif property == "gid":\n
elif property == "data":\n
conduit = subscription.getConduit()\n
value = conduit.getXMLFromObjectWithId(obj,\n
xml_mapping=subscription.getXmlBindingGeneratorMethodId(),\n
context_document=subscription.getPath())\n
else:\n
value = getattr(obj, \'get%s\' % UpperCase(property))() \n
else:\n
if property == "gid":\n
# Signature GID is defined as its ID\n
value = getattr(obj, \'getId\')()\n
else:\n
......
......@@ -29,6 +29,7 @@
<value> <string>CREATE TABLE `syncml` (\n
`path` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT \'\',\n
`gid` varchar(255) COLLATE utf8_unicode_ci DEFAULT \'\',\n
`data` LONGBLOB COLLATE utf8_unicode_ci DEFAULT NULL,\n
PRIMARY KEY (`path`),\n
KEY `gid` (`gid`,`path`)\n
) ENGINE=InnoDB;\n
......
......@@ -14,11 +14,10 @@
</item>
<item>
<key> <string>arguments_src</string> </key>
<value> <string>min_gid\r\n
<value> <string>strict_min_gid\r\n
min_gid\r\n
max_gid\r\n
path\r\n
first_call\r\n
last_call\r\n
limit\r\n
</string> </value>
</item>
......@@ -65,19 +64,14 @@ SELECT \n
FROM syncml\n
WHERE\n
path like <dtml-sqlvar path type="string">\n
<dtml-if strict_min_gid>\n
AND gid > <dtml-sqlvar strict_min_gid type="string">\n
</dtml-if>\n
<dtml-if min_gid>\n
<dtml-if first_call>\n
/* Do nothing here */\n
<dtml-else>\n
AND gid >= <dtml-sqlvar min_gid type="string">\n
</dtml-if>\n
</dtml-if>\n
<dtml-if max_gid>\n
<dtml-if last_call>\n
/* Do nothing here */\n
<dtml-else>\n
AND gid <= <dtml-sqlvar max_gid type="string">\n
</dtml-if>\n
<dtml-if strict_max_gid>\n
AND gid <= <dtml-sqlvar strict_max_gid type="string">\n
</dtml-if>\n
ORDER BY gid\n
<dtml-if limit>\n
......
......@@ -23,6 +23,7 @@
<value>
<tuple>
<string>change_to_conflict</string>
<string>change_to_partial</string>
<string>do_sync</string>
<string>drift</string>
</tuple>
......
98
\ No newline at end of file
99
\ No newline at end of file
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