Commit 5d770137 authored by Xiaowu Zhang's avatar Xiaowu Zhang Committed by Ayush Tiwari

hal_json_style&listbox: get default parameter if not defined

parent 6af84365
...@@ -1807,6 +1807,9 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None, ...@@ -1807,6 +1807,9 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
if 'jio_key' not in contents_item[select] and url_parameter_dict[select] and 'absolute_url' not in contents_item[select]: if 'jio_key' not in contents_item[select] and url_parameter_dict[select] and 'absolute_url' not in contents_item[select]:
contents_item[select]['jio_key'] = traversed_document.getRelativeUrl() contents_item[select]['jio_key'] = traversed_document.getRelativeUrl()
if 'parameter' not in contents_item[select] and getattr(search_result, 'getListItemParamDict', None) is not None:
contents_item[select]['parameter'] = search_result.getListItemParamDict(select, result_index, catalog_kw['selection_name'])
if generate_view: if generate_view:
if 'parameter' in contents_item[select]: if 'parameter' in contents_item[select]:
contents_item[select]['view'] = url_template_dict["traverse_generator_with_parameter"] % { contents_item[select]['view'] = url_template_dict["traverse_generator_with_parameter"] % {
......
...@@ -2351,6 +2351,8 @@ class ListBoxHTMLRendererLine(ListBoxRendererLine): ...@@ -2351,6 +2351,8 @@ class ListBoxHTMLRendererLine(ListBoxRendererLine):
url = self.getObject().getPortalObject().restrictedTraverse(result_dict['jio_key']).absolute_url() url = self.getObject().getPortalObject().restrictedTraverse(result_dict['jio_key']).absolute_url()
if 'view_action' in result_dict: if 'view_action' in result_dict:
url += result_dict['view_action'] url += result_dict['view_action']
if 'parameter' not in result_dict and getattr(brain, 'getListItemParamDict', None) is not None:
result_dict['parameter'] = brain.getListItemParamDict(alias, self.index, selection_name)
if 'parameter' in result_dict: if 'parameter' in result_dict:
url = '%s?%s' % (url, make_query(result_dict['parameter'])) url = '%s?%s' % (url, make_query(result_dict['parameter']))
......
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