galaxy-commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
November 2014
- 2 participants
- 184 discussions
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a46a7f1c3016/
Changeset: a46a7f1c3016
User: jmchilton
Date: 2014-11-13 14:19:51+00:00
Summary: Allow resolution of relative paths in tool data configuration and loc files.
The string ${__HERE__} will be expanded out to the directory the file (XML configuration or loc) currently resides in.
Along with some changes to planemo to detect test data files (https://github.com/galaxyproject/planemo/commit/a40130417dc1be2da785cd5dff6…) - the following picard tweak demonstrates how tool developers could use this to build test cases for cached/index data (https://github.com/jmchilton/picard/commit/4df8974384081ee1bb0f97e1bb8d7f93…)
Affected #: 1 file
diff -r f26c2543ff053b9ff31617bc03f99d505302ecda -r a46a7f1c3016e3f43a9acabdfb18361679ff723d lib/galaxy/tools/data/__init__.py
--- a/lib/galaxy/tools/data/__init__.py
+++ b/lib/galaxy/tools/data/__init__.py
@@ -10,6 +10,7 @@
import os
import os.path
import shutil
+import string
import tempfile
from galaxy import util
@@ -71,7 +72,7 @@
tree = util.parse_xml( filename )
root = tree.getroot()
for table_elem in root.findall( 'table' ):
- table = ToolDataTable.from_elem( table_elem, tool_data_path, from_shed_config )
+ table = ToolDataTable.from_elem( table_elem, tool_data_path, from_shed_config, filename=filename )
table_elems.append( table_elem )
if table.name not in self.data_tables:
self.data_tables[ table.name ] = table
@@ -167,16 +168,17 @@
class ToolDataTable( object ):
@classmethod
- def from_elem( cls, table_elem, tool_data_path, from_shed_config ):
+ def from_elem( cls, table_elem, tool_data_path, from_shed_config, filename ):
table_type = table_elem.get( 'type', 'tabular' )
assert table_type in tool_data_table_types, "Unknown data table type '%s'" % type
- return tool_data_table_types[ table_type ]( table_elem, tool_data_path, from_shed_config=from_shed_config )
+ return tool_data_table_types[ table_type ]( table_elem, tool_data_path, from_shed_config=from_shed_config, filename=filename )
- def __init__( self, config_element, tool_data_path, from_shed_config = False):
+ def __init__( self, config_element, tool_data_path, from_shed_config = False, filename=None ):
self.name = config_element.get( 'name' )
self.comment_char = config_element.get( 'comment_char' )
self.empty_field_value = config_element.get( 'empty_field_value', '' )
self.empty_field_values = {}
+ self.here = filename and os.path.dirname(filename)
self.filenames = odict()
self.tool_data_path = tool_data_path
self.missing_index_file = None
@@ -241,8 +243,8 @@
type_key = 'tabular'
- def __init__( self, config_element, tool_data_path, from_shed_config = False):
- super( TabularToolDataTable, self ).__init__( config_element, tool_data_path, from_shed_config)
+ def __init__( self, config_element, tool_data_path, from_shed_config = False, filename=None ):
+ super( TabularToolDataTable, self ).__init__( config_element, tool_data_path, from_shed_config, filename)
self.config_element = config_element
self.data = []
self.configure_and_load( config_element, tool_data_path, from_shed_config)
@@ -265,7 +267,7 @@
repo_info = None
# Read every file
for file_element in config_element.findall( 'file' ):
- filename = file_path = file_element.get( 'path', None )
+ filename = file_path = expand_here_template( file_element.get( 'path', None ), here=self.here )
found = False
if file_path is None:
log.debug( "Encountered a file element (%s) that does not contain a path value when loading tool data table '%s'.", util.xml_to_string( file_element ), self.name )
@@ -300,7 +302,7 @@
errors = []
if found:
- self.data.extend( self.parse_file_fields( open( filename ), errors=errors ) )
+ self.extend_data_with( filename, errors=errors )
self._update_version()
else:
self.missing_index_file = filename
@@ -326,7 +328,7 @@
def handle_found_index_file( self, filename ):
self.missing_index_file = None
- self.data.extend( self.parse_file_fields( open( filename ) ) )
+ self.extend_data_with( filename )
def get_fields( self ):
return self.data
@@ -380,7 +382,11 @@
if 'name' not in self.columns:
self.columns['name'] = self.columns['value']
- def parse_file_fields( self, reader, errors=None ):
+ def extend_data_with( self, filename, errors=None ):
+ here = os.path.dirname(os.path.abspath(filename))
+ self.data.extend( self.parse_file_fields( open( filename ), errors=errors, here=here ) )
+
+ def parse_file_fields( self, reader, errors=None, here="__HERE__" ):
"""
Parse separated lines from file and return a list of tuples.
@@ -394,6 +400,7 @@
continue
line = line.rstrip( "\n\r" )
if line:
+ line = expand_here_template( line, here=here )
fields = line.split( self.separator )
if self.largest_index < len( fields ):
rval.append( fields )
@@ -529,5 +536,12 @@
rval['fields'] = self.get_fields()
return rval
+
+def expand_here_template(content, here=None):
+ if here and content:
+ content = string.Template(content).safe_substitute( { "__HERE__": here })
+ return content
+
+
# Registry of tool data types by type_key
tool_data_table_types = dict( [ ( cls.type_key, cls ) for cls in [ TabularToolDataTable ] ] )
https://bitbucket.org/galaxy/galaxy-central/commits/782815ce0a91/
Changeset: 782815ce0a91
User: jmchilton
Date: 2014-11-18 15:40:21+00:00
Summary: Merged in jmchilton/galaxy-central-fork-1 (pull request #559)
Configuration enhancements aim at enabling tool testing of cached data.
Affected #: 1 file
diff -r e47c67efeda7fa66f9782aae5e2c62ab640310bc -r 782815ce0a91fb69e82ba73cf811e3487b649d56 lib/galaxy/tools/data/__init__.py
--- a/lib/galaxy/tools/data/__init__.py
+++ b/lib/galaxy/tools/data/__init__.py
@@ -10,6 +10,7 @@
import os
import os.path
import shutil
+import string
import tempfile
from galaxy import util
@@ -71,7 +72,7 @@
tree = util.parse_xml( filename )
root = tree.getroot()
for table_elem in root.findall( 'table' ):
- table = ToolDataTable.from_elem( table_elem, tool_data_path, from_shed_config )
+ table = ToolDataTable.from_elem( table_elem, tool_data_path, from_shed_config, filename=filename )
table_elems.append( table_elem )
if table.name not in self.data_tables:
self.data_tables[ table.name ] = table
@@ -167,16 +168,17 @@
class ToolDataTable( object ):
@classmethod
- def from_elem( cls, table_elem, tool_data_path, from_shed_config ):
+ def from_elem( cls, table_elem, tool_data_path, from_shed_config, filename ):
table_type = table_elem.get( 'type', 'tabular' )
assert table_type in tool_data_table_types, "Unknown data table type '%s'" % type
- return tool_data_table_types[ table_type ]( table_elem, tool_data_path, from_shed_config=from_shed_config )
+ return tool_data_table_types[ table_type ]( table_elem, tool_data_path, from_shed_config=from_shed_config, filename=filename )
- def __init__( self, config_element, tool_data_path, from_shed_config = False):
+ def __init__( self, config_element, tool_data_path, from_shed_config = False, filename=None ):
self.name = config_element.get( 'name' )
self.comment_char = config_element.get( 'comment_char' )
self.empty_field_value = config_element.get( 'empty_field_value', '' )
self.empty_field_values = {}
+ self.here = filename and os.path.dirname(filename)
self.filenames = odict()
self.tool_data_path = tool_data_path
self.missing_index_file = None
@@ -241,8 +243,8 @@
type_key = 'tabular'
- def __init__( self, config_element, tool_data_path, from_shed_config = False):
- super( TabularToolDataTable, self ).__init__( config_element, tool_data_path, from_shed_config)
+ def __init__( self, config_element, tool_data_path, from_shed_config = False, filename=None ):
+ super( TabularToolDataTable, self ).__init__( config_element, tool_data_path, from_shed_config, filename)
self.config_element = config_element
self.data = []
self.configure_and_load( config_element, tool_data_path, from_shed_config)
@@ -265,7 +267,7 @@
repo_info = None
# Read every file
for file_element in config_element.findall( 'file' ):
- filename = file_path = file_element.get( 'path', None )
+ filename = file_path = expand_here_template( file_element.get( 'path', None ), here=self.here )
found = False
if file_path is None:
log.debug( "Encountered a file element (%s) that does not contain a path value when loading tool data table '%s'.", util.xml_to_string( file_element ), self.name )
@@ -300,7 +302,7 @@
errors = []
if found:
- self.data.extend( self.parse_file_fields( open( filename ), errors=errors ) )
+ self.extend_data_with( filename, errors=errors )
self._update_version()
else:
self.missing_index_file = filename
@@ -326,7 +328,7 @@
def handle_found_index_file( self, filename ):
self.missing_index_file = None
- self.data.extend( self.parse_file_fields( open( filename ) ) )
+ self.extend_data_with( filename )
def get_fields( self ):
return self.data
@@ -380,7 +382,11 @@
if 'name' not in self.columns:
self.columns['name'] = self.columns['value']
- def parse_file_fields( self, reader, errors=None ):
+ def extend_data_with( self, filename, errors=None ):
+ here = os.path.dirname(os.path.abspath(filename))
+ self.data.extend( self.parse_file_fields( open( filename ), errors=errors, here=here ) )
+
+ def parse_file_fields( self, reader, errors=None, here="__HERE__" ):
"""
Parse separated lines from file and return a list of tuples.
@@ -394,6 +400,7 @@
continue
line = line.rstrip( "\n\r" )
if line:
+ line = expand_here_template( line, here=here )
fields = line.split( self.separator )
if self.largest_index < len( fields ):
rval.append( fields )
@@ -529,5 +536,12 @@
rval['fields'] = self.get_fields()
return rval
+
+def expand_here_template(content, here=None):
+ if here and content:
+ content = string.Template(content).safe_substitute( { "__HERE__": here })
+ return content
+
+
# Registry of tool data types by type_key
tool_data_table_types = dict( [ ( cls.type_key, cls ) for cls in [ TabularToolDataTable ] ] )
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.
1
0
[galaxyproject/usegalaxy-playbook] f84acb: Shed-installed tool updates on Test.
by GitHub 18 Nov '14
by GitHub 18 Nov '14
18 Nov '14
Branch: refs/heads/master
Home: https://github.com/galaxyproject/usegalaxy-playbook
Commit: f84acb08aa6adddaa46c7959d3318c392cc904f6
https://github.com/galaxyproject/usegalaxy-playbook/commit/f84acb08aa6addda…
Author: Nate Coraor <nate(a)bx.psu.edu>
Date: 2014-11-18 (Tue, 18 Nov 2014)
Changed paths:
M files/galaxy/test.galaxyproject.org/var/integrated_tool_panel.xml
M files/galaxy/test.galaxyproject.org/var/migrated_tools_conf.xml
M files/galaxy/test.galaxyproject.org/var/shed_tool_conf.xml
Log Message:
-----------
Shed-installed tool updates on Test.
Commit: a020d7c80fa9fa58b1649c6bb261ceb29bf5f3d7
https://github.com/galaxyproject/usegalaxy-playbook/commit/a020d7c80fa9fa58…
Author: Nate Coraor <nate(a)bx.psu.edu>
Date: 2014-11-18 (Tue, 18 Nov 2014)
Changed paths:
M production/secret_vars/galaxyservers.yml
M stage/secret_vars/galaxyservers.yml
Log Message:
-----------
Update admins.
Commit: 701ff04a1ad449e7f6a2cdac9c642c4d8f430c7b
https://github.com/galaxyproject/usegalaxy-playbook/commit/701ff04a1ad449e7…
Author: Nate Coraor <nate(a)bx.psu.edu>
Date: 2014-11-18 (Tue, 18 Nov 2014)
Changed paths:
M production/group_vars/all.yml
M stage/group_vars/all.yml
Log Message:
-----------
Update Test and Main.
Compare: https://github.com/galaxyproject/usegalaxy-playbook/compare/665492ca6865...…
1
0
commit/galaxy-central: natefoo: Open next-stable for release_2014.12.01
by commits-noreply@bitbucket.org 18 Nov '14
by commits-noreply@bitbucket.org 18 Nov '14
18 Nov '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/c1b54085c3ae/
Changeset: c1b54085c3ae
Branch: next-stable
User: natefoo
Date: 2014-11-18 15:19:00+00:00
Summary: Open next-stable for release_2014.12.01
Affected #: 388 files
diff -r 769e8dca49f033059d140b614c84381f13394611 -r c1b54085c3aeb9a7cf97c7277436ab3f7b50d299 .hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -67,6 +67,7 @@
shed_data_manager_conf.xml
object_store_conf.xml
job_metrics_conf.xml
+workflow_schedulers_conf.xml
config/*
static/welcome.html.*
static/welcome.html
diff -r 769e8dca49f033059d140b614c84381f13394611 -r c1b54085c3aeb9a7cf97c7277436ab3f7b50d299 .hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -19,3 +19,5 @@
2a756ca2cb1826db7796018e77d12e2dd7b67603 latest_2014.02.10
ca45b78adb4152fc6e7395514d46eba6b7d0b838 release_2014.08.11
548ab24667d6206780237bd807f7d857a484c461 latest_2014.08.11
+2092948937ac30ef82f71463a235c66d34987088 release_2014.10.06
+011c8b2118be778eaf1ba952730ff876d6447ba9 latest_2014.10.06
diff -r 769e8dca49f033059d140b614c84381f13394611 -r c1b54085c3aeb9a7cf97c7277436ab3f7b50d299 buildbot_setup.sh
--- a/buildbot_setup.sh
+++ b/buildbot_setup.sh
@@ -126,5 +126,3 @@
echo "Appending tool-data/shared/ucsc/builds.txt.buildbot to tool-data/shared/ucsc/builds.txt"
cat tool-data/shared/ucsc/builds.txt.buildbot >> tool-data/shared/ucsc/builds.txt
-
-python ./scripts/fetch_eggs.py all
diff -r 769e8dca49f033059d140b614c84381f13394611 -r c1b54085c3aeb9a7cf97c7277436ab3f7b50d299 client/galaxy/scripts/galaxy.frame.js
--- a/client/galaxy/scripts/galaxy.frame.js
+++ b/client/galaxy/scripts/galaxy.frame.js
@@ -1,9 +1,8 @@
// dependencies
define(["galaxy.masthead", "mvc/ui/ui-frames"], function(mod_masthead, Frames) {
-// frame manager
-var GalaxyFrame = Backbone.View.extend(
-{
+/** Frame manager uses the ui-frames to create the scratch book masthead icon and functionality **/
+var GalaxyFrame = Backbone.View.extend({
// base element
el_main: 'body',
@@ -17,8 +16,7 @@
button_load : null,
// initialize
- initialize : function(options)
- {
+ initialize : function(options) {
// add to masthead menu
var self = this;
@@ -28,8 +26,7 @@
});
// add activate icon
- this.button_active = new mod_masthead.GalaxyMastheadIcon (
- {
+ this.button_active = new mod_masthead.GalaxyMastheadIcon({
icon : 'fa-th',
tooltip : 'Enable/Disable Scratchbook',
onclick : function() { self._activate(); },
@@ -44,8 +41,7 @@
Galaxy.masthead.append(this.button_active);
// add load icon
- this.button_load = new mod_masthead.GalaxyMastheadIcon (
- {
+ this.button_load = new mod_masthead.GalaxyMastheadIcon({
icon : 'fa-eye',
tooltip : 'Show/Hide Scratchbook',
onclick : function(e) {
@@ -122,35 +118,77 @@
});
},
+
+ /**
+ * Add a trackster visualization to the frames.
+ */
+ add_trackster_viz: function(viz_id) {
+ var self = this;
+ require(['viz/visualization', 'viz/trackster'], function(visualization, trackster) {
+ var viz = new visualization.Visualization({id: viz_id});
+ $.when( viz.fetch() ).then( function() {
+ var ui = new trackster.TracksterUI(galaxy_config.root);
+
+ // Construct frame config based on dataset's type.
+ var frame_config = {
+ title: viz.get('name'),
+ type: 'other',
+ content: function(parent_elt) {
+ // Create view config.
+ var view_config = {
+ container: parent_elt,
+ name: viz.get('title'),
+ id: viz.id,
+ // FIXME: this will not work with custom builds b/c the dbkey needed to be encoded.
+ dbkey: viz.get('dbkey'),
+ stand_alone: false
+ },
+ latest_revision = viz.get('latest_revision'),
+ drawables = latest_revision.config.view.drawables;
+
+ // Set up datasets in drawables.
+ _.each(drawables, function(d) {
+ d.dataset = {
+ hda_ldda: d.hda_ldda,
+ id: d.dataset_id
+ };
+ });
+
+ view = ui.create_visualization(view_config,
+ latest_revision.config.viewport,
+ latest_revision.config.view.drawables,
+ latest_revision.config.bookmarks,
+ false);
+ }
+ };
+
+ self.add(frame_config);
+ });
+ });
+ },
/**
* Add and display a new frame/window based on options.
*/
- add: function(options)
- {
+ add: function(options){
// open new tab
- if (options.target == '_blank')
- {
+ if (options.target == '_blank'){
window.open(options.content);
return;
}
// reload entire window
- if (options.target == '_top' || options.target == '_parent' || options.target == '_self')
- {
+ if (options.target == '_top' || options.target == '_parent' || options.target == '_self'){
window.location = options.content;
return;
}
// validate
- if (!this.active)
- {
+ if (!this.active){
// fix url if main frame is unavailable
var $galaxy_main = $(window.parent.document).find('#galaxy_main');
- if (options.target == 'galaxy_main' || options.target == 'center')
- {
- if ($galaxy_main.length === 0)
- {
+ if (options.target == 'galaxy_main' || options.target == 'center'){
+ if ($galaxy_main.length === 0){
var href = options.content;
if (href.indexOf('?') == -1)
href += '?';
@@ -173,11 +211,9 @@
},
// activate/disable panel
- _activate: function ()
- {
+ _activate: function (){
// check
- if (this.active)
- {
+ if (this.active){
// disable
this.active = false;
@@ -196,8 +232,7 @@
},
// update frame counter
- _refresh: function()
- {
+ _refresh: function(){
// update on screen counter
this.button_load.number(this.frames.length());
diff -r 769e8dca49f033059d140b614c84381f13394611 -r c1b54085c3aeb9a7cf97c7277436ab3f7b50d299 client/galaxy/scripts/galaxy.interactive_environments.js
--- /dev/null
+++ b/client/galaxy/scripts/galaxy.interactive_environments.js
@@ -0,0 +1,59 @@
+/**
+ * Internal function to remove content from the main area and add the notebook.
+ * Not idempotent
+ */
+function append_notebook(url){
+ clear_main_area();
+ $('#main').append('<iframe frameBorder="0" seamless="seamless" style="width: 100%; height: 100%; overflow:hidden;" scrolling="no" src="'+ url +'"></iframe>'
+ );
+}
+
+function clear_main_area(){
+ $('#spinner').remove();
+ $('#main').children().remove();
+}
+
+function display_spinner(){
+ $('#main').append('<img id="spinner" src="' + galaxy_root + '/static/style/largespinner.gif" style="position:absolute;margin:auto;top:0;left:0;right:0;bottom:0;">');
+}
+
+
+/**
+ * Test availability of a URL, and call a callback when done.
+ * http://stackoverflow.com/q/25390206/347368
+ * @param {String} url: URL to test availability of. Must return a 200 (302->200 is OK).
+ * @param {String} callback: function to call once successfully connected.
+ *
+ */
+function test_ie_availability(url, success_callback){
+ var request_count = 0;
+ display_spinner();
+ interval = setInterval(function(){
+ $.ajax({
+ url: url,
+ xhrFields: {
+ withCredentials: true
+ },
+ type: "GET",
+ timeout: 500,
+ success: function(){
+ console.log("Connected to IE, returning");
+ clearInterval(interval);
+ success_callback();
+ },
+ error: function(jqxhr, status, error){
+ request_count++;
+ console.log("Request " + request_count);
+ if(request_count > 30){
+ clearInterval(interval);
+ clear_main_area();
+ toastr.error(
+ "Could not connect to IE, contact your administrator",
+ "Error",
+ {'closeButton': true, 'timeOut': 20000, 'tapToDismiss': false}
+ );
+ }
+ }
+ });
+ }, 1000);
+}
diff -r 769e8dca49f033059d140b614c84381f13394611 -r c1b54085c3aeb9a7cf97c7277436ab3f7b50d299 client/galaxy/scripts/galaxy.library.js
--- a/client/galaxy/scripts/galaxy.library.js
+++ b/client/galaxy/scripts/galaxy.library.js
@@ -16,19 +16,19 @@
"mvc/library/library-library-view",
"mvc/library/library-folder-view"
],
-function(mod_masthead,
- mod_utils,
- mod_toastr,
- mod_baseMVC,
- mod_library_model,
- mod_folderlist_view,
- mod_librarylist_view,
- mod_librarytoolbar_view,
- mod_foldertoolbar_view,
- mod_library_dataset_view,
- mod_library_library_view,
- mod_library_folder_view
- ) {
+ function(mod_masthead,
+ mod_utils,
+ mod_toastr,
+ mod_baseMVC,
+ mod_library_model,
+ mod_folderlist_view,
+ mod_librarylist_view,
+ mod_librarytoolbar_view,
+ mod_foldertoolbar_view,
+ mod_library_dataset_view,
+ mod_library_library_view,
+ mod_library_folder_view
+ ) {
// ============================================================================
// ROUTER
@@ -37,10 +37,11 @@
this.routesHit = 0;
//keep count of number of routes handled by the application
Backbone.history.on('route', function() { this.routesHit++; }, this);
- },
+},
- routes: {
+routes: {
"" : "libraries",
+ "page/:show_page" : "libraries_page",
"library/:library_id/permissions" : "library_permissions",
"folders/:folder_id/permissions" : "folder_permissions",
"folders/:id" : "folder_content",
@@ -49,27 +50,28 @@
"folders/:folder_id/datasets/:dataset_id/versions/:ldda_id" : "dataset_version",
"folders/:folder_id/download/:format" : "download",
"folders/:folder_id/import/:source" : "import_datasets"
- },
+},
- back: function() {
+back: function() {
if(this.routesHit > 1) {
//more than one route hit -> user did not land to current page directly
window.history.back();
- } else {
+ } else {
//otherwise go to the home page. Use replaceState if available so
//the navigation doesn't create an extra history entry
this.navigate('#', {trigger:true, replace:true});
- }
}
+}
});
// ============================================================================
/** session storage for library preferences */
var LibraryPrefs = mod_baseMVC.SessionStorageModel.extend({
defaults : {
- with_deleted : false,
- sort_order : 'asc',
- sort_by : 'name'
+ with_deleted : false,
+ sort_order : 'asc',
+ sort_by : 'name',
+ library_page_size : 20
}
});
@@ -88,77 +90,86 @@
initialize : function(){
Galaxy.libraries = this;
- this.preferences = new LibraryPrefs( {id: 'global-lib-prefs'} );
+ this.preferences = new LibraryPrefs( { id: 'global-lib-prefs' } );
this.library_router = new LibraryRouter();
this.library_router.on('route:libraries', function() {
Galaxy.libraries.libraryToolbarView = new mod_librarytoolbar_view.LibraryToolbarView();
Galaxy.libraries.libraryListView = new mod_librarylist_view.LibraryListView();
+ });
+
+ this.library_router.on('route:libraries_page', function( show_page ) {
+ if ( Galaxy.libraries.libraryToolbarView === null ){
+ Galaxy.libraries.libraryToolbarView = new mod_librarytoolbar_view.LibraryToolbarView();
+ Galaxy.libraries.libraryListView = new mod_librarylist_view.LibraryListView( { show_page: show_page } );
+ } else {
+ Galaxy.libraries.libraryListView.render( { show_page: show_page } )
+ }
});
this.library_router.on('route:folder_content', function(id) {
if (Galaxy.libraries.folderToolbarView){
Galaxy.libraries.folderToolbarView.$el.unbind('click');
- }
- Galaxy.libraries.folderToolbarView = new mod_foldertoolbar_view.FolderToolbarView({id: id});
- Galaxy.libraries.folderListView = new mod_folderlist_view.FolderListView({id: id});
- });
+ }
+ Galaxy.libraries.folderToolbarView = new mod_foldertoolbar_view.FolderToolbarView({id: id});
+ Galaxy.libraries.folderListView = new mod_folderlist_view.FolderListView({id: id});
+ });
- this.library_router.on('route:download', function(folder_id, format) {
+ this.library_router.on('route:download', function(folder_id, format) {
if ($('#folder_list_body').find(':checked').length === 0) {
mod_toastr.info( 'You must select at least one dataset to download' );
Galaxy.libraries.library_router.navigate('folders/' + folder_id, {trigger: true, replace: true});
- } else {
+ } else {
Galaxy.libraries.folderToolbarView.download(folder_id, format);
Galaxy.libraries.library_router.navigate('folders/' + folder_id, {trigger: false, replace: true});
- }
- });
+ }
+ });
- this.library_router.on('route:dataset_detail', function(folder_id, dataset_id){
+ this.library_router.on('route:dataset_detail', function(folder_id, dataset_id){
if (Galaxy.libraries.datasetView){
Galaxy.libraries.datasetView.$el.unbind('click');
- }
- Galaxy.libraries.datasetView = new mod_library_dataset_view.LibraryDatasetView({id: dataset_id});
- });
- this.library_router.on('route:dataset_version', function(folder_id, dataset_id, ldda_id){
+ }
+ Galaxy.libraries.datasetView = new mod_library_dataset_view.LibraryDatasetView({id: dataset_id});
+ });
+ this.library_router.on('route:dataset_version', function(folder_id, dataset_id, ldda_id){
if (Galaxy.libraries.datasetView){
Galaxy.libraries.datasetView.$el.unbind('click');
- }
- Galaxy.libraries.datasetView = new mod_library_dataset_view.LibraryDatasetView({id: dataset_id, ldda_id: ldda_id, show_version: true});
- });
+ }
+ Galaxy.libraries.datasetView = new mod_library_dataset_view.LibraryDatasetView({id: dataset_id, ldda_id: ldda_id, show_version: true});
+ });
- this.library_router.on('route:dataset_permissions', function(folder_id, dataset_id){
+ this.library_router.on('route:dataset_permissions', function(folder_id, dataset_id){
if (Galaxy.libraries.datasetView){
Galaxy.libraries.datasetView.$el.unbind('click');
- }
- Galaxy.libraries.datasetView = new mod_library_dataset_view.LibraryDatasetView({id: dataset_id, show_permissions: true});
- });
+ }
+ Galaxy.libraries.datasetView = new mod_library_dataset_view.LibraryDatasetView({id: dataset_id, show_permissions: true});
+ });
- this.library_router.on('route:library_permissions', function(library_id){
+ this.library_router.on('route:library_permissions', function(library_id){
if (Galaxy.libraries.libraryView){
Galaxy.libraries.libraryView.$el.unbind('click');
- }
- Galaxy.libraries.libraryView = new mod_library_library_view.LibraryView({id: library_id, show_permissions: true});
- });
+ }
+ Galaxy.libraries.libraryView = new mod_library_library_view.LibraryView({id: library_id, show_permissions: true});
+ });
- this.library_router.on('route:folder_permissions', function(folder_id){
+ this.library_router.on('route:folder_permissions', function(folder_id){
if (Galaxy.libraries.folderView){
Galaxy.libraries.folderView.$el.unbind('click');
- }
- Galaxy.libraries.folderView = new mod_library_folder_view.FolderView({id: folder_id, show_permissions: true});
- });
- this.library_router.on('route:import_datasets', function(folder_id, source){
+ }
+ Galaxy.libraries.folderView = new mod_library_folder_view.FolderView({id: folder_id, show_permissions: true});
+ });
+ this.library_router.on('route:import_datasets', function(folder_id, source){
if (Galaxy.libraries.folderToolbarView && Galaxy.libraries.folderListView){
Galaxy.libraries.folderToolbarView.showImportModal({source:source});
- } else {
+ } else {
Galaxy.libraries.folderToolbarView = new mod_foldertoolbar_view.FolderToolbarView({id: folder_id});
Galaxy.libraries.folderListView = new mod_folderlist_view.FolderListView({id: folder_id});
Galaxy.libraries.folderToolbarView.showImportModal({source: source});
- }
- });
+ }
+ });
- Backbone.history.start({pushState: false});
+ Backbone.history.start({pushState: false});
}
});
diff -r 769e8dca49f033059d140b614c84381f13394611 -r c1b54085c3aeb9a7cf97c7277436ab3f7b50d299 client/galaxy/scripts/galaxy.masthead.js
--- a/client/galaxy/scripts/galaxy.masthead.js
+++ b/client/galaxy/scripts/galaxy.masthead.js
@@ -1,9 +1,8 @@
// dependencies
define([], function() {
-// masthead
-var GalaxyMasthead = Backbone.View.extend(
-{
+/** Masthead **/
+var GalaxyMasthead = Backbone.View.extend({
// base element
el_masthead: '#everything',
@@ -17,8 +16,7 @@
list: [],
// initialize
- initialize : function(options)
- {
+ initialize : function(options) {
// update options
this.options = options;
@@ -51,27 +49,23 @@
},
// configure events
- events:
- {
+ events: {
'click' : '_click',
'mousedown' : function(e) { e.preventDefault() }
},
// adds a new item to the masthead
- append : function(item)
- {
+ append : function(item) {
return this._add(item, true);
},
// adds a new item to the masthead
- prepend : function(item)
- {
+ prepend : function(item) {
return this._add(item, false);
},
// activate
- highlight: function(id)
- {
+ highlight: function(id) {
var current = $(this.el).find('#' + id + '> li');
if (current) {
current.addClass('active');
@@ -79,11 +73,9 @@
},
// adds a new item to the masthead
- _add : function(item, append)
- {
+ _add : function(item, append) {
var $loc = $(this.el).find('#' + item.location);
- if ($loc)
- {
+ if ($loc){
// create frame for new item
var $current = $(item.el);
@@ -106,8 +98,7 @@
},
// handle click event
- _click: function(e)
- {
+ _click: function(e) {
// close all popups
var $all = $(this.el).find('.popup');
if ($all) {
@@ -129,8 +120,7 @@
*/
// fill template
- _template: function(options)
- {
+ _template: function(options) {
var brand_text = options.brand ? ("/ " + options.brand) : "" ;
return '<div><div id="masthead" class="navbar navbar-fixed-top navbar-inverse">' +
'<div style="position: relative; right: -50%; float: left;">' +
@@ -150,12 +140,10 @@
}
});
-// icon
-var GalaxyMastheadIcon = Backbone.View.extend(
-{
+/** Masthead icon **/
+var GalaxyMastheadIcon = Backbone.View.extend({
// icon options
- options:
- {
+ options:{
id : '',
icon : 'fa-cog',
tooltip : '',
@@ -169,8 +157,7 @@
location: 'iconbar',
// initialize
- initialize: function (options)
- {
+ initialize: function (options){
// read in defaults
if (options)
this.options = _.defaults(options, this.options);
@@ -189,20 +176,17 @@
},
// show
- show: function()
- {
+ show: function(){
$(this.el).css({visibility : 'visible'});
},
// show
- hide: function()
- {
+ hide: function(){
$(this.el).css({visibility : 'hidden'});
},
// switch icon
- icon: function (new_icon)
- {
+ icon: function (new_icon){
// update icon class
$(this.el).find('.icon').removeClass(this.options.icon)
.addClass(new_icon);
@@ -212,26 +196,22 @@
},
// toggle
- toggle: function()
- {
+ toggle: function(){
$(this.el).addClass('toggle');
},
// untoggle
- untoggle: function()
- {
+ untoggle: function(){
$(this.el).removeClass('toggle');
},
// set/get number
- number: function(new_number)
- {
+ number: function(new_number){
$(this.el).find('.number').text(new_number);
},
// fill template icon
- _template: function (options)
- {
+ _template: function (options){
var tmpl = '<div id="' + options.id + '" class="symbol">' +
'<div class="icon fa fa-2x ' + options.icon + '"></div>';
if (options.with_number)
@@ -243,12 +223,10 @@
}
});
-// tab
-var GalaxyMastheadTab = Backbone.View.extend(
-{
+/** Masthead tab **/
+var GalaxyMastheadTab = Backbone.View.extend({
// main options
- options:
- {
+ options:{
id : '',
title : '',
target : '_parent',
@@ -268,14 +246,12 @@
$menu: null,
// events
- events:
- {
+ events:{
'click .head' : '_head'
},
// initialize
- initialize: function (options)
- {
+ initialize: function (options){
// read in defaults
if (options)
this.options = _.defaults(options, this.options);
@@ -300,20 +276,17 @@
},
// show
- show: function()
- {
+ show: function(){
$(this.el).css({visibility : 'visible'});
},
// show
- hide: function()
- {
+ hide: function(){
$(this.el).css({visibility : 'hidden'});
},
// add menu item
- add: function (options)
- {
+ add: function (options){
// menu option defaults
var menuOptions = {
title : 'Title',
@@ -333,8 +306,7 @@
menuOptions.content = galaxy_config.root + menuOptions.content;
// check if submenu element is available
- if (!this.$menu)
- {
+ if (!this.$menu){
// insert submenu element into root
$(this.el).find('.root').append(this._templateMenu());
@@ -353,8 +325,7 @@
// add events
var self = this;
- $item.on('click', function(e)
- {
+ $item.on('click', function(e){
// prevent default
e.preventDefault();
@@ -372,8 +343,7 @@
},
// show menu on header click
- _head: function(e)
- {
+ _head: function(e){
// prevent default
e.preventDefault();
@@ -387,12 +357,11 @@
}
},
- _attachPopover : function()
- {
+ _attachPopover : function(){
var $popover_element = $(this.el).find('.head');
$popover_element.popover({
html: true,
- content: 'Please <a href="/user/login">log in</a> or <a href="/user/create">register</a> to use this feature.',
+ content: 'Please <a href="' + galaxy_config.root + '/user/login">log in</a> or <a href="' + galaxy_config.root + '/user/create">register</a> to use this feature.',
placement: 'bottom'
}).on('shown.bs.popover', function() { // hooking on bootstrap event to automatically hide popovers after delay
setTimeout(function() {
@@ -402,25 +371,21 @@
},
// fill template header
- _templateMenuItem: function (options)
- {
+ _templateMenuItem: function (options){
return '<li><a href="' + options.content + '" target="' + options.target + '">' + options.title + '</a></li>';
},
// fill template header
- _templateMenu: function ()
- {
+ _templateMenu: function (){
return '<ul class="popup dropdown-menu"></ul>';
},
- _templateDivider: function()
- {
+ _templateDivider: function(){
return '<li class="divider"></li>';
},
// fill template
- _template: function (options)
- {
+ _template: function (options){
// start template
var tmpl = '<ul id="' + options.id + '" class="nav navbar-nav" border="0" cellspacing="0">' +
'<li class="root dropdown" style="">' +
diff -r 769e8dca49f033059d140b614c84381f13394611 -r c1b54085c3aeb9a7cf97c7277436ab3f7b50d299 client/galaxy/scripts/galaxy.menu.js
--- a/client/galaxy/scripts/galaxy.menu.js
+++ b/client/galaxy/scripts/galaxy.menu.js
@@ -1,13 +1,8 @@
-/*
- galaxy menu
-*/
-
// dependencies
define(["galaxy.masthead"], function(mod_masthead) {
-// frame manager
-var GalaxyMenu = Backbone.Model.extend(
-{
+/** GalaxyMenu uses the GalaxyMasthead class in order to add menu items and icons to the Masthead **/
+var GalaxyMenu = Backbone.Model.extend({
// options
options: null,
@@ -15,16 +10,14 @@
masthead: null,
// initialize
- initialize: function(options)
- {
+ initialize: function(options) {
this.options = options.config;
this.masthead = options.masthead;
this.create();
},
// default menu
- create: function()
- {
+ create: function(){
//
// Analyze data tab.
//
@@ -137,8 +130,7 @@
var tab_visualization = new mod_masthead.GalaxyMastheadTab(visualization_options);
- if (this.options.user.valid) //add submenu only when user is logged in
- {
+ if (this.options.user.valid){ //add submenu only when user is logged in
tab_visualization.add({
title : "New Track Browser",
content : "visualization/trackster",
@@ -155,8 +147,7 @@
//
// Cloud menu.
//
- if (this.options.enable_cloud_launch)
- {
+ if (this.options.enable_cloud_launch){
var tab_cloud = new mod_masthead.GalaxyMastheadTab({
id : "cloud",
title : "Cloud",
@@ -172,8 +163,7 @@
//
// Admin.
//
- if (this.options.is_admin_user)
- {
+ if (this.options.is_admin_user) {
var tab_admin = new mod_masthead.GalaxyMastheadTab({
id : "admin",
title : "Admin",
@@ -192,8 +182,7 @@
title : "Help",
title_attribute : 'Support, contact, and community hubs'
});
- if (this.options.biostar_url)
- {
+ if (this.options.biostar_url){
tab_help.add({
title : "Galaxy Biostar",
content : this.options.biostar_url_redirect,
@@ -235,8 +224,7 @@
content : this.options.citation_url,
target : "_blank"
});
- if (this.options.terms_url)
- {
+ if (this.options.terms_url){
tab_help.add({
title : "Terms and Conditions",
content : this.options.terms_url,
@@ -248,8 +236,7 @@
//
// User tab.
//
- if (!this.options.user.valid)
- {
+ if (!this.options.user.valid){
var tab_user = new mod_masthead.GalaxyMastheadTab({
id : "user",
title : "User",
@@ -265,8 +252,7 @@
});
// register
- if (this.options.allow_user_creation)
- {
+ if (this.options.allow_user_creation){
tab_user.add({
title : "Register",
content : "user/create",
@@ -331,8 +317,7 @@
target : "galaxy_main"
});
- if (this.options.use_remote_user)
- {
+ if (this.options.use_remote_user){
tab_user.add({
title : "Public Name",
content : "user/edit_username?cntrller=user",
diff -r 769e8dca49f033059d140b614c84381f13394611 -r c1b54085c3aeb9a7cf97c7277436ab3f7b50d299 client/galaxy/scripts/mvc/base-mvc.js
--- a/client/galaxy/scripts/mvc/base-mvc.js
+++ b/client/galaxy/scripts/mvc/base-mvc.js
@@ -380,11 +380,6 @@
/** allow the view to be dragged, set up event handlers */
draggableOn : function(){
this.draggable = true;
- //TODO: I have no idea why this doesn't work with the events hash or jq.on()...
- //this.$el.find( '.title-bar' )
- // .attr( 'draggable', true )
- // .bind( 'dragstart', this.dragStartHandler, false )
- // .bind( 'dragend', this.dragEndHandler, false );
this.dragStartHandler = _.bind( this._dragStartHandler, this );
this.dragEndHandler = _.bind( this._dragEndHandler, this );
@@ -402,23 +397,22 @@
},
/** sets the dataTransfer data to the model's toJSON
- * @fires dragstart (bbone event) which is passed this view
+ * @fires draggable:dragstart (bbone event) which is passed the event and this view
*/
_dragStartHandler : function( event ){
- //this.debug( 'dragStartHandler:', this, event, arguments )
- this.trigger( 'dragstart', this );
event.dataTransfer.effectAllowed = 'move';
+ //ASSUMES: this.model
//TODO: all except IE: should be 'application/json', IE: must be 'text'
event.dataTransfer.setData( 'text', JSON.stringify( this.model.toJSON() ) );
+ this.trigger( 'draggable:dragstart', event, this );
return false;
},
/** handle the dragend
- * @fires dragend (bbone event) which is passed this view
+ * @fires draggable:dragend (bbone event) which is passed the event and this view
*/
_dragEndHandler : function( event ){
- this.trigger( 'dragend', this );
- //this.debug( 'dragEndHandler:', event )
+ this.trigger( 'draggable:dragend', event, this );
return false;
}
};
diff -r 769e8dca49f033059d140b614c84381f13394611 -r c1b54085c3aeb9a7cf97c7277436ab3f7b50d299 client/galaxy/scripts/mvc/citation/citation-view.js
--- a/client/galaxy/scripts/mvc/citation/citation-view.js
+++ b/client/galaxy/scripts/mvc/citation/citation-view.js
@@ -58,11 +58,11 @@
var doiUrl = "";
if( fields.doi ) {
doiUrl = 'http://dx.doi.org/' + fields.doi;
- ref += '[<a href="' + doiUrl + '">doi:' + fields.doi + "</a>]";
+ ref += '[<a href="' + doiUrl + '" target="_blank">doi:' + fields.doi + "</a>]";
}
var url = fields.url || doiUrl;
if( url ) {
- ref += '[<a href="' + url + '">Link</a>]';
+ ref += '[<a href="' + url + '" target="_blank">Link</a>]';
}
return ref;
},
@@ -185,4 +185,4 @@
CitationListView : CitationListView
};
-});
\ No newline at end of file
+});
diff -r 769e8dca49f033059d140b614c84381f13394611 -r c1b54085c3aeb9a7cf97c7277436ab3f7b50d299 client/galaxy/scripts/mvc/collection/collection-li.js
--- a/client/galaxy/scripts/mvc/collection/collection-li.js
+++ b/client/galaxy/scripts/mvc/collection/collection-li.js
@@ -100,8 +100,6 @@
/** add the DCE class to the list item */
className : ListItemView.prototype.className + " dataset-collection-element",
- /** jq fx speed for this view */
- fxSpeed : 'fast',
/** set up */
initialize : function( attributes ){
diff -r 769e8dca49f033059d140b614c84381f13394611 -r c1b54085c3aeb9a7cf97c7277436ab3f7b50d299 client/galaxy/scripts/mvc/collection/paired-collection-creator.js
--- a/client/galaxy/scripts/mvc/collection/paired-collection-creator.js
+++ b/client/galaxy/scripts/mvc/collection/paired-collection-creator.js
@@ -1298,7 +1298,7 @@
_clickPairName : function( ev ){
ev.stopPropagation();
var $control = $( ev.currentTarget ),
- pair = this.paired[ $control.parent().index() ],
+ pair = this.paired[ $control.parent().parent().index() / 2 ],
response = prompt( 'Enter a new name for the pair:', pair.name );
if( response ){
pair.name = response;
diff -r 769e8dca49f033059d140b614c84381f13394611 -r c1b54085c3aeb9a7cf97c7277436ab3f7b50d299 client/galaxy/scripts/mvc/dataset/dataset-li-edit.js
--- a/client/galaxy/scripts/mvc/dataset/dataset-li-edit.js
+++ b/client/galaxy/scripts/mvc/dataset/dataset-li-edit.js
@@ -181,6 +181,8 @@
}
var $visualizations = $( this.templates.visualizations( visualizations, this ) );
+ //HACK: need to re-write those directed at galaxy_main with linkTarget
+ $visualizations.find( '[target="galaxy_main"]').attr( 'target', this.linkTarget );
// use addBack here to include the root $visualizations elem (for the case of 1 visualization)
this._addScratchBookFn( $visualizations.find( '.visualization-link' ).addBack( '.visualization-link' ) );
return $visualizations;
@@ -188,6 +190,7 @@
/** add scratchbook functionality to visualization links */
_addScratchBookFn : function( $links ){
+ var li = this;
$links.click( function( ev ){
if( Galaxy.frame && Galaxy.frame.active ){
Galaxy.frame.add({
diff -r 769e8dca49f033059d140b614c84381f13394611 -r c1b54085c3aeb9a7cf97c7277436ab3f7b50d299 client/galaxy/scripts/mvc/dataset/dataset-li.js
--- a/client/galaxy/scripts/mvc/dataset/dataset-li.js
+++ b/client/galaxy/scripts/mvc/dataset/dataset-li.js
@@ -160,7 +160,7 @@
// add frame manager option onclick event
var self = this;
displayBtnData.onclick = function( ev ){
- if( Galaxy.frame && Galaxy.frame.active ){
+ if (Galaxy.frame && Galaxy.frame.active) {
// Add dataset to frames.
Galaxy.frame.add_dataset(self.model.get('id'));
ev.preventDefault();
diff -r 769e8dca49f033059d140b614c84381f13394611 -r c1b54085c3aeb9a7cf97c7277436ab3f7b50d299 client/galaxy/scripts/mvc/dataset/dataset-model.js
--- a/client/galaxy/scripts/mvc/dataset/dataset-model.js
+++ b/client/galaxy/scripts/mvc/dataset/dataset-model.js
@@ -94,10 +94,7 @@
this.trigger( 'state:ready', currModel, newState, this.previous( 'state' ) );
}
});
- this.on( 'change:urls', function(){
- console.warn( 'change:urls', arguments );
- });
- // the download url (currenlty) relies on having a correct file extension
+ // the download url (currently) relies on having a correct file extension
this.on( 'change:id change:file_ext', function( currModel ){
this._generateUrls();
});
@@ -139,8 +136,15 @@
},
// ........................................................................ ajax
+ fetch : function( options ){
+ var dataset = this;
+ return Backbone.Model.prototype.fetch.call( this, options )
+ .always( function(){
+ dataset._generateUrls();
+ });
+ },
+
//NOTE: subclasses of DA's will need to implement url and urlRoot in order to have these work properly
-
/** save this dataset, _Mark_ing it as deleted (just a flag) */
'delete' : function( options ){
if( this.get( 'deleted' ) ){ return jQuery.when(); }
@@ -359,74 +363,11 @@
Backbone.Collection.prototype.set.call( this, models, options );
},
-// /** Convert this ad-hoc collection of hdas to a formal collection tracked
-// by the server.
-// **/
-// promoteToHistoryDatasetCollection : function _promote( history, collection_type, options ){
-////TODO: seems like this would be better in mvc/collections
-// options = options || {};
-// options.url = this.url();
-// options.type = "POST";
-// var full_collection_type = collection_type;
-// var element_identifiers = [],
-// name = null;
-//
-// // This mechanism is rough - no error handling, allows invalid selections, no way
-// // for user to pick/override element identifiers. This is only really meant
-// if( collection_type === "list" ) {
-// this.chain().each( function( hda ) {
-// // TODO: Handle duplicate names.
-// var name = hda.attributes.name;
-// var id = hda.get('id');
-// var content_type = hda.attributes.history_content_type;
-// if( content_type === "dataset" ) {
-// if( full_collection_type !== "list" ) {
-// this.log( "Invalid collection type" );
-// }
-// element_identifiers.push( { name: name, src: "hda", id: id } );
-// } else {
-// if( full_collection_type === "list" ) {
-// full_collection_type = "list:" + hda.attributes.collection_type;
-// } else {
-// if( full_collection_type !== "list:" + hda.attributes.collection_type ) {
-// this.log( "Invalid collection type" );
-// }
-// }
-// element_identifiers.push( { name: name, src: "hdca", id: id } );
-// }
-// });
-// name = "New Dataset List";
-// } else if( collection_type === "paired" ) {
-// var ids = this.ids();
-// if( ids.length !== 2 ){
-// // TODO: Do something...
-// }
-// element_identifiers.push( { name: "forward", src: "hda", id: ids[ 0 ] } );
-// element_identifiers.push( { name: "reverse", src: "hda", id: ids[ 1 ] } );
-// name = "New Dataset Pair";
-// }
-// options.data = {
-// type: "dataset_collection",
-// name: name,
-// collection_type: full_collection_type,
-// element_identifiers: JSON.stringify( element_identifiers )
-// };
-//
-// var xhr = jQuery.ajax( options );
-// xhr.done( function( message, status, responseObj ){
-// history.refresh( );
-// });
-// xhr.fail( function( xhr, status, message ){
-// if( xhr.responseJSON && xhr.responseJSON.error ){
-// error = xhr.responseJSON.error;
-// } else {
-// error = xhr.responseJSON;
-// }
-// xhr.responseText = error;
-// // Do something?
-// });
-// return xhr;
-// },
+ ///** Convert this ad-hoc collection of hdas to a formal collection tracked
+ // by the server.
+ //**/
+ //promoteToHistoryDatasetCollection : function _promote( history, collection_type, options ){
+ //},
/** String representation. */
toString : function(){
diff -r 769e8dca49f033059d140b614c84381f13394611 -r c1b54085c3aeb9a7cf97c7277436ab3f7b50d299 client/galaxy/scripts/mvc/history/history-contents.js
--- a/client/galaxy/scripts/mvc/history/history-contents.js
+++ b/client/galaxy/scripts/mvc/history/history-contents.js
@@ -187,6 +187,7 @@
/** copy an existing, accessible hda into this collection */
copy : function( id ){
+//TODO: incorp collections
var collection = this,
xhr = jQuery.post( this.url(), {
source : 'hda',
diff -r 769e8dca49f033059d140b614c84381f13394611 -r c1b54085c3aeb9a7cf97c7277436ab3f7b50d299 client/galaxy/scripts/mvc/history/history-model.js
--- a/client/galaxy/scripts/mvc/history/history-model.js
+++ b/client/galaxy/scripts/mvc/history/history-model.js
@@ -14,7 +14,7 @@
* @constructs
*/
var History = Backbone.Model.extend( BASE_MVC.LoggableMixin ).extend(
-/** @lends History.prototype */{
+ BASE_MVC.mixin( BASE_MVC.SearchableModelMixin, /** @lends History.prototype */{
/** logger used to record this.log messages, commonly set to console */
//logger : console,
@@ -117,7 +117,19 @@
return _.reduce( _.values( this.get( 'state_details' ) ), function( memo, num ){ return memo + num; }, 0 );
},
- // ........................................................................ ajax
+ // ........................................................................ search
+ /** What model fields to search with */
+ searchAttributes : [
+ 'name', 'annotation', 'tags'
+ ],
+
+ /** Adding title and singular tag */
+ searchAliases : {
+ title : 'name',
+ tag : 'tags'
+ },
+
+ // ........................................................................ updates
/** does the contents collection indicate they're still running and need to be updated later?
* delay + update if needed
* @param {Function} onReadyCallback function to run when all contents are in the ready state
@@ -187,6 +199,18 @@
return xhr;
},
+ // ........................................................................ ajax
+ /** save this history, _Mark_ing it as deleted (just a flag) */
+ _delete : function( options ){
+ if( this.get( 'deleted' ) ){ return jQuery.when(); }
+ return this.save( { deleted: true }, options );
+ },
+ /** save this history, _Mark_ing it as undeleted */
+ undelete : function( options ){
+ if( !this.get( 'deleted' ) ){ return jQuery.when(); }
+ return this.save( { deleted: false }, options );
+ },
+
/** Make a copy of this history on the server
* @param {Boolean} current if true, set the copy as the new current history (default: true)
* @param {String} name name of new history (default: none - server sets to: Copy of <current name>)
@@ -210,9 +234,28 @@
//TODO:?? all datasets?
var history = this,
- xhr = jQuery.post( this.urlRoot, postData );
- xhr.done( function( newData ){
- history.trigger( 'copied', history, newData );
+ copy = jQuery.post( this.urlRoot, postData );
+ // if current - queue to setAsCurrent before firing 'copied'
+ if( current ){
+ return copy.then( function( response ){
+ var newHistory = new History( response );
+ return newHistory.setAsCurrent()
+ .done( function(){
+ history.trigger( 'copied', history, response );
+ });
+ });
+ }
+ return copy.done( function( response ){
+ history.trigger( 'copied', history, response );
+ });
+ },
+
+ setAsCurrent : function(){
+ var history = this,
+ xhr = jQuery.getJSON( '/history/set_as_current?id=' + this.id );
+
+ xhr.done( function(){
+ history.trigger( 'set-as-current', history );
});
return xhr;
},
@@ -221,7 +264,7 @@
toString : function(){
return 'History(' + this.get( 'id' ) + ',' + this.get( 'name' ) + ')';
}
-});
+}));
//------------------------------------------------------------------------------ CLASS VARS
/** When the history has running hdas,
@@ -351,12 +394,15 @@
create : function create( data, hdas, historyOptions, xhrOptions ){
var collection = this,
- history = new History( data || {}, hdas || [], historyOptions || {} );
- return history.save( xhrOptions ).done( function( newData ){
+ xhr = jQuery.getJSON( galaxy_config.root + 'history/create_new_current' );
+ return xhr.done( function( newData ){
+ var history = new History( newData, [], historyOptions || {} );
// new histories go in the front
//TODO: (implicit ordering by update time...)
collection.unshift( history );
+ collection.trigger( 'new-current' );
});
+//TODO: move back to using history.save (via Deferred.then w/ set_as_current)
},
toString: function toString(){
diff -r 769e8dca49f033059d140b614c84381f13394611 -r c1b54085c3aeb9a7cf97c7277436ab3f7b50d299 client/galaxy/scripts/mvc/history/history-panel-edit-current.js
--- a/client/galaxy/scripts/mvc/history/history-panel-edit-current.js
+++ b/client/galaxy/scripts/mvc/history/history-panel-edit-current.js
@@ -164,12 +164,13 @@
_setUpCollectionListeners : function(){
_super.prototype._setUpCollectionListeners.call( this );
+ //TODO:?? may not be needed? see history-panel-edit, 369
// if a hidden item is created (gen. by a workflow), moves thru the updater to the ready state,
// then: remove it from the collection if the panel is set to NOT show hidden datasets
this.collection.on( 'state:ready', function( model, newState, oldState ){
if( ( !model.get( 'visible' ) )
&& ( !this.storage.get( 'show_hidden' ) ) ){
- this.removeItemView( this.viewFromModel( model ) );
+ this.removeItemView( model );
}
}, this );
},
@@ -226,7 +227,7 @@
'</a>'
].join('') );
$emptyMsg.find( '.uploader-link' ).click( function( ev ){
- Galaxy.upload._eventShow( ev );
+ Galaxy.upload.show( ev );
});
$emptyMsg.find( '.get-data-link' ).click( function( ev ){
$toolMenu.parent().scrollTop( 0 );
@@ -288,51 +289,23 @@
},
// ------------------------------------------------------------------------ sub-views
- // reverse HID order
- /** Override to reverse order of views - newest contents on top
- * and add the current-content highlight class to currentContentId's view
- */
+ /** Override to add the current-content highlight class to currentContentId's view */
_attachItems : function( $whereTo ){
- var panel = this;
- this.$list( $whereTo ).append( this.views.reverse().map( function( view ){
- // add current content
- if( panel.currentContentId && view.model.id === panel.currentContentId ){
- panel.setCurrentContent( view );
- }
- return view.$el;
- }));
+ _super.prototype._attachItems.call( this, $whereTo );
+ var panel = this,
+ currentContentView;
+ if( panel.currentContentId
+ && ( currentContentView = panel.viewFromModelId( panel.currentContentId ) ) ){
+ panel.setCurrentContent( currentContentView );
+ }
return this;
},
- /** Override to add datasets at the top */
+ /** Override to remove any drill down panels */
addItemView : function( model, collection, options ){
- this.log( this + '.addItemView:', model );
- var panel = this;
- if( !panel._filterItem( model ) ){ return undefined; }
-//TODO: alternately, call collapse drilldown
- // if this panel is currently hidden, return undefined
- if( panel.panelStack.length ){ return this._collapseDrilldownPanel(); }
-
- var view = panel._createItemView( model );
- // use unshift and prepend to preserve reversed order
- panel.views.unshift( view );
-
- panel.scrollToTop();
- $({}).queue([
- function fadeOutEmptyMsg( next ){
- var $emptyMsg = panel.$emptyMessage();
- if( $emptyMsg.is( ':visible' ) ){
- $emptyMsg.fadeOut( panel.fxSpeed, next );
- } else {
- next();
- }
- },
- function createAndPrepend( next ){
- // render as hidden then slide down
- panel.$list().prepend( view.render( 0 ).$el.hide() );
- view.$el.slideDown( panel.fxSpeed );
- }
- ]);
+ var view = _super.prototype.addItemView.call( this, model, collection, options );
+ if( !view ){ return view; }
+ if( this.panelStack.length ){ return this._collapseDrilldownPanel(); }
return view;
},
@@ -423,22 +396,6 @@
if( !msg.is( ':hidden' ) ){ msg.slideUp( this.fxSpeed ); }
},
-//TODO: move show_deleted/hidden into panel from opt menu and remove this
- /** add listeners to an external options menu (templates/webapps/galaxy/root/index.mako) */
- connectToOptionsMenu : function( optionsMenu ){
- if( !optionsMenu ){
- return this;
- }
- // set a visible indication in the popupmenu for show_hidden/deleted based on the currHistoryPanel's settings
- this.on( 'new-storage', function( storage, panel ){
- if( optionsMenu && storage ){
- optionsMenu.findItemByHtml( _l( 'Include Deleted Datasets' ) ).checked = storage.get( 'show_deleted' );
- optionsMenu.findItemByHtml( _l( 'Include Hidden Datasets' ) ).checked = storage.get( 'show_hidden' );
- }
- });
- return this;
- },
-
/** Return a string rep of the history
*/
toString : function(){
diff -r 769e8dca49f033059d140b614c84381f13394611 -r c1b54085c3aeb9a7cf97c7277436ab3f7b50d299 client/galaxy/scripts/mvc/history/history-panel-edit.js
--- a/client/galaxy/scripts/mvc/history/history-panel-edit.js
+++ b/client/galaxy/scripts/mvc/history/history-panel-edit.js
@@ -69,7 +69,18 @@
this.multiselectActions = attributes.multiselectActions || this._getActions();
},
- // ------------------------------------------------------------------------ panel rendering
+ /** Override to handle history as drag-drop target */
+ _setUpListeners : function(){
+ _super.prototype._setUpListeners.call( this );
+
+ this.on( 'drop', function( ev, data ){
+ this.dataDropped( data );
+ // remove the drop target
+ this.dropTargetOff();
+ });
+ },
+
+ // ------------------------------------------------------------------------ listeners
/** listening for collection events */
_setUpCollectionListeners : function(){
_super.prototype._setUpCollectionListeners.call( this );
@@ -104,6 +115,42 @@
return $newRender;
},
+ /** override to render counts when the items are rendered */
+ renderItems : function( $whereTo ){
+ var views = _super.prototype.renderItems.call( this, $whereTo );
+ this._renderCounts( $whereTo );
+ return views;
+ },
+
+ /** override to show counts, what's deleted/hidden, and links to toggle those */
+ _renderCounts : function( $whereTo ){
+//TODO: too complicated
+ function toggleLink( _class, text ){
+ return [ '<a class="', _class, '" href="javascript:void(0);">', text, '</a>' ].join( '' );
+ }
+ $whereTo = $whereTo || this.$el;
+ var deleted = this.collection.where({ deleted: true }),
+ hidden = this.collection.where({ visible: false }),
+ msgs = [];
+
+ if( this.views.length ){
+ msgs.push( [ this.views.length, _l( 'shown' ) ].join( ' ' ) );
+ }
+ if( deleted.length ){
+ msgs.push( ( !this.showDeleted )?
+ ([ deleted.length, toggleLink( 'toggle-deleted-link', _l( 'deleted' ) ) ].join( ' ' ))
+ :( toggleLink( 'toggle-deleted-link', _l( 'hide deleted' ) ) )
+ );
+ }
+ if( hidden.length ){
+ msgs.push( ( !this.showHidden )?
+ ([ hidden.length, toggleLink( 'toggle-hidden-link', _l( 'hidden' ) ) ].join( ' ' ))
+ :( toggleLink( 'toggle-hidden-link', _l( 'hide hidden' ) ) )
+ );
+ }
+ return $whereTo.find( '> .controls .subtitle' ).html( msgs.join( ', ' ) );
+ },
+
/** render the tags sub-view controller */
_renderTags : function( $where ){
var panel = this;
@@ -266,6 +313,24 @@
},
// ------------------------------------------------------------------------ sub-views
+ // reverse HID order
+ /** Override to reverse order of views - newest contents on top */
+ _attachItems : function( $whereTo ){
+ this.$list( $whereTo ).append( this.views.reverse().map( function( view ){
+ return view.$el;
+ }));
+ return this;
+ },
+
+ /** Override to add new contents at the top */
+ _attachView : function( view ){
+ var panel = this;
+ // override to control where the view is added, how/whether it's rendered
+ panel.views.unshift( view );
+ panel.$list().prepend( view.render( 0 ).$el.hide() );
+ view.$el.slideDown( panel.fxSpeed );
+ },
+
/** In this override, add purgeAllowed and whether tags/annotation editors should be shown */
_getItemViewOptions : function( model ){
var options = _super.prototype._getItemViewOptions.call( this, model );
@@ -278,22 +343,31 @@
return options;
},
+ ///** Override to alter data in drag based on multiselection */
+ //_setUpItemViewListeners : function( view ){
+ // var panel = this;
+ // _super.prototype._setUpItemViewListeners.call( panel, view );
+ //
+ //},
+
/** If this item is deleted and we're not showing deleted items, remove the view
* @param {Model} the item model to check
*/
_handleHdaDeletionChange : function( itemModel ){
- if( itemModel.get( 'deleted' ) && !this.storage.get( 'show_deleted' ) ){
+ if( itemModel.get( 'deleted' ) && !this.showDeleted ){
this.removeItemView( itemModel );
}
+ this._renderCounts();
},
/** If this item is hidden and we're not showing hidden items, remove the view
* @param {Model} the item model to check
*/
_handleHdaVisibleChange : function( itemModel ){
- if( itemModel.hidden() && !this.storage.get( 'show_hidden' ) ){
+ if( itemModel.hidden() && !this.storage.showHidden ){
this.removeItemView( itemModel );
}
+ this._renderCounts();
},
/** toggle the visibility of each content's tagsEditor applying all the args sent to this function */
@@ -319,7 +393,9 @@
// ------------------------------------------------------------------------ panel events
/** event map */
events : _.extend( _.clone( _super.prototype.events ), {
- 'click .show-selectors-btn' : 'toggleSelectors'
+ 'click .show-selectors-btn' : 'toggleSelectors',
+ 'click .toggle-deleted-link' : function( ev ){ this.toggleShowDeleted(); },
+ 'click .toggle-hidden-link' : function( ev ){ this.toggleShowHidden(); }
}),
/** Update the history size display (curr. upper right of panel).
@@ -328,6 +404,132 @@
this.$el.find( '.history-size' ).text( this.model.get( 'nice_size' ) );
},
+ // ------------------------------------------------------------------------ as drop target
+ /** */
+ dropTargetOn : function(){
+ if( this.dropTarget ){ return this; }
+ this.dropTarget = true;
+
+ //TODO: to init
+ var dropHandlers = {
+ 'dragenter' : _.bind( this.dragenter, this ),
+ 'dragover' : _.bind( this.dragover, this ),
+ 'dragleave' : _.bind( this.dragleave, this ),
+ 'drop' : _.bind( this.drop, this )
+ };
+//TODO: scroll to top
+ var $dropTarget = this._renderDropTarget();
+ this.$list().before([ this._renderDropTargetHelp(), $dropTarget ]);
+ for( var evName in dropHandlers ){
+ if( dropHandlers.hasOwnProperty( evName ) ){
+ //console.debug( evName, dropHandlers[ evName ] );
+ $dropTarget.on( evName, dropHandlers[ evName ] );
+ }
+ }
+ return this;
+ },
+
+ /** */
+ _renderDropTarget : function(){
+ return $( '<div/>' ).addClass( 'history-drop-target' )
+ .css({
+ 'height': '64px',
+ 'margin': '0px 10px 10px 10px',
+ 'border': '1px dashed black',
+ 'border-radius' : '3px'
+ });
+ },
+
+ /** */
+ _renderDropTargetHelp : function(){
+ return $( '<div/>' ).addClass( 'history-drop-target-help' )
+ .css({
+ 'margin' : '10px 10px 4px 10px',
+ 'color' : 'grey',
+ 'font-size' : '80%',
+ 'font-style' : 'italic'
+ })
+ .text( _l( 'Drag datasets here to copy them to the current history' ) );
+ },
+
+ /** */
+ dropTargetOff : function(){
+ if( !this.dropTarget ){ return this; }
+ //this.log( 'dropTargetOff' );
+ this.dropTarget = false;
+ //
+ //var dropTarget = this.$( '.history-drop-target' ).get(0);
+ //for( var evName in this._dropHandlers ){
+ // if( this._dropHandlers.hasOwnProperty( evName ) ){
+ // console.debug( evName, this._dropHandlers[ evName ] );
+ // dropTarget.off( evName, this._dropHandlers[ evName ] );
+ // }
+ //}
+ this.$( '.history-drop-target' ).remove();
+ this.$( '.history-drop-target-help' ).remove();
+ return this;
+ },
+ /** */
+ dropTargetToggle : function(){
+ if( this.dropTarget ){
+ this.dropTargetOff();
+ } else {
+ this.dropTargetOn();
+ }
+ return this;
+ },
+
+ /** */
+ dragenter : function( ev ){
+ //console.debug( 'dragenter:', this, ev );
+ ev.preventDefault();
+ ev.stopPropagation();
+ this.$( '.history-drop-target' ).css( 'border', '2px solid black' );
+ },
+ /** */
+ dragover : function( ev ){
+ ev.preventDefault();
+ ev.stopPropagation();
+ },
+ /** */
+ dragleave : function( ev ){
+ //console.debug( 'dragleave:', this, ev );
+ ev.preventDefault();
+ ev.stopPropagation();
+ this.$( '.history-drop-target' ).css( 'border', '1px dashed black' );
+ },
+ /** */
+ drop : function( ev ){
+ //console.warn( 'dataTransfer:', ev.dataTransfer.getData( 'text' ) );
+ //console.warn( 'dataTransfer:', ev.originalEvent.dataTransfer.getData( 'text' ) );
+ ev.preventDefault();
+ //ev.stopPropagation();
+ ev.dataTransfer.dropEffect = 'move';
+
+ //console.debug( 'ev.dataTransfer:', ev.dataTransfer );
+
+ var panel = this,
+ data = ev.dataTransfer.getData( "text" );
+ try {
+ data = JSON.parse( data );
+
+ } catch( err ){
+ this.warn( 'error parsing JSON from drop:', data );
+ }
+ this.trigger( 'droptarget:drop', ev, data, panel );
+ return false;
+ },
+
+ /** */
+ dataDropped : function( data ){
+ var panel = this;
+ // HDA: dropping will copy it to the history
+ if( _.isObject( data ) && data.model_class === 'HistoryDatasetAssociation' && data.id ){
+ return panel.model.contents.copy( data.id );
+ }
+ return jQuery.when();
+ },
+
// ........................................................................ misc
/** Return a string rep of the history */
toString : function(){
diff -r 769e8dca49f033059d140b614c84381f13394611 -r c1b54085c3aeb9a7cf97c7277436ab3f7b50d299 client/galaxy/scripts/mvc/history/history-panel.js
--- a/client/galaxy/scripts/mvc/history/history-panel.js
+++ b/client/galaxy/scripts/mvc/history/history-panel.js
@@ -254,6 +254,10 @@
_setUpWebStorage : function( initiallyExpanded, show_deleted, show_hidden ){
//if( !this.model ){ return this; }
//this.log( '_setUpWebStorage', initiallyExpanded, show_deleted, show_hidden );
+ if( this.storage ){
+ this.stopListening( this.storage );
+ }
+
this.storage = new HistoryPrefs({
id: HistoryPrefs.historyStorageKey( this.model.get( 'id' ) )
});
@@ -276,6 +280,18 @@
this.trigger( 'new-storage', this.storage, this );
this.log( this + ' (init\'d) storage:', this.storage.get() );
+
+ this.listenTo( this.storage, {
+ 'change:show_deleted' : function( view, newVal ){
+ this.showDeleted = newVal;
+ },
+ 'change:show_hidden' : function( view, newVal ){
+ this.showHidden = newVal;
+ }
+ }, this );
+ this.showDeleted = ( show_deleted !== undefined )? show_deleted : this.storage.get( 'show_deleted' );
+ this.showHidden = ( show_hidden !== undefined )? show_hidden : this.storage.get( 'show_hidden' );
+
return this;
},
@@ -317,8 +333,8 @@
_filterItem : function( model ){
var panel = this;
return ( _super.prototype._filterItem.call( panel, model )
- && ( !model.hidden() || panel.storage.get( 'show_hidden' ) )
- && ( !model.isDeletedOrPurged() || panel.storage.get( 'show_deleted' ) ) );
+ && ( !model.hidden() || panel.showHidden )
+ && ( !model.isDeletedOrPurged() || panel.showDeleted ) );
},
/** in this override, add a linktarget, and expand if id is in web storage */
@@ -372,12 +388,17 @@
* (2) re-rendering the history
* @returns {Boolean} new show_deleted setting
*/
- toggleShowDeleted : function( show ){
- show = ( show !== undefined )?( show ):( !this.storage.get( 'show_deleted' ) );
- this.storage.set( 'show_deleted', show );
+ toggleShowDeleted : function( show, store ){
+ show = ( show !== undefined )?( show ):( !this.showDeleted );
+ store = ( store !== undefined )?( store ):( true );
+ this.showDeleted = show;
+ if( store ){
+ this.storage.set( 'show_deleted', show );
+ }
+ this.trigger( 'show-hidden', show );
//TODO:?? to events on storage('change:show_deleted')
this.renderItems();
- return this.storage.get( 'show_deleted' );
+ return this.showDeleted;
},
/** Handle the user toggling the deleted visibility by:
@@ -385,12 +406,17 @@
* (2) re-rendering the history
* @returns {Boolean} new show_hidden setting
*/
- toggleShowHidden : function( show ){
- show = ( show !== undefined )?( show ):( !this.storage.get( 'show_hidden' ) );
- this.storage.set( 'show_hidden', show );
- //TODO:?? to events on storage('change:show_hidden')
+ toggleShowHidden : function( show, store ){
+ show = ( show !== undefined )?( show ):( !this.showHidden );
+ store = ( store !== undefined )?( store ):( true );
+ this.showHidden = show;
+ if( store ){
+ this.storage.set( 'show_hidden', show );
+ }
+ this.trigger( 'show-hidden', show );
+ //TODO:?? to events on storage('change:show_deleted')
this.renderItems();
- return this.storage.get( 'show_hidden' );
+ return this.showHidden;
},
/** On the first search, if there are no details - load them, then search */
@@ -582,9 +608,7 @@
'<div class="title">',
'<div class="name"><%= history.name %></div>',
'</div>',
- '<div class="subtitle">',
- //'<%= view.collection.length %>', _l( ' items' ),
- '</div>',
+ '<div class="subtitle"></div>',
'<div class="history-size"><%= history.nice_size %></div>',
'<div class="actions"></div>',
This diff is so big that we needed to truncate the remainder.
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.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/7c2c5f45c34f/
Changeset: 7c2c5f45c34f
User: natefoo
Date: 2014-11-18 14:10:36+00:00
Summary: Add a table for tracking the history of job states.
Affected #: 4 files
diff -r 7c6c900abf1f2968dab4552b9e589b0ffe94cb69 -r 7c2c5f45c34f3c92e51e154c30472f2982a40271 lib/galaxy/jobs/__init__.py
--- a/lib/galaxy/jobs/__init__.py
+++ b/lib/galaxy/jobs/__init__.py
@@ -982,7 +982,9 @@
self.sa_session.flush()
if info:
job.info = info
- job.state = state
+ # FIXME:
+ #job.state = state
+ job.set_state( state )
self.sa_session.add( job )
self.sa_session.flush()
@@ -1071,7 +1073,7 @@
log.warning( "finish(): %s not found, but %s is not empty, so it will be used instead" % ( dataset_path.false_path, dataset_path.real_path ) )
else:
# Prior to fail we need to set job.state
- job.state = final_job_state
+ job.set_state( final_job_state )
return self.fail( "Job %s's output dataset(s) could not be read" % job.id )
job_context = ExpressionContext( dict( stdout=job.stdout, stderr=job.stderr ) )
diff -r 7c6c900abf1f2968dab4552b9e589b0ffe94cb69 -r 7c2c5f45c34f3c92e51e154c30472f2982a40271 lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -334,6 +334,7 @@
self.handler = None
self.exit_code = None
self._init_metrics()
+ self.state_history.append( JobStateHistory( self ) )
@property
def finished( self ):
@@ -476,9 +477,11 @@
state is propagated down to datasets.
"""
self.state = state
+ self.state_history.append( JobStateHistory( self ) )
# For historical reasons state propogates down to datasets
- for da in self.output_datasets:
- da.dataset.state = state
+ # FIXME: is this used anywhere?
+ #for da in self.output_datasets:
+ # da.dataset.state = state
def get_param_values( self, app, ignore_errors=False ):
"""
Read encoded parameter values from the database and turn back into a
@@ -738,6 +741,13 @@
self.dataset = dataset
+class JobStateHistory( object ):
+ def __init__( self, job ):
+ self.job = job
+ self.state = job.state
+ self.info = job.info
+
+
class ImplicitlyCreatedDatasetCollectionInput( object ):
def __init__( self, name, input_dataset_collection ):
self.name = name
diff -r 7c6c900abf1f2968dab4552b9e589b0ffe94cb69 -r 7c2c5f45c34f3c92e51e154c30472f2982a40271 lib/galaxy/model/mapping.py
--- a/lib/galaxy/model/mapping.py
+++ b/lib/galaxy/model/mapping.py
@@ -411,6 +411,14 @@
Column( "params", TrimmedString(255), index=True ),
Column( "handler", TrimmedString( 255 ), index=True ) )
+model.JobStateHistory.table = Table( "job_state_history", metadata,
+ Column( "id", Integer, primary_key=True ),
+ Column( "create_time", DateTime, default=now ),
+ Column( "update_time", DateTime, default=now, onupdate=now ),
+ Column( "job_id", Integer, ForeignKey( "job.id" ), index=True ),
+ Column( "state", String( 64 ), index=True ),
+ Column( "info", TrimmedString( 255 ) ) )
+
model.JobParameter.table = Table( "job_parameter", metadata,
Column( "id", Integer, primary_key=True ),
Column( "job_id", Integer, ForeignKey( "job.id" ), index=True ),
@@ -1805,6 +1813,11 @@
model.LibraryDatasetDatasetAssociation, lazy=False ) ) )
simple_mapping(
+ model.JobStateHistory,
+ job=relation( model.Job, backref="state_history" ),
+)
+
+simple_mapping(
model.JobMetricText,
job=relation( model.Job, backref="text_metrics" ),
)
diff -r 7c6c900abf1f2968dab4552b9e589b0ffe94cb69 -r 7c2c5f45c34f3c92e51e154c30472f2982a40271 lib/galaxy/model/migrate/versions/0124_job_state_history.py
--- /dev/null
+++ b/lib/galaxy/model/migrate/versions/0124_job_state_history.py
@@ -0,0 +1,48 @@
+"""
+Migration script for the job state history table
+"""
+
+from sqlalchemy import *
+from sqlalchemy.orm import *
+from migrate import *
+from migrate.changeset import *
+from galaxy.model.custom_types import *
+
+import datetime
+now = datetime.datetime.utcnow
+
+import logging
+log = logging.getLogger( __name__ )
+
+metadata = MetaData()
+
+JobStateHistory_table = Table( "job_state_history", metadata,
+ Column( "id", Integer, primary_key=True ),
+ Column( "create_time", DateTime, default=now ),
+ Column( "update_time", DateTime, default=now, onupdate=now ),
+ Column( "job_id", Integer, ForeignKey( "job.id" ), index=True ),
+ Column( "state", String( 64 ), index=True ),
+ Column( "info", TrimmedString( 255 ) )
+)
+
+def upgrade(migrate_engine):
+ metadata.bind = migrate_engine
+ print __doc__
+ metadata.reflect()
+
+ try:
+ JobStateHistory_table.create()
+ except Exception as e:
+ print str(e)
+ log.exception("Creating %s table failed: %s" % (JobStateHistory_table.name, str( e ) ) )
+
+
+def downgrade(migrate_engine):
+ metadata.bind = migrate_engine
+ metadata.reflect()
+
+ try:
+ JobStateHistory_table.drop()
+ except Exception as e:
+ print str(e)
+ log.exception("Dropping %s table failed: %s" % (JobStateHistory_table.name, str( e ) ) )
https://bitbucket.org/galaxy/galaxy-central/commits/e47c67efeda7/
Changeset: e47c67efeda7
User: natefoo
Date: 2014-11-18 15:07:37+00:00
Summary: Ensure all job state changes will be added to the history state table.
Affected #: 6 files
diff -r 7c2c5f45c34f3c92e51e154c30472f2982a40271 -r e47c67efeda7fa66f9782aae5e2c62ab640310bc lib/galaxy/jobs/__init__.py
--- a/lib/galaxy/jobs/__init__.py
+++ b/lib/galaxy/jobs/__init__.py
@@ -956,7 +956,7 @@
dataset_assoc.dataset.dataset.state = dataset_assoc.dataset.dataset.states.PAUSED
dataset_assoc.dataset.info = message
self.sa_session.add( dataset_assoc.dataset )
- job.state = job.states.PAUSED
+ job.set_state( job.states.PAUSED )
self.sa_session.add( job )
def mark_as_resubmitted( self ):
@@ -965,7 +965,7 @@
for dataset in [ dataset_assoc.dataset for dataset_assoc in job.output_datasets + job.output_library_datasets ]:
dataset._state = model.Dataset.states.RESUBMITTED
self.sa_session.add( dataset )
- job.state = model.Job.states.RESUBMITTED
+ job.set_state( model.Job.states.RESUBMITTED )
self.sa_session.add( job )
self.sa_session.flush()
@@ -982,8 +982,6 @@
self.sa_session.flush()
if info:
job.info = info
- # FIXME:
- #job.state = state
job.set_state( state )
self.sa_session.add( job )
self.sa_session.flush()
diff -r 7c2c5f45c34f3c92e51e154c30472f2982a40271 -r e47c67efeda7fa66f9782aae5e2c62ab640310bc lib/galaxy/jobs/handler.py
--- a/lib/galaxy/jobs/handler.py
+++ b/lib/galaxy/jobs/handler.py
@@ -127,7 +127,7 @@
log.debug( "(%s) Job runner assigned but no external ID recorded, adding to the job handler queue" % job.id )
job.job_runner_name = None
if self.track_jobs_in_database:
- job.state = model.Job.states.NEW
+ job.set_state( model.Job.states.NEW )
else:
self.queue.put( ( job.id, job.tool_id ) )
elif job.job_runner_name is not None and job.job_runner_external_id is not None and job.destination_id is None:
@@ -143,7 +143,7 @@
# Never (fully) dispatched
log.debug( "(%s) No job runner assigned and job still in '%s' state, adding to the job handler queue" % ( job.id, job.state ) )
if self.track_jobs_in_database:
- job.state = model.Job.states.NEW
+ job.set_state( model.Job.states.NEW )
else:
self.queue.put( ( job.id, job.tool_id ) )
else:
@@ -286,7 +286,7 @@
log.info( "(%d) Job deleted by admin while still queued" % job.id )
elif job_state == JOB_USER_OVER_QUOTA:
log.info( "(%d) User (%s) is over quota: job paused" % ( job.id, job.user_id ) )
- job.state = model.Job.states.PAUSED
+ job.set_state( model.Job.states.PAUSED )
for dataset_assoc in job.output_datasets + job.output_library_datasets:
dataset_assoc.dataset.dataset.state = model.Dataset.states.PAUSED
dataset_assoc.dataset.info = "Execution of this dataset's job is paused because you were over your disk quota at the time it was ready to run"
diff -r 7c2c5f45c34f3c92e51e154c30472f2982a40271 -r e47c67efeda7fa66f9782aae5e2c62ab640310bc lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -473,15 +473,10 @@
self.post_job_actions.append( PostJobActionAssociation( pja, self ) )
def set_state( self, state ):
"""
- This is the only set method that performs extra work. In this case, the
- state is propagated down to datasets.
+ Save state history
"""
self.state = state
self.state_history.append( JobStateHistory( self ) )
- # For historical reasons state propogates down to datasets
- # FIXME: is this used anywhere?
- #for da in self.output_datasets:
- # da.dataset.state = state
def get_param_values( self, app, ignore_errors=False ):
"""
Read encoded parameter values from the database and turn back into a
@@ -556,7 +551,7 @@
return rval
def set_final_state( self, final_state ):
- self.state = final_state
+ self.set_state( final_state )
if self.workflow_invocation_step:
self.workflow_invocation_step.update()
diff -r 7c2c5f45c34f3c92e51e154c30472f2982a40271 -r e47c67efeda7fa66f9782aae5e2c62ab640310bc lib/galaxy/tools/actions/__init__.py
--- a/lib/galaxy/tools/actions/__init__.py
+++ b/lib/galaxy/tools/actions/__init__.py
@@ -377,7 +377,7 @@
assert GALAXY_URL is not None, "GALAXY_URL parameter missing in tool config."
redirect_url += "&GALAXY_URL=%s" % GALAXY_URL
# Job should not be queued, so set state to ok
- job.state = trans.app.model.Job.states.OK
+ job.set_state( trans.app.model.Job.states.OK )
job.info = "Redirected to: %s" % redirect_url
trans.sa_session.add( job )
trans.sa_session.flush()
diff -r 7c2c5f45c34f3c92e51e154c30472f2982a40271 -r e47c67efeda7fa66f9782aae5e2c62ab640310bc lib/galaxy/tools/actions/upload_common.py
--- a/lib/galaxy/tools/actions/upload_common.py
+++ b/lib/galaxy/tools/actions/upload_common.py
@@ -367,7 +367,7 @@
job.history_id = history.id
job.tool_id = tool.id
job.tool_version = tool.version
- job.state = job.states.UPLOAD
+ job.set_state( job.states.UPLOAD )
trans.sa_session.add( job )
trans.sa_session.flush()
log.info( 'tool %s created job id %d' % ( tool.id, job.id ) )
@@ -393,7 +393,7 @@
trans.sa_session.add( dataset )
# open( dataset.file_name, "w" ).close()
job.object_store_id = object_store_id
- job.state = job.states.NEW
+ job.set_state( job.states.NEW )
job.set_handler(tool.get_job_handler(None))
trans.sa_session.add( job )
trans.sa_session.flush()
diff -r 7c2c5f45c34f3c92e51e154c30472f2982a40271 -r e47c67efeda7fa66f9782aae5e2c62ab640310bc lib/galaxy/web/base/controllers/admin.py
--- a/lib/galaxy/web/base/controllers/admin.py
+++ b/lib/galaxy/web/base/controllers/admin.py
@@ -1084,7 +1084,7 @@
if trans.app.config.track_jobs_in_database:
job = trans.sa_session.query( trans.app.model.Job ).get( job_id )
job.stderr = error_msg
- job.state = trans.app.model.Job.states.DELETED_NEW
+ job.set_state( trans.app.model.Job.states.DELETED_NEW )
trans.sa_session.add( job )
else:
trans.app.job_manager.job_stop_queue.put( job_id, error_msg=error_msg )
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.
1
0
commit/galaxy-central: natefoo: Bug fix for exception handling of slurm runner's stderr parsing.
by commits-noreply@bitbucket.org 17 Nov '14
by commits-noreply@bitbucket.org 17 Nov '14
17 Nov '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/7c6c900abf1f/
Changeset: 7c6c900abf1f
User: natefoo
Date: 2014-11-17 18:28:16+00:00
Summary: Bug fix for exception handling of slurm runner's stderr parsing.
Affected #: 1 file
diff -r f3118a08d53254fa31eef53ac07ed21ba792192d -r 7c6c900abf1f2968dab4552b9e589b0ffe94cb69 lib/galaxy/jobs/runners/slurm.py
--- a/lib/galaxy/jobs/runners/slurm.py
+++ b/lib/galaxy/jobs/runners/slurm.py
@@ -110,6 +110,6 @@
if bof:
break
except:
- log.exception('Error reading end of %s:', path)
+ log.exception('Error reading end of %s:', efile_path)
return False
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.
1
0
commit/galaxy-central: dan: Log.debug the name of the galaxy.ini file currently being used.
by commits-noreply@bitbucket.org 17 Nov '14
by commits-noreply@bitbucket.org 17 Nov '14
17 Nov '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/f3118a08d532/
Changeset: f3118a08d532
User: dan
Date: 2014-11-17 17:37:39+00:00
Summary: Log.debug the name of the galaxy.ini file currently being used.
Affected #: 1 file
diff -r 101983f7d094d57ec442cf5661ba2a336eec83a6 -r f3118a08d53254fa31eef53ac07ed21ba792192d lib/galaxy/app.py
--- a/lib/galaxy/app.py
+++ b/lib/galaxy/app.py
@@ -43,6 +43,8 @@
# Setup the database engine and ORM
config_file = kwargs.get( 'global_conf', {} ).get( '__file__', None )
+ if config_file:
+ log.debug( 'Using "galaxy.ini" config file: %s', config_file )
check_migrate_tools = self.config.check_migrate_tools
self._configure_models( check_migrate_databases=True, check_migrate_tools=check_migrate_tools, config_file=config_file )
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.
1
0
commit/galaxy-central: dan: Fix for ToolParameter.to_dict when the html contains unicode.
by commits-noreply@bitbucket.org 17 Nov '14
by commits-noreply@bitbucket.org 17 Nov '14
17 Nov '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/101983f7d094/
Changeset: 101983f7d094
User: dan
Date: 2014-11-17 17:35:15+00:00
Summary: Fix for ToolParameter.to_dict when the html contains unicode.
Affected #: 1 file
diff -r 0134276d67f7a70d5e7afb7e876362c557044f86 -r 101983f7d094d57ec442cf5661ba2a336eec83a6 lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -195,7 +195,7 @@
tool_dict = super( ToolParameter, self ).to_dict()
#TODO: wrapping html as it causes a lot of errors on subclasses - needs histories, etc.
try:
- tool_dict[ 'html' ] = urllib.quote( self.get_html( trans ) )
+ tool_dict[ 'html' ] = urllib.quote( util.smart_str( self.get_html( trans ) ) )
except AssertionError, e:
pass #HACK for assert trans.history, 'requires a history'
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.
1
0
commit/galaxy-central: jmchilton: Modify Docker set_user option to allow setting a remote user.
by commits-noreply@bitbucket.org 17 Nov '14
by commits-noreply@bitbucket.org 17 Nov '14
17 Nov '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/0134276d67f7/
Changeset: 0134276d67f7
User: jmchilton
Date: 2014-11-17 17:16:12+00:00
Summary: Modify Docker set_user option to allow setting a remote user.
Now is disabled by setting this to the empty string instead of false. Add flexibility allows working around the fact that it is not evaluated properly for Pulsar by setting this to be the remote pulsar user :(. Longer term the default option should be the remote user on the worker node instead of the Galaxy user.
I don't believe this feature has been in stable so I am not preserving backward compatiblity.
Affected #: 3 files
diff -r a1aa1dbc8cb6249b4ca39f0e4cda500abcafae82 -r 0134276d67f7a70d5e7afb7e876362c557044f86 config/job_conf.xml.sample_advanced
--- a/config/job_conf.xml.sample_advanced
+++ b/config/job_conf.xml.sample_advanced
@@ -199,7 +199,11 @@
will be removed automatically after the program is complete.
--><!-- <param id="docker_auto_rm">true</param> -->
- <!-- <param id="docker_set_user">true</param> -->
+ <!-- Override which user to launch Docker container as - defaults to
+ Galaxy's user id. For remote job execution (e.g. Pulsar) set to
+ remote job user. Leave empty to not use the -u argument with
+ Docker. -->
+ <!-- <param id="docker_set_user">$UID</param> --><!-- Following command can be used to tweak docker command. --><!-- <param id="docker_cmd">/usr/local/custom_docker/docker</param> --><!-- Following can be used to connect to docke server in different
diff -r a1aa1dbc8cb6249b4ca39f0e4cda500abcafae82 -r 0134276d67f7a70d5e7afb7e876362c557044f86 lib/galaxy/tools/deps/containers.py
--- a/lib/galaxy/tools/deps/containers.py
+++ b/lib/galaxy/tools/deps/containers.py
@@ -244,7 +244,7 @@
working_directory=working_directory,
net=prop("net", "none"), # By default, docker instance has networking disabled
auto_rm=asbool(prop("auto_rm", docker_util.DEFAULT_AUTO_REMOVE)),
- set_user=asbool(prop("set_user", docker_util.DEFAULT_SET_USER)),
+ set_user=prop("set_user", docker_util.DEFAULT_SET_USER),
**docker_host_props
)
return "%s\n%s" % (cache_command, run_command)
diff -r a1aa1dbc8cb6249b4ca39f0e4cda500abcafae82 -r 0134276d67f7a70d5e7afb7e876362c557044f86 lib/galaxy/tools/deps/docker_util.py
--- a/lib/galaxy/tools/deps/docker_util.py
+++ b/lib/galaxy/tools/deps/docker_util.py
@@ -10,7 +10,7 @@
DEFAULT_MEMORY = None
DEFAULT_VOLUMES_FROM = None
DEFAULT_AUTO_REMOVE = True
-DEFAULT_SET_USER = True
+DEFAULT_SET_USER = "$UID"
class DockerVolume(object):
@@ -149,7 +149,10 @@
if auto_rm:
command_parts.append("--rm")
if set_user:
- command_parts.extend(["-u", str(os.geteuid())])
+ user = set_user
+ if set_user == DEFAULT_SET_USER:
+ user = str(os.geteuid())
+ command_parts.extend(["-u", user])
full_image = image
if tag:
full_image = "%s:%s" % (full_image, tag)
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.
1
0
[galaxyproject/usegalaxy-playbook] 665492: Allocate 16 GB for an additional set of tools (mos...
by GitHub 17 Nov '14
by GitHub 17 Nov '14
17 Nov '14
Branch: refs/heads/master
Home: https://github.com/galaxyproject/usegalaxy-playbook
Commit: 665492ca686525339ee573eb379387c7ad649199
https://github.com/galaxyproject/usegalaxy-playbook/commit/665492ca68652533…
Author: Nate Coraor <nate(a)bx.psu.edu>
Date: 2014-11-17 (Mon, 17 Nov 2014)
Changed paths:
M templates/galaxy/usegalaxy.org/config/job_conf.xml.j2
Log Message:
-----------
Allocate 16 GB for an additional set of tools (mostly GATK).
1
0
17 Nov '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a1aa1dbc8cb6/
Changeset: a1aa1dbc8cb6
User: jmchilton
Date: 2014-11-17 15:40:51+00:00
Summary: Merge stable.
Affected #: 7 files
diff -r a4f509eb288327415a231c83a79a7aa324d5fe4f -r a1aa1dbc8cb6249b4ca39f0e4cda500abcafae82 .hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -20,4 +20,4 @@
ca45b78adb4152fc6e7395514d46eba6b7d0b838 release_2014.08.11
548ab24667d6206780237bd807f7d857a484c461 latest_2014.08.11
2092948937ac30ef82f71463a235c66d34987088 release_2014.10.06
-a1dca14d5b1afbf2b5bde192e3e6b6763836eff8 latest_2014.10.06
+011c8b2118be778eaf1ba952730ff876d6447ba9 latest_2014.10.06
diff -r a4f509eb288327415a231c83a79a7aa324d5fe4f -r a1aa1dbc8cb6249b4ca39f0e4cda500abcafae82 client/galaxy/scripts/mvc/citation/citation-view.js
--- a/client/galaxy/scripts/mvc/citation/citation-view.js
+++ b/client/galaxy/scripts/mvc/citation/citation-view.js
@@ -58,11 +58,11 @@
var doiUrl = "";
if( fields.doi ) {
doiUrl = 'http://dx.doi.org/' + fields.doi;
- ref += '[<a href="' + doiUrl + '">doi:' + fields.doi + "</a>]";
+ ref += '[<a href="' + doiUrl + '" target="_blank">doi:' + fields.doi + "</a>]";
}
var url = fields.url || doiUrl;
if( url ) {
- ref += '[<a href="' + url + '">Link</a>]';
+ ref += '[<a href="' + url + '" target="_blank">Link</a>]';
}
return ref;
},
@@ -185,4 +185,4 @@
CitationListView : CitationListView
};
-});
\ No newline at end of file
+});
diff -r a4f509eb288327415a231c83a79a7aa324d5fe4f -r a1aa1dbc8cb6249b4ca39f0e4cda500abcafae82 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -2615,14 +2615,20 @@
history = None
value = input.test_param.get_initial_value( trans, context, history=history )
current_case = input.get_current_case( value, trans )
- if current_case != old_current_case:
+ case_changed = current_case != old_current_case
+ if case_changed:
# Current case has changed, throw away old state
group_state = state[input.name] = {}
# TODO: we should try to preserve values if we can
self.fill_in_new_state( trans, input.cases[current_case].inputs, group_state, context )
group_errors = dict()
group_old_errors = dict()
- else:
+
+ # If we didn't just change the current case and are coming from HTML - the values
+ # in incoming represent the old values and should not be replaced. If being updated
+ # from the API (json) instead of HTML - form values below the current case
+ # may also be supplied and incoming should be preferred to case defaults.
+ if (not case_changed) or (source != "html"):
# Current case has not changed, update children
group_errors = self.update_state( trans,
input.cases[current_case].inputs,
diff -r a4f509eb288327415a231c83a79a7aa324d5fe4f -r a1aa1dbc8cb6249b4ca39f0e4cda500abcafae82 lib/galaxy/workflow/modules.py
--- a/lib/galaxy/workflow/modules.py
+++ b/lib/galaxy/workflow/modules.py
@@ -727,7 +727,7 @@
old_errors = state.inputs.pop( "__errors__", {} )
# Update the state
step_errors = tool.update_state( trans, tool.inputs, state.inputs, step_updates,
- update_only=True, old_errors=old_errors )
+ update_only=True, old_errors=old_errors, source="json" )
return state, step_errors
def execute( self, trans, progress, invocation, step ):
diff -r a4f509eb288327415a231c83a79a7aa324d5fe4f -r a1aa1dbc8cb6249b4ca39f0e4cda500abcafae82 lib/galaxy/workflow/run_request.py
--- a/lib/galaxy/workflow/run_request.py
+++ b/lib/galaxy/workflow/run_request.py
@@ -117,7 +117,32 @@
param_dict[param_dict['param']] = param_dict['value']
del param_dict[ 'param' ]
del param_dict[ 'value' ]
- return param_dict
+ # Inputs can be nested dict, but Galaxy tool code wants nesting of keys (e.g.
+ # cond1|moo=4 instead of cond1: {moo: 4} ).
+ new_params = _flatten_step_params( param_dict )
+ return new_params
+
+
+def _flatten_step_params( param_dict, prefix="" ):
+ # TODO: Temporary work around until tool code can process nested data
+ # structures. This should really happen in there so the tools API gets
+ # this functionality for free and so that repeats can be handled
+ # properly. Also the tool code walks the tool inputs so it nows what is
+ # a complex value object versus something that maps to child parameters
+ # better than the hack or searching for src and id here.
+ new_params = {}
+ keys = param_dict.keys()[:]
+ for key in keys:
+ if prefix:
+ effective_key = "%s|%s" % ( prefix, key )
+ else:
+ effective_key = key
+ value = param_dict[key]
+ if isinstance(value, dict) and not ('src' in value and 'id' in value):
+ new_params.update(_flatten_step_params( value, effective_key) )
+ else:
+ new_params[effective_key] = value
+ return new_params
def build_workflow_run_config( trans, workflow, payload ):
diff -r a4f509eb288327415a231c83a79a7aa324d5fe4f -r a1aa1dbc8cb6249b4ca39f0e4cda500abcafae82 static/scripts/mvc/citation/citation-view.js
--- a/static/scripts/mvc/citation/citation-view.js
+++ b/static/scripts/mvc/citation/citation-view.js
@@ -58,11 +58,11 @@
var doiUrl = "";
if( fields.doi ) {
doiUrl = 'http://dx.doi.org/' + fields.doi;
- ref += '[<a href="' + doiUrl + '">doi:' + fields.doi + "</a>]";
+ ref += '[<a href="' + doiUrl + '" target="_blank">doi:' + fields.doi + "</a>]";
}
var url = fields.url || doiUrl;
if( url ) {
- ref += '[<a href="' + url + '">Link</a>]';
+ ref += '[<a href="' + url + '" target="_blank">Link</a>]';
}
return ref;
},
@@ -185,4 +185,4 @@
CitationListView : CitationListView
};
-});
\ No newline at end of file
+});
diff -r a4f509eb288327415a231c83a79a7aa324d5fe4f -r a1aa1dbc8cb6249b4ca39f0e4cda500abcafae82 static/scripts/packed/mvc/citation/citation-view.js
--- a/static/scripts/packed/mvc/citation/citation-view.js
+++ b/static/scripts/packed/mvc/citation/citation-view.js
@@ -1,1 +1,1 @@
-define(["mvc/base-mvc","mvc/citation/citation-model","utils/localization"],function(a,d,c){var b=Backbone.View.extend({tagName:"div",className:"citations",render:function(){this.$el.append("<p>"+this.formattedReference()+"</p>");return this},formattedReference:function(){var k=this.model;var i=k.entryType();var l=k.fields();var g="";var o=this._asSentence((l.author?l.author:"")+(l.year?(" ("+l.year+")"):""))+" ";var n=l.title||"";var h=l.pages?("pp. "+l.pages):"";var p=l.address;if(i=="article"){var j=(l.volume?l.volume:"")+(l.number?(" ("+l.number+")"):"")+(h?", "+h:"");g=o+this._asSentence(n)+(l.journal?("In <em>"+l.journal+", "):"")+this._asSentence(j)+this._asSentence(l.address)+"</em>"}else{if(i=="inproceedings"||i=="proceedings"){g=o+this._asSentence(n)+(l.booktitle?("In <em>"+l.booktitle+", "):"")+(h?h:"")+(p?", "+p:"")+".</em>"}else{if(i=="mastersthesis"||i=="phdthesis"){g=o+this._asSentence(n)+(l.howpublished?l.howpublished+". ":"")+(l.note?l.note+".":"")}else{if(i=="techreport"){g=o+this._asSentence(n)+this._asSentence(l.institution)+this._asSentence(l.number)+this._asSentence(l.type)}else{if(i=="book"||i=="inbook"||i=="incollection"){g=o+" "+this._formatBookInfo(l)}else{g=o+" "+this._asSentence(n)+this._asSentence(l.howpublished)+this._asSentence(l.note)}}}}}var m="";if(l.doi){m="http://dx.doi.org/"+l.doi;g+='[<a href="'+m+'">doi:'+l.doi+"</a>]"}var f=l.url||m;if(f){g+='[<a href="'+f+'">Link</a>]'}return g},_formatBookInfo:function(f){var g="";if(f.chapter){g+=f.chapter+" in "}if(f.title){g+="<em>"+f.title+"</em>"}if(f.editor){g+=", Edited by "+f.editor+", "}if(f.publisher){g+=", "+f.publisher}if(f.pages){g+=", pp. "+f.pages+""}if(f.series){g+=", <em>"+f.series+"</em>"}if(f.volume){g+=", Vol."+f.volume}if(f.issn){g+=", ISBN: "+f.issn}return g+"."},_asSentence:function(f){return(f&&f.trim())?f+". ":""}});var e=Backbone.View.extend({el:"#citations",initialize:function(){this.listenTo(this.collection,"add",this.renderCitation)},events:{"click .citations-to-bibtex":"showBibtex","click .citations-to-formatted":"showFormatted"},renderCitation:function(g){var f=new b({model:g});this.$(".citations-formatted").append(f.render().el);var h=this.$(".citations-bibtex-text");h.val(h.val()+"\n\r"+g.attributes.content)},render:function(){this.$el.html(this.citationsElement());this.collection.each(function(f){this.renderCitation(f)},this);this.showFormatted()},showBibtex:function(){this.$(".citations-to-formatted").show();this.$(".citations-to-bibtex").hide();this.$(".citations-bibtex").show();this.$(".citations-formatted").hide();this.$(".citations-bibtex-text").select()},showFormatted:function(){this.$(".citations-to-formatted").hide();this.$(".citations-to-bibtex").show();this.$(".citations-bibtex").hide();this.$(".citations-formatted").show()},partialWarningElement:function(){if(this.collection.partial){return['<div style="padding:5px 10px">',"<b>Warning: This is a experimental feature.</b> Most Galaxy tools will not annotate"," citations explicitly at this time. When writing up your analysis, please manually"," review your histories and find all references"," that should be cited in order to completely describe your work. Also, please remember to",' <a href="https://wiki.galaxyproject.org/CitingGalaxy">cite Galaxy</a>.',"</div>",].join("")}else{return""}},citationsElement:function(){return['<div class="toolForm">','<div class="toolFormTitle">',c("Citations"),' <i class="fa fa-pencil-square-o citations-to-bibtex" title="Select all as BibTeX."></i>',' <i class="fa fa-times citations-to-formatted" title="Return to formatted citation list."></i>',"</div>",'<div class="toolFormBody" style="padding:5px 10px">',this.partialWarningElement(),'<span class="citations-formatted"></span>',"</div>",'<div class="citations-bibtex toolFormBody" style="padding:5px 10px">','<textarea style="width: 100%; height: 500px;" class="citations-bibtex-text"></textarea>',"</div>","</div>"].join("")}});return{CitationView:b,CitationListView:e}});
\ No newline at end of file
+define(["mvc/base-mvc","mvc/citation/citation-model","utils/localization"],function(a,d,c){var b=Backbone.View.extend({tagName:"div",className:"citations",render:function(){this.$el.append("<p>"+this.formattedReference()+"</p>");return this},formattedReference:function(){var k=this.model;var i=k.entryType();var l=k.fields();var g="";var o=this._asSentence((l.author?l.author:"")+(l.year?(" ("+l.year+")"):""))+" ";var n=l.title||"";var h=l.pages?("pp. "+l.pages):"";var p=l.address;if(i=="article"){var j=(l.volume?l.volume:"")+(l.number?(" ("+l.number+")"):"")+(h?", "+h:"");g=o+this._asSentence(n)+(l.journal?("In <em>"+l.journal+", "):"")+this._asSentence(j)+this._asSentence(l.address)+"</em>"}else{if(i=="inproceedings"||i=="proceedings"){g=o+this._asSentence(n)+(l.booktitle?("In <em>"+l.booktitle+", "):"")+(h?h:"")+(p?", "+p:"")+".</em>"}else{if(i=="mastersthesis"||i=="phdthesis"){g=o+this._asSentence(n)+(l.howpublished?l.howpublished+". ":"")+(l.note?l.note+".":"")}else{if(i=="techreport"){g=o+this._asSentence(n)+this._asSentence(l.institution)+this._asSentence(l.number)+this._asSentence(l.type)}else{if(i=="book"||i=="inbook"||i=="incollection"){g=o+" "+this._formatBookInfo(l)}else{g=o+" "+this._asSentence(n)+this._asSentence(l.howpublished)+this._asSentence(l.note)}}}}}var m="";if(l.doi){m="http://dx.doi.org/"+l.doi;g+='[<a href="'+m+'" target="_blank">doi:'+l.doi+"</a>]"}var f=l.url||m;if(f){g+='[<a href="'+f+'" target="_blank">Link</a>]'}return g},_formatBookInfo:function(f){var g="";if(f.chapter){g+=f.chapter+" in "}if(f.title){g+="<em>"+f.title+"</em>"}if(f.editor){g+=", Edited by "+f.editor+", "}if(f.publisher){g+=", "+f.publisher}if(f.pages){g+=", pp. "+f.pages+""}if(f.series){g+=", <em>"+f.series+"</em>"}if(f.volume){g+=", Vol."+f.volume}if(f.issn){g+=", ISBN: "+f.issn}return g+"."},_asSentence:function(f){return(f&&f.trim())?f+". ":""}});var e=Backbone.View.extend({el:"#citations",initialize:function(){this.listenTo(this.collection,"add",this.renderCitation)},events:{"click .citations-to-bibtex":"showBibtex","click .citations-to-formatted":"showFormatted"},renderCitation:function(g){var f=new b({model:g});this.$(".citations-formatted").append(f.render().el);var h=this.$(".citations-bibtex-text");h.val(h.val()+"\n\r"+g.attributes.content)},render:function(){this.$el.html(this.citationsElement());this.collection.each(function(f){this.renderCitation(f)},this);this.showFormatted()},showBibtex:function(){this.$(".citations-to-formatted").show();this.$(".citations-to-bibtex").hide();this.$(".citations-bibtex").show();this.$(".citations-formatted").hide();this.$(".citations-bibtex-text").select()},showFormatted:function(){this.$(".citations-to-formatted").hide();this.$(".citations-to-bibtex").show();this.$(".citations-bibtex").hide();this.$(".citations-formatted").show()},partialWarningElement:function(){if(this.collection.partial){return['<div style="padding:5px 10px">',"<b>Warning: This is a experimental feature.</b> Most Galaxy tools will not annotate"," citations explicitly at this time. When writing up your analysis, please manually"," review your histories and find all references"," that should be cited in order to completely describe your work. Also, please remember to",' <a href="https://wiki.galaxyproject.org/CitingGalaxy">cite Galaxy</a>.',"</div>",].join("")}else{return""}},citationsElement:function(){return['<div class="toolForm">','<div class="toolFormTitle">',c("Citations"),' <i class="fa fa-pencil-square-o citations-to-bibtex" title="Select all as BibTeX."></i>',' <i class="fa fa-times citations-to-formatted" title="Return to formatted citation list."></i>',"</div>",'<div class="toolFormBody" style="padding:5px 10px">',this.partialWarningElement(),'<span class="citations-formatted"></span>',"</div>",'<div class="citations-bibtex toolFormBody" style="padding:5px 10px">','<textarea style="width: 100%; height: 500px;" class="citations-bibtex-text"></textarea>',"</div>","</div>"].join("")}});return{CitationView:b,CitationListView:e}});
\ No newline at end of file
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.
1
0