2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/c12c81db523f/ changeset: c12c81db523f user: jgoecks date: 2012-10-20 19:16:22 summary: Make Trackster use generic visualization save functionality. affected #: 5 files diff -r e26fec7ee17feb082efe7c9f815c5821f07e0f32 -r c12c81db523f4d7b959cfe550c0cb4f5bf6c7765 lib/galaxy/webapps/galaxy/controllers/visualization.py --- a/lib/galaxy/webapps/galaxy/controllers/visualization.py +++ b/lib/galaxy/webapps/galaxy/controllers/visualization.py @@ -719,27 +719,6 @@ ''' return trans.fill_template( 'tracks/browser.mako', config=viz_config, add_dataset=new_dataset ) - @web.json - def save_trackster( self, trans, vis_json ): - """ - Save a visualization; if visualization does not have an ID, a new - visualization is created. Returns JSON of visualization. - """ - - # TODO: Need from_dict to convert json to Visualization object. - vis_config = from_json_string( vis_json ) - config = { - 'view': vis_config[ 'datasets' ], - 'bookmarks': vis_config[ 'bookmarks' ], - 'viewport': vis_config[ 'viewport' ] - } - type = vis_config[ 'type' ] - id = vis_config.get( 'id', None ) - title = vis_config[ 'title' ] - dbkey = vis_config[ 'dbkey' ] - annotation = vis_config.get( 'annotation', None ) - return self.save_visualization( trans, config, type, id, title, dbkey, annotation ) - @web.expose def circster( self, trans, id=None, hda_ldda=None, dataset_id=None, dbkey=None ): """ diff -r e26fec7ee17feb082efe7c9f815c5821f07e0f32 -r c12c81db523f4d7b959cfe550c0cb4f5bf6c7765 static/scripts/mvc/data.js --- a/static/scripts/mvc/data.js +++ b/static/scripts/mvc/data.js @@ -1,4 +1,5 @@ define(["libs/backbone/backbone-relational"], function() { + /** * A dataset. In Galaxy, datasets are associated with a history, so * this object is also known as a HistoryDatasetAssociation. diff -r e26fec7ee17feb082efe7c9f815c5821f07e0f32 -r c12c81db523f4d7b959cfe550c0cb4f5bf6c7765 static/scripts/viz/trackster_ui.js --- a/static/scripts/viz/trackster_ui.js +++ b/static/scripts/viz/trackster_ui.js @@ -56,11 +56,7 @@ // FIXME: give unique IDs to Drawables and save overview as ID. var overview_track_name = (view.overview_drawable ? view.overview_drawable.name : null), viz_config = { - 'id': view.vis_id, - 'title': view.name, - 'dbkey': view.dbkey, - 'type': 'trackster', - 'datasets': view.to_dict(), + 'view': view.to_dict(), 'viewport': { 'chrom': view.chrom, 'start': view.low , 'end': view.high, 'overview': overview_track_name }, 'bookmarks': bookmarks }; @@ -70,6 +66,10 @@ type: "POST", dataType: "json", data: { + 'id': view.vis_id, + 'title': view.name, + 'dbkey': view.dbkey, + 'type': 'trackster', vis_json: JSON.stringify(viz_config) } }).success(function(vis_info) { diff -r e26fec7ee17feb082efe7c9f815c5821f07e0f32 -r c12c81db523f4d7b959cfe550c0cb4f5bf6c7765 static/scripts/viz/visualization.js --- a/static/scripts/viz/visualization.js +++ b/static/scripts/viz/visualization.js @@ -764,12 +764,8 @@ type: '' }, - // Use function because visualization_url changes depending on viz. - // FIXME: all visualizations should save to the same URL (and hence - // this function won't be needed). - url: function() { - return galaxy_paths.get("visualization_url"); - }, + // No API to create/save visualization yet, so use this path: + url: galaxy_paths.get("visualization_url"), /** * POSTs visualization's JSON to its URL using the parameter 'vis_json' diff -r e26fec7ee17feb082efe7c9f815c5821f07e0f32 -r c12c81db523f4d7b959cfe550c0cb4f5bf6c7765 templates/tracks/browser.mako --- a/templates/tracks/browser.mako +++ b/templates/tracks/browser.mako @@ -39,13 +39,6 @@ require( ["base", "viz/visualization", "viz/trackster_ui", "viz/trackster/tracks"], function( base, visualization, trackster_ui, tracks ) { - // - // Place URLs here so that url_for can be used to generate them. - // - galaxy_paths.set({ - visualization_url: "${h.url_for( action='save_trackster' )}" - }); - ${render_trackster_js_vars()} // FIXME: deliberate global required for now due to requireJS integration. https://bitbucket.org/galaxy/galaxy-central/changeset/afc8e9345268/ changeset: afc8e9345268 user: jgoecks date: 2012-10-20 20:40:42 summary: Better data handling when downloading history export files. affected #: 1 file diff -r c12c81db523f4d7b959cfe550c0cb4f5bf6c7765 -r afc8e93452687063301398854dbcf0d450c8558c lib/galaxy/webapps/galaxy/controllers/history.py --- a/lib/galaxy/webapps/galaxy/controllers/history.py +++ b/lib/galaxy/webapps/galaxy/controllers/history.py @@ -664,7 +664,7 @@ else: trans.response.set_content_type( 'application/x-tar' ) trans.response.headers["Content-Disposition"] = 'attachment; filename="%s"' % ( hname ) - return trans.app.object_store.get_data(jeha.dataset) + return open( trans.app.object_store.get_filename( jeha.dataset ) ) elif jeha.job.state in [ model.Job.states.RUNNING, model.Job.states.QUEUED, model.Job.states.WAITING ]: return trans.show_message( "Still exporting history %(n)s; please check back soon. Link: <a href='%(s)s'>%(s)s</a>" \ % ( { 'n' : history.name, 's' : url_for( action="export_archive", id=id, qualified=True ) } ) ) Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.