'Show the parameters used for the job associated with an HDA'

@web.expose
def show_params(self, trans, dataset_id=None, from_noframe=None, **kwd):

    try:
        hda = trans.sa_session.query(trans.app.model.HistoryDatasetAssociation).get(self.decode_id(dataset_id))
    except ValueError:
        hda = None
    if (not hda):
        raise paste.httpexceptions.HTTPRequestRangeNotSatisfiable(('Invalid    reference    dataset    id:    %s.' % escape(str(dataset_id))))
    if (not self._can_access_dataset(trans, hda)):
        return trans.show_error_message('You    are    not    allowed    to    access    this    dataset')
    params_objects = None
    job = None
    tool = None
    upgrade_messages = {}
    has_parameter_errors = False
    inherit_chain = hda.source_dataset_chain
    if inherit_chain:
        job_dataset_association = inherit_chain[(-1)][0]
    else:
        job_dataset_association = hda
    if job_dataset_association.creating_job_associations:
        job = job_dataset_association.creating_job_associations[0].job
        if job:
            try:
                toolbox = self.get_toolbox()
                tool = toolbox.get_tool(job.tool_id, job.tool_version)
                assert (tool is not None), 'Requested    tool    has    not    been    loaded.'
                try:
                    params_objects = job.get_param_values(trans.app, ignore_errors=False)
                except:
                    params_objects = job.get_param_values(trans.app, ignore_errors=True)
                    upgrade_messages = tool.check_and_update_param_values(job.get_param_values(trans.app, ignore_errors=True), trans, update_values=False)
                    has_parameter_errors = True
            except:
                pass
    if (job is None):
        return trans.show_error_message('Job    information    is    not    available    for    this    dataset.')
    return trans.fill_template('show_params.mako', inherit_chain=inherit_chain, history=trans.get_history(), hda=hda, job=job, tool=tool, params_objects=params_objects, upgrade_messages=upgrade_messages, has_parameter_errors=has_parameter_errors)
