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

@web.expose
@web.require_admin
def view_workflow(self, trans, workflow_name=None, repository_id=None, **kwd):

    message = escape(kwd.get('message', ''))
    status = kwd.get('status', 'done')
    if workflow_name:
        workflow_name = encoding_util.tool_shed_decode(workflow_name)
    repository = repository_util.get_tool_shed_repository_by_id(trans.app, repository_id)
    changeset_revision = repository.changeset_revision
    metadata = repository.metadata
    return trans.fill_template('/admin/tool_shed_repository/view_workflow.mako', repository=repository, changeset_revision=changeset_revision, repository_id=repository_id, workflow_name=workflow_name, metadata=metadata, message=message, status=status)
