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
Xueyun Qian
erp5
Commits
4057fd51
Commit
4057fd51
authored
Jul 12, 2013
by
Aurel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rewrite indexation method (done by vincent) & fix sql condition to prevent overriding
parent
c820b88e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
47 deletions
+31
-47
bt5/erp5_syncml/SkinTemplateItem/portal_skins/erp5_syncml/SQLCatalog_indexSyncMLDocumentList.xml
..._skins/erp5_syncml/SQLCatalog_indexSyncMLDocumentList.xml
+29
-45
bt5/erp5_syncml/SkinTemplateItem/portal_skins/erp5_syncml/z_get_syncml_path_list.xml
...eItem/portal_skins/erp5_syncml/z_get_syncml_path_list.xml
+1
-1
bt5/erp5_syncml/bt/revision
bt5/erp5_syncml/bt/revision
+1
-1
No files found.
bt5/erp5_syncml/SkinTemplateItem/portal_skins/erp5_syncml/SQLCatalog_indexSyncMLDocumentList.xml
View file @
4057fd51
...
...
@@ -50,56 +50,40 @@
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
from Products.ERP5Type.Utils import UpperCase\n
from ZODB.POSException import ConflictError\n
# XXX à refaire pour optimisation\n
<value>
<string>
restrictedTraverse = context.getPortalObject().restrictedTraverse\n
argument_getter_dict = {}\n
if subscription_path:\n
subscription = restrictedTraverse(subscription_path)\n
getId = subscription.getGidFromObject\n
getData = subscription.getDataFromDocument\n
else:\n
getId = getData = None\n
\n
method = context.z_catalog_syncml_document_list\n
property_list = method.arguments_src.split()\n
\n
parameter_append_list = []\n
append = parameter_append_list.append\n
parameter_dict = {}\n
failed_path_list = []\n
restrictedTraverse = context.getPortalObject().restrictedTraverse\n
subscription = restrictedTraverse(subscription_path)\n
for path in path_list:\n
obj = restrictedTraverse(path, None)\n
try:\n
tmp_dict = {}\n
for property in property_list:\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 == "data":\n
value = subscription.getDataFromDocument(obj)\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
value = getattr(obj, \'get%s\' % UpperCase(property))()\n
tmp_dict[property] = value\n
except ConflictError:\n
raise\n
except Exception, e:\n
raise\n
exception = e\n
failed_path_list.append(path)\n
for property in method.arguments_src.split():\n
parameter_dict[property] = parameter_value_list = []\n
if property == \'getData\':\n
getter = getData\n
elif property == \'getId\':\n
getter = getId\n
else:\n
for property, value in tmp_dict.items():\n
parameter_dict.setdefault(property, []).append(value)\n
getter = None\n
if getter is None:\n
getter = lambda obj, property=property: getattr(obj, property)()\n
append((parameter_value_list, getter))\n
return parameter_dict, parameter_append_list\n
\n
if len(failed_path_list):\n
if len(parameter_dict):\n
# reregister activity for failed objects only\n
activate_kw.update(activity=\'SQLQueue\', priority=5)\n
context.activate(**activate_kw).SQLCatalog_indexSyncMLSignatureList(path_list=failed_path_list)\n
else:\n
# if all objects are failed one, just raise an exception to avoid infinite loop.\n
raise AttributeError, \'exception %r raised in indexing %r\' % (exception, failed_path_list)\n
\n
if parameter_dict:\n
return method(**parameter_dict)\n
parameter_dict, parameter_append_list = generateParameterList()\n
for path in path_list:\n
obj = restrictedTraverse(path)\n
for value_list, getter in parameter_append_list:\n
value_list.append(getter(obj))\n
method(**parameter_dict)\n
</string>
</value>
</item>
<item>
...
...
bt5/erp5_syncml/SkinTemplateItem/portal_skins/erp5_syncml/z_get_syncml_path_list.xml
View file @
4057fd51
...
...
@@ -62,7 +62,7 @@ WHERE\n
AND gid >=
<dtml-sqlvar
min_gid
type=
"string"
>
\n
</dtml-if>
\n
<dtml-if
max_gid
>
\n
AND gid
<
=
<dtml-sqlvar
max_gid
type=
"string"
>
\n
AND gid
<
<dtml-sqlvar
max_gid
type=
"string"
>
\n
</dtml-if>
\n
...
...
bt5/erp5_syncml/bt/revision
View file @
4057fd51
114
\ No newline at end of file
115
\ No newline at end of file
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