[galaxy-dev] [hg] galaxy 2908: fix dataset link that broke ucsc links

Greg Von Kuster greg at bx.psu.edu
Tue Oct 27 21:54:33 EDT 2009


details:   http://www.bx.psu.edu/hg/galaxy/rev/20b319780138
changeset: 2908:20b319780138
user:      Kanwei Li <kanwei at gmail.com>
date:      Wed Oct 21 23:15:22 2009 -0400
description:
fix dataset link that broke ucsc links

4 file(s) affected in this change:

lib/galaxy/web/buildapp.py
lib/galaxy/web/controllers/dataset.py
templates/dataset/large_file.mako
templates/root/history_common.mako

diffs (68 lines):

diff -r 0dd49ce8eb3e -r 20b319780138 lib/galaxy/web/buildapp.py
--- a/lib/galaxy/web/buildapp.py	Wed Oct 21 16:15:27 2009 -0400
+++ b/lib/galaxy/web/buildapp.py	Wed Oct 21 23:15:22 2009 -0400
@@ -77,7 +77,7 @@
     webapp.add_route( '/async/:tool_id/:data_id/:data_secret', controller='async', action='index', tool_id=None, data_id=None, data_secret=None )
     webapp.add_route( '/:controller/:action', action='index' )
     webapp.add_route( '/:action', controller='root', action='index' )
-    webapp.add_route( '/datasets/:encoded_id/:action/:filename', controller='dataset', action='index', encoded_id=None, filename=None)
+    webapp.add_route( '/datasets/:dataset_id/:action/:filename', controller='dataset', action='index', dataset_id=None, filename=None)
     webapp.add_route( '/u/:username/p/:slug', controller='page', action='display_by_username_and_slug' )
     webapp.finalize_config()
     # Wrap the webapp in some useful middleware
diff -r 0dd49ce8eb3e -r 20b319780138 lib/galaxy/web/controllers/dataset.py
--- a/lib/galaxy/web/controllers/dataset.py	Wed Oct 21 16:15:27 2009 -0400
+++ b/lib/galaxy/web/controllers/dataset.py	Wed Oct 21 23:15:22 2009 -0400
@@ -199,14 +199,14 @@
         return 'This link may not be followed from within Galaxy.'
     
     @web.expose
-    def display(self, trans, encoded_id=None, preview=False, filename=None, to_ext=None, **kwd):
+    def display(self, trans, dataset_id=None, preview=False, filename=None, to_ext=None, **kwd):
         """Catches the dataset id and displays file contents as directed"""
         
         # DEPRECATION: We still support unencoded ids for backward compatibility
         try:
-            dataset_id = int( encoded_id )
+            dataset_id = int( dataset_id )
         except ValueError:
-            dataset_id = trans.security.decode_id( encoded_id )
+            dataset_id = trans.security.decode_id( dataset_id )
         data = trans.app.model.HistoryDatasetAssociation.get( dataset_id )
         if not data:
             raise paste.httpexceptions.HTTPRequestRangeNotSatisfiable( "Invalid reference dataset id: %s." % str( dataset_id ) )
diff -r 0dd49ce8eb3e -r 20b319780138 templates/dataset/large_file.mako
--- a/templates/dataset/large_file.mako	Wed Oct 21 16:15:27 2009 -0400
+++ b/templates/dataset/large_file.mako	Wed Oct 21 23:15:22 2009 -0400
@@ -2,8 +2,8 @@
 
 <div class="warningmessagelarge">
     This dataset is large and only the first megabyte is shown below.<br />
-    <a href="${h.url_for( controller='dataset', action='display', encoded_id=trans.security.encode_id( data.id ), filename='' )}">Show all</a> |
-    <a href="${h.url_for( controller='dataset', action='display', encoded_id=trans.security.encode_id( data.id ), to_ext=data.ext )}">Save</a>
+    <a href="${h.url_for( controller='dataset', action='display', dataset_id=trans.security.encode_id( data.id ), filename='' )}">Show all</a> |
+    <a href="${h.url_for( controller='dataset', action='display', dataset_id=trans.security.encode_id( data.id ), to_ext=data.ext )}">Save</a>
 </div>
 
 <pre>
diff -r 0dd49ce8eb3e -r 20b319780138 templates/root/history_common.mako
--- a/templates/root/history_common.mako	Wed Oct 21 16:15:27 2009 -0400
+++ b/templates/root/history_common.mako	Wed Oct 21 23:15:22 2009 -0400
@@ -33,7 +33,7 @@
     	            <img src="${h.url_for('/static/images/pencil_icon_grey.png')}" width='16' height='16' alt='edit attributes' title='edit attributes' class='button edit' border='0'>
     	        %endif
             %else:
-    	        <a class="icon-button display" title="display data" href="${h.url_for( controller='dataset', action='display', encoded_id=trans.security.encode_id( data.id ), preview=True, filename='' )}" target="galaxy_main"></a>
+    	        <a class="icon-button display" title="display data" href="${h.url_for( controller='dataset', action='display', dataset_id=trans.security.encode_id( data.id ), preview=True, filename='' )}" target="galaxy_main"></a>
                 %if user_owns_dataset:
     	            <a class="icon-button edit" title="edit attributes" href="${h.url_for( controller='root', action='edit', id=data.id )}" target="galaxy_main"></a>
     	        %endif
@@ -87,7 +87,7 @@
                 <div class="info">${_('Info: ')}${data.display_info()}</div>
                 <div> 
                     %if data.has_data:
-                        <a href="${h.url_for( controller='dataset', action='display', encoded_id=trans.security.encode_id( data.id ), to_ext=data.ext )}">save</a>
+                        <a href="${h.url_for( controller='dataset', action='display', dataset_id=trans.security.encode_id( data.id ), to_ext=data.ext )}">save</a>
 			            %if user_owns_dataset:
 			                | <a href="${h.url_for( controller='tool_runner', action='rerun', id=data.id )}" target="galaxy_main">rerun</a>
 			            %endif



More information about the galaxy-dev mailing list