From 4fee46f0ef20efc549aac109cb564aff616e0b54 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Tue, 26 Feb 2013 09:56:15 -0600 Subject: [PATCH] Update HDA API return value to reflect new API-based path for downloads. --- lib/galaxy/webapps/galaxy/api/history_contents.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/api/history_contents.py b/lib/galaxy/webapps/galaxy/api/history_contents.py index 32a60436922..6bc74f1f6c3 100644 --- a/lib/galaxy/webapps/galaxy/api/history_contents.py +++ b/lib/galaxy/webapps/galaxy/api/history_contents.py @@ -155,7 +155,7 @@ class HistoryContentsController( BaseAPIController, UsesHistoryDatasetAssociatio @web.expose_api def show( self, trans, id, history_id, **kwd ): """ - GET /api/histories/{encoded_history_id}/contents/{encoded_content_id} + GET /api/histories/{encoded_history_id}/contents/{encoded_content_id}/display Displays information about a history content (dataset). """ hda_dict = {} @@ -230,14 +230,7 @@ def get_hda_dict( trans, history, hda, for_editing ): hda_dict[ 'file_name' ] = hda.file_name if not hda_dict[ 'deleted' ]: - # Problem: Method url_for cannot use the dataset controller - # Get the environment from DefaultWebTransaction - # and use default webapp mapper instead of webapp API mapper - web_url_for = routes.URLGenerator( trans.webapp.mapper, trans.environ ) - # http://routes.groovie.org/generating.html - # url_for is being phased out, so new applications should use url - hda_dict[ 'download_url' ] = web_url_for( controller='dataset', action='display', - dataset_id=trans.security.encode_id( hda.id ), to_ext=hda.ext ) + hda_dict[ 'download_url' ] = url_for( 'history_contents_display', history_id = trans.security.encode_id( history.id ), history_content_id = trans.security.encode_id( hda.id ) ) can_access_hda = trans.app.security_agent.can_access_dataset( trans.get_current_user_roles(), hda.dataset ) hda_dict[ 'accessible' ] = ( trans.user_is_admin() or can_access_hda )