'Retrieve necessary information about a workflow from the database so that it can be displayed in an svg image.'

@web.expose
def view_workflow(self, trans, workflow_name, repository_metadata_id, **kwd):

    message = escape(kwd.get('message', ''))
    status = kwd.get('status', 'done')
    render_repository_actions_for = kwd.get('render_repository_actions_for', 'tool_shed')
    if workflow_name:
        workflow_name = encoding_util.tool_shed_decode(workflow_name)
    repository_metadata = metadata_util.get_repository_metadata_by_id(trans.app, repository_metadata_id)
    repository = repository_util.get_repository_in_tool_shed(trans.app, trans.security.encode_id(repository_metadata.repository_id))
    changeset_revision = repository_metadata.changeset_revision
    metadata = repository_metadata.metadata
    return trans.fill_template('/webapps/tool_shed/repository/view_workflow.mako', repository=repository, render_repository_actions_for=render_repository_actions_for, changeset_revision=changeset_revision, repository_metadata_id=repository_metadata_id, workflow_name=workflow_name, metadata=metadata, message=message, status=status)
