Commit 886a75e2 authored by Romain Courteaud's avatar Romain Courteaud

Report non compatible listbox configurations.

The only supported list_method (ie, compatible with Jio) are: portal_catalog, searchFolder, objectValues
parent b6562d90
......@@ -145,10 +145,8 @@ def renderField(field, meta_type=None):\n
pass\n
elif (list_method_name in ("searchFolder", "objectValues")):\n
list_method_query_dict["parent_uid"] = traversed_document.getUid()\n
# XXX How to handle script queries?\n
# else:\n
# raise NotImplementedError("Unsupported list method %s" % list_method_name)\n
\n
else:\n
list_method_query_dict = None\n
\n
\n
# row_list = list_method(limit=lines, portal_type=portal_types,\n
......@@ -181,13 +179,14 @@ def renderField(field, meta_type=None):\n
"portal_type": portal_types,\n
"lines": lines,\n
"default_params": default_params,\n
"list_method": list_method_name,\n
"query": url_template_dict["jio_search_template"] % {\n
"list_method": list_method_name\n
}\n
if (list_method_query_dict is not None):\n
result["query"] = url_template_dict["jio_search_template"] % {\n
"query": make_query({"query": sql_catalog.buildQuery(\n
list_method_query_dict\n
).asSearchTextExpression(sql_catalog)})\n
}\n
}\n
else:\n
# XXX Not implemented\n
result = {\n
......
......@@ -161,6 +161,7 @@
field_json = props.field_json,\n
begin_from = props.begin_from,\n
table = props.element.querySelector(\'table\'),\n
original_tfoot = props.element.querySelector(\'tfoot\'),\n
tbody = document.createElement("tbody"),\n
url_query = props.extended_search,\n
query_string = "",\n
......@@ -170,6 +171,10 @@
counter,\n
i;\n
\n
if (field_json.query === undefined) {\n
original_tfoot.textContent = "Unsupported list method: \'" + field_json.list_method + "\'";\n
return;\n
}\n
// function buildQueryString(previous, next) {\n
// return previous + next[0] + \':= "\' + url_query + \'" OR \';\n
// }\n
......@@ -437,7 +442,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>937.51222.46996.32273</string> </value>
<value> <string>937.64366.64920.32563</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -455,7 +460,7 @@
</tuple>
<state>
<tuple>
<float>1411984629.48</float>
<float>1412261538.63</float>
<string>GMT</string>
</tuple>
</state>
......
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