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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Vivek
erp5
Commits
db017786
Commit
db017786
authored
Jun 12, 2014
by
Aurel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make indexation of document into syncml works even for data coming from integration modules
parent
54da4f63
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
19 deletions
+29
-19
bt5/erp5_syncml/SkinTemplateItem/portal_skins/erp5_syncml/SQLCatalog_indexSyncMLDocumentList.xml
..._skins/erp5_syncml/SQLCatalog_indexSyncMLDocumentList.xml
+28
-18
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 @
db017786
...
...
@@ -53,7 +53,6 @@
<value>
<string>
if not len(path_list):\n
return\n
restrictedTraverse = context.getPortalObject().restrictedTraverse\n
argument_getter_dict = {}\n
if subscription_path:\n
subscription = restrictedTraverse(subscription_path)\n
getId = subscription.getGidFromObject\n
...
...
@@ -63,26 +62,37 @@ else:\n
\n
method = context.z_catalog_syncml_document_list\n
\n
parameter_append_list = []\n
append = parameter_append_list.append\n
parameter_dict = {}\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
getter = None\n
if getter is None:\n
getter = lambda obj, property=property: getattr(obj, property)()\n
append((parameter_value_list, getter))\n
def generateParameterList():\n
parameter_append_list = []\n
append = parameter_append_list.append\n
parameter_dict = {}\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
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
MAX_PER_QUERY = 1000\n
\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
if obj.getPortalType() == "Integration Module":\n
object_list = obj()\n
else:\n
object_list = [obj,]\n
for x in xrange(0, len(object_list), MAX_PER_QUERY):\n
parameter_dict, parameter_append_list = generateParameterList()\n
for obj in object_list[x:x+MAX_PER_QUERY]:\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/bt/revision
View file @
db017786
121
\ No newline at end of file
122
\ 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