Commit ac621566 authored by Aurel's avatar Aurel

better naming for zsql methods

parent 069c122e
......@@ -53,7 +53,7 @@
<value> <string>from Products.ERP5Type.Utils import UpperCase\n
from ZODB.POSException import ConflictError\n
\n
method = context.z_catalog_syncml_signature_list\n
method = context.z_catalog_syncml_document_list\n
property_list = method.arguments_src.split()\n
parameter_dict = {}\n
failed_path_list = []\n
......@@ -64,13 +64,7 @@ for path in path_list:\n
try:\n
tmp_dict = {}\n
for property in property_list:\n
if property == "validation_state":\n
try:\n
value = getattr(obj, \'get%s\' % UpperCase(property))()\n
except AttributeError:\n
# Data from source has no state\n
value = ""\n
elif property == "gid" and subscription_path: \n
if property == "gid" and subscription_path: \n
# Call specific method to compute GID on source data\n
value = subscription.getGidFromObject(obj)\n
elif property == "gid":\n
......@@ -108,7 +102,7 @@ if parameter_dict:\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SQLCatalog_indexSyncMLSignatureList</string> </value>
<value> <string>SQLCatalog_indexSyncMLDocumentList</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -8,10 +8,7 @@
<dictionary>
<item>
<key> <string>arguments_src</string> </key>
<value> <string>gid\r\n
path\r\n
validation_state\r\n
</string> </value>
<value> <string encoding="base64">Z2lkDQpwYXRoDQo=</string> </value>
</item>
<item>
<key> <string>connection_id</string> </key>
......@@ -19,28 +16,19 @@ validation_state\r\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>z_catalog_syncml_signature_list</string> </value>
<value> <string>z_catalog_syncml_document_list</string> </value>
</item>
<item>
<key> <string>src</string> </key>
<value> <string encoding="cdata"><![CDATA[
DELETE FROM\n
syncml\n
WHERE\n
<dtml-in path>\n
path=<dtml-sqlvar sequence-item type="string"><dtml-if sequence-end><dtml-else> OR </dtml-if>\n
</dtml-in>\n
;\n
<dtml-var "\'\\0\'">\n
INSERT INTO\n
syncml\n
REPLACE INTO\n
syncml (`path`, `gid`)\n
VALUES\n
<dtml-in prefix="loop" expr="_.range(_.len(path))">\n
(\n
<dtml-sqlvar expr="gid[loop_item]" type="string">,\n
<dtml-sqlvar expr="path[loop_item]" type="string">,\n
<dtml-sqlvar expr="validation_state[loop_item]" type="string">\n
<dtml-sqlvar expr="gid[loop_item]" type="string">\n
)<dtml-unless sequence-end>,</dtml-unless>\n
</dtml-in>\n
......
......@@ -27,12 +27,11 @@
<item>
<key> <string>src</string> </key>
<value> <string>CREATE TABLE `syncml` (\n
`gid` varchar(255) COLLATE utf8_unicode_ci DEFAULT \'\',\n
`path` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT \'\',\n
`validation_state` varchar(255) COLLATE utf8_unicode_ci DEFAULT \'\',\n
`gid` varchar(255) COLLATE utf8_unicode_ci DEFAULT \'\'\n
PRIMARY KEY (`path`),\n
KEY `gid` (`gid`,`path`)\n
)\n
) ENGINE=InnoDB;\n
</string> </value>
</item>
<item>
......
......@@ -6,31 +6,8 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>allow_simple_one_argument_traversal</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>arguments_src</string> </key>
<value> <string>path\r\n
limit</string> </value>
</item>
<item>
<key> <string>cache_time_</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>class_file_</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>class_name_</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>connection_hook</string> </key>
<value> <string></string> </value>
</item>
<item>
......@@ -39,31 +16,11 @@ limit</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>z_get_syncml_data</string> </value>
</item>
<item>
<key> <string>max_cache_</string> </key>
<value> <int>100</int> </value>
</item>
<item>
<key> <string>max_rows_</string> </key>
<value> <int>0</int> </value>
<value> <string>z_drop_syncml</string> </value>
</item>
<item>
<key> <string>src</string> </key>
<value> <string encoding="cdata"><![CDATA[
SELECT \n
gid\n
FROM syncml\n
WHERE\n
path like <dtml-sqlvar path type="string">\n
ORDER BY gid\n
<dtml-if limit>\n
LIMIT <dtml-var limit>\n
</dtml-if>
]]></string> </value>
<value> <string>DROP TABLE IF EXISTS syncml</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -19,6 +19,7 @@ max_gid\r\n
path\r\n
first_call\r\n
last_call\r\n
limit\r\n
</string> </value>
</item>
<item>
......@@ -43,7 +44,7 @@ last_call\r\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>z_get_signature</string> </value>
<value> <string>z_get_syncml_gid_list</string> </value>
</item>
<item>
<key> <string>max_cache_</string> </key>
......@@ -73,7 +74,9 @@ WHERE\n
AND gid <= <dtml-sqlvar max_gid type="string">\n
</dtml-if>\n
ORDER BY gid\n
<dtml-if limit>\n
LIMIT <dtml-var limit>\n
</dtml-if>
]]></string> </value>
</item>
......
......@@ -17,7 +17,7 @@ path</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>z_get_syncml_path</string> </value>
<value> <string>z_get_syncml_path_list</string> </value>
</item>
<item>
<key> <string>src</string> </key>
......
......@@ -16,7 +16,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>z_unindex_data</string> </value>
<value> <string>z_unindex_syncml_data</string> </value>
</item>
<item>
<key> <string>src</string> </key>
......
92
\ No newline at end of file
93
\ 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