Commit 4a36579c authored by Aurel's avatar Aurel

update method to last modication & add missing transition

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