'Retrieve the URL to call out to an external site and retrieve data.
This routes our external URL through a local galaxy instance which makes
the data available, followed by redirecting to the remote site with a
link back to the available information.'

def _get_remote_call_url(self, redirect_url, site_name, dataset, type, app, base_url):

    internal_url = ('%s' % url_for(controller='dataset', dataset_id=dataset.id, action='display_at', filename=('%s_%s' % (type, site_name))))
    base_url = app.config.get('display_at_callback', base_url)
    display_url = quote_plus(('%s%s/display_as?id=%i&display_app=%s&authz_method=display_at' % (base_url, url_for(controller='root'), dataset.id, type)))
    link = ('%s?redirect_url=%s&display_url=%s' % (internal_url, redirect_url, display_url))
    return link
