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
February 2015
- 2 participants
- 305 discussions
3 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/2248c4d82151/
Changeset: 2248c4d82151
Branch: stable
User: jmchilton
Date: 2015-02-05 17:14:01+00:00
Summary: Workflow scheduling delay fix.
There were problems if all three of these conditions were met - 1) workflow from GUI, 2) workflow evaluation delayed, and 3) a delayed step was connected to a input dataset. This fixes these workflows.
Affected #: 3 files
diff -r 097bbb3b7d3246faaa5188a1fc2a79b01630025c -r 2248c4d82151c928a7615f9335b55aa0c55c9446 lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -3202,6 +3202,27 @@
def update( self ):
self.update_time = galaxy.model.orm.now.now()
+ def add_input( self, content, step_id ):
+ if content.history_content_type == "dataset":
+ request_to_content = WorkflowRequestToInputDatasetAssociation()
+ request_to_content.dataset = content
+ request_to_content.workflow_step_id = step_id
+ self.input_datasets.append( request_to_content )
+ else:
+ request_to_content = WorkflowRequestToInputDatasetCollectionAssociation()
+ request_to_content.dataset_collection = content
+ request_to_content.workflow_step_id = step_id
+ self.input_dataset_collections.append( request_to_content )
+
+ def has_input_for_step( self, step_id ):
+ for content in self.input_datasets:
+ if content.workflow_step_id == step_id:
+ return True
+ for content in self.input_dataset_collections:
+ if content.workflow_step_id == step_id:
+ return True
+ return False
+
class WorkflowInvocationStep( object, Dictifiable ):
dict_collection_visible_keys = ( 'id', 'update_time', 'job_id', 'workflow_step_id', 'action' )
diff -r 097bbb3b7d3246faaa5188a1fc2a79b01630025c -r 2248c4d82151c928a7615f9335b55aa0c55c9446 lib/galaxy/workflow/modules.py
--- a/lib/galaxy/workflow/modules.py
+++ b/lib/galaxy/workflow/modules.py
@@ -320,6 +320,11 @@
step_outputs[ 'input_ds_copy' ] = new_hdca
else:
raise Exception("Unknown history content encountered")
+ # If coming from UI - we haven't registered invocation inputs yet,
+ # so do that now so dependent steps can be recalculated. In the future
+ # everything should come in from the API and this can be eliminated.
+ if not invocation.has_input_for_step( step.id ):
+ invocation.add_input( step_outputs.values()[ 0 ], step.id )
progress.set_outputs_for_input( step, step_outputs )
return job
diff -r 097bbb3b7d3246faaa5188a1fc2a79b01630025c -r 2248c4d82151c928a7615f9335b55aa0c55c9446 lib/galaxy/workflow/run_request.py
--- a/lib/galaxy/workflow/run_request.py
+++ b/lib/galaxy/workflow/run_request.py
@@ -284,18 +284,8 @@
value=value,
type=param_types.REPLACEMENT_PARAMETERS,
)
-
for step_id, content in run_config.inputs.iteritems():
- if content.history_content_type == "dataset":
- request_to_content = model.WorkflowRequestToInputDatasetAssociation()
- request_to_content.dataset = content
- request_to_content.workflow_step_id = step_id
- workflow_invocation.input_datasets.append( request_to_content )
- else:
- request_to_content = model.WorkflowRequestToInputDatasetCollectionAssociation()
- request_to_content.dataset_collection = content
- request_to_content.workflow_step_id = step_id
- workflow_invocation.input_dataset_collections.append( request_to_content )
+ workflow_invocation.add_input( content, step_id )
for step in workflow.steps:
state = step.state
https://bitbucket.org/galaxy/galaxy-central/commits/e07163fe8bdb/
Changeset: e07163fe8bdb
Branch: stable
User: jmchilton
Date: 2015-02-05 17:14:01+00:00
Summary: Fix scheduling_manager.py for unknown attribute reference.
Not sure if this was a poor rebasing or a copy and paste error.
Affected #: 1 file
diff -r 2248c4d82151c928a7615f9335b55aa0c55c9446 -r e07163fe8bdbc3e85f48b308ed293c46578b3294 lib/galaxy/workflow/scheduling_manager.py
--- a/lib/galaxy/workflow/scheduling_manager.py
+++ b/lib/galaxy/workflow/scheduling_manager.py
@@ -116,7 +116,6 @@
for plugin_element in plugins_element.getchildren():
plugin_type = plugin_element.tag
plugin_kwds = dict( plugin_element.items() )
- plugin_kwds.update( self.extra_kwargs )
workflow_scheduler_id = plugin_kwds.get( 'id', None )
self.__init_plugin( plugin_type, workflow_scheduler_id, **plugin_kwds )
https://bitbucket.org/galaxy/galaxy-central/commits/644deef1a578/
Changeset: 644deef1a578
Branch: stable
User: jmchilton
Date: 2015-02-05 18:33:59+00:00
Summary: Bugfix for bugfix d3b1f6b.
d3b1f6b fix the GUI (in an obsecure use) but broke fairly typical uses of the API.
Affected #: 1 file
diff -r e07163fe8bdbc3e85f48b308ed293c46578b3294 -r 644deef1a5789b788552a6db7f3d6fe07d81c79d lib/galaxy/workflow/modules.py
--- a/lib/galaxy/workflow/modules.py
+++ b/lib/galaxy/workflow/modules.py
@@ -324,7 +324,9 @@
# so do that now so dependent steps can be recalculated. In the future
# everything should come in from the API and this can be eliminated.
if not invocation.has_input_for_step( step.id ):
- invocation.add_input( step_outputs.values()[ 0 ], step.id )
+ content = step_outputs.values()[ 0 ]
+ if content:
+ invocation.add_input( content, step.id )
progress.set_outputs_for_input( step, step_outputs )
return job
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] f0c67a: make toolform fancy again; update mutable configs
by GitHub 05 Feb '15
by GitHub 05 Feb '15
05 Feb '15
Branch: refs/heads/master
Home: https://github.com/galaxyproject/usegalaxy-playbook
Commit: f0c67a17684293e648e79eb1dae8c8116aed4e22
https://github.com/galaxyproject/usegalaxy-playbook/commit/f0c67a17684293e6…
Author: martenson <cech.marten(a)gmail.com>
Date: 2015-02-05 (Thu, 05 Feb 2015)
Changed paths:
M files/galaxy/test.galaxyproject.org/var/integrated_tool_panel.xml
M files/galaxy/test.galaxyproject.org/var/shed_tool_conf.xml
M stage/group_vars/galaxyservers.yml
Log Message:
-----------
make toolform fancy again; update mutable configs
1
0
commit/galaxy-central: guerler: ToolForm: Update version selection, use underscores for internal parameters
by commits-noreply@bitbucket.org 05 Feb '15
by commits-noreply@bitbucket.org 05 Feb '15
05 Feb '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/494418e72cf0/
Changeset: 494418e72cf0
User: guerler
Date: 2015-02-05 18:34:51+00:00
Summary: ToolForm: Update version selection, use underscores for internal parameters
Affected #: 12 files
diff -r ff2b00fcbd70e3d7ce10b0444412cc68d2ede46f -r 494418e72cf0007e909c7f4b9134cd2b82df49e2 client/galaxy/scripts/mvc/tools/tools-form-base.js
--- a/client/galaxy/scripts/mvc/tools/tools-form-base.js
+++ b/client/galaxy/scripts/mvc/tools/tools-form-base.js
@@ -15,12 +15,10 @@
this.optionsDefault = {
// uses dynamic fields instead of text fields
is_dynamic : true,
- // shows form in compact view mode
- compact : false,
+ // shows form in narrow view mode
+ narrow : false,
// shows errors on start
- initial_errors : false,
- // use default value for disabled fields
- use_defaults : false
+ initial_errors : false
};
// configure options
@@ -58,9 +56,66 @@
$(this.container).append(this.$el);
// build this form
- this._buildForm();
+ this.build(this.options);
},
+ /** Main tool form build function. This function is called once a new model is available.
+ */
+ build: function(options) {
+ // link this
+ var self = this;
+
+ // reset events
+ this.off('refresh');
+ this.off('reset');
+
+ // reset field list, which contains the input field elements
+ this.field_list = {};
+
+ // reset sequential input definition list, which contains the input definitions as provided from the api
+ this.input_list = {};
+
+ // reset input element list, which contains the dom elements of each input element (includes also the input field)
+ this.element_list = {};
+
+ // creates a tree/json data structure from the input form
+ this.tree = new ToolTree(this);
+
+ // request history content and build form
+ this.content = new ToolContent(this);
+
+ // update model data
+ self.options.inputs = options && options.inputs;
+
+ // create ui elements
+ this._renderForm(options);
+
+ // rebuild the underlying data structure
+ this.tree.finalize();
+
+ // show errors on startup
+ if (options.initial_errors) {
+ this._errors(options);
+ }
+
+ // add refresh listener
+ this.on('refresh', function() {
+ // by using/resetting the deferred ajax queue the number of redundant calls is reduced
+ self.deferred.reset();
+ self.deferred.execute(function(){self._updateModel()});
+ });
+
+ // add reset listener
+ this.on('reset', function() {
+ for (var i in this.element_list) {
+ this.element_list[i].reset();
+ }
+ });
+
+ // refresh
+ this.trigger('refresh');
+ },
+
/** Shows the final message (usually upon successful job submission)
*/
reciept: function($el) {
@@ -105,63 +160,6 @@
}
}
},
-
- /** Main tool form build function. This function is called once a new model is available.
- */
- _buildForm: function() {
- // link this
- var self = this;
-
- // reset events
- this.off('refresh');
- this.off('reset');
-
- // reset field list, which contains the input field elements
- this.field_list = {};
-
- // reset sequential input definition list, which contains the input definitions as provided from the api
- this.input_list = {};
-
- // reset input element list, which contains the dom elements of each input element (includes also the input field)
- this.element_list = {};
-
- // creates a tree/json data structure from the input form
- this.tree = new ToolTree(this);
-
- // request history content and build form
- this.content = new ToolContent(this);
-
- // link model options
- var options = this.options;
-
- // create ui elements
- this._renderForm(options);
-
- // rebuild the underlying data structure
- this.tree.finalize();
-
- // show errors on startup
- if (options.initial_errors) {
- this._errors(options);
- }
-
- // add refresh listener
- this.on('refresh', function() {
- // by using/resetting the deferred ajax queue the number of redundant calls is reduced
- self.deferred.reset();
- self.deferred.execute(function(){self._updateModel()});
- });
-
- // add reset listener
- this.on('reset', function() {
- for (var i in this.element_list) {
- this.element_list[i].reset();
- }
- });
-
- // refresh
- this.trigger('refresh');
- },
/** Renders the UI elements required for the form
*/
@@ -175,7 +173,7 @@
// button for version selection
var requirements_button = new Ui.ButtonIcon({
icon : 'fa-info-circle',
- title : (!options.compact && 'Requirements') || null,
+ title : (!options.narrow && 'Requirements') || null,
tooltip : 'Display tool requirements',
onclick : function() {
if (!this.visible) {
@@ -200,7 +198,7 @@
// button for version selection
var versions_button = new Ui.ButtonMenu({
icon : 'fa-cubes',
- title : (!options.compact && 'Versions') || null,
+ title : (!options.narrow && 'Versions') || null,
tooltip : 'Select another tool version'
});
if (options.versions && options.versions.length > 1) {
@@ -213,8 +211,8 @@
icon : 'fa-cube',
onclick : function() {
// here we update the tool version (some tools encode the version also in the id)
- options.id = options.id.replace(options.version, this.version);
- options.version = this.version;
+ self.options.id = self.options.id.replace(self.options.version, this.version);
+ self.options.version = this.version;
// rebuild the model and form
self.deferred.reset();
@@ -230,7 +228,7 @@
// button menu
var menu_button = new Ui.ButtonMenu({
icon : 'fa-caret-down',
- title : (!options.compact && 'Options') || null,
+ title : (!options.narrow && 'Options') || null,
tooltip : 'View available options'
});
@@ -306,7 +304,7 @@
});
// remove padding
- if (options.compact) {
+ if (options.narrow) {
this.portlet.$content.css('padding', '0px');
}
diff -r ff2b00fcbd70e3d7ce10b0444412cc68d2ede46f -r 494418e72cf0007e909c7f4b9134cd2b82df49e2 client/galaxy/scripts/mvc/tools/tools-form-workflow.js
--- a/client/galaxy/scripts/mvc/tools/tools-form-workflow.js
+++ b/client/galaxy/scripts/mvc/tools/tools-form-workflow.js
@@ -21,9 +21,13 @@
this.options = options;
// set labels
- this.options.text_enable = 'In Advance';
- this.options.text_disable = 'At Runtime';
- this.options.use_defaults = true;
+ this.options.text_enable = 'In Advance';
+ this.options.text_disable = 'At Runtime';
+
+ // configure workflow style
+ this.options.is_dynamic = false;
+ this.options.narrow = true;
+ this.options.initial_errors = true;
// declare fields as optional
Utils.deepeach(options.inputs, function(item) {
diff -r ff2b00fcbd70e3d7ce10b0444412cc68d2ede46f -r 494418e72cf0007e909c7f4b9134cd2b82df49e2 client/galaxy/scripts/mvc/tools/tools-form.js
--- a/client/galaxy/scripts/mvc/tools/tools-form.js
+++ b/client/galaxy/scripts/mvc/tools/tools-form.js
@@ -24,7 +24,7 @@
}
ToolFormBase.prototype.initialize.call(this, options);
},
-
+
/** Builds a new model through api call and recreates the entire form
*/
_buildModel: function() {
@@ -47,31 +47,28 @@
}
}
}
-
+
// register process
var process_id = this.deferred.register();
-
+
// get initial model
Utils.request({
type : 'GET',
url : model_url,
success : function(response) {
- // link model data update options
- self.options = response;
-
- // build form
- self._buildForm();
-
+ // build new tool form
+ self.build(response);
+
// notification
self.message.update({
status : 'success',
message : 'Now you are using \'' + self.options.name + '\' version ' + self.options.version + '.',
persistent : false
});
-
+
// process completed
self.deferred.done(process_id);
-
+
// log success
console.debug('tools-form::initialize() - Initial tool model ready.');
console.debug(response);
@@ -79,11 +76,11 @@
error : function(response) {
// process completed
self.deferred.done(process_id);
-
+
// log error
console.debug('tools-form::initialize() - Initial tool model request failed.');
console.debug(response);
-
+
// show error
var error_message = response.error || 'Uncaught error.';
self.modal.show({
@@ -98,7 +95,7 @@
}
});
},
-
+
/** Request a new model for an already created tool form and updates the form inputs
*/
_updateModel: function() {
@@ -112,11 +109,11 @@
return null;
}
});
-
+
// log tool state
console.debug('tools-form::_refreshForm() - Refreshing states.');
console.debug(current_state);
-
+
// activates/disables spinner for dynamic fields to indicate that they are currently being updated
function wait(active) {
for (var i in self.input_list) {
@@ -131,10 +128,10 @@
}
}
}
-
+
// set wait mode
wait(true);
-
+
// register process
var process_id = this.deferred.register();
@@ -179,13 +176,13 @@
}
}
});
-
+
// unset wait mode
wait(false);
-
+
// process completed
self.deferred.done(process_id);
-
+
// log success
console.debug('tools-form::_refreshForm() - States refreshed.');
console.debug(new_model);
@@ -193,7 +190,7 @@
error : function(response) {
// process completed
self.deferred.done(process_id);
-
+
// log error
console.debug('tools-form::_refreshForm() - Refresh request failed.');
console.debug(response);
diff -r ff2b00fcbd70e3d7ce10b0444412cc68d2ede46f -r 494418e72cf0007e909c7f4b9134cd2b82df49e2 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -2254,8 +2254,8 @@
"""
Recursively creates a tool dictionary containing repeats, dynamic options and updated states.
"""
- job_id = kwd.get('job_id', None)
- dataset_id = kwd.get('dataset_id', None)
+ job_id = kwd.get('__job_id__', None)
+ dataset_id = kwd.get('__dataset_id__', None)
is_dynamic = string_as_bool(kwd.get('__is_dynamic__', True))
# load job details if provided
diff -r ff2b00fcbd70e3d7ce10b0444412cc68d2ede46f -r 494418e72cf0007e909c7f4b9134cd2b82df49e2 static/scripts/mvc/tools/tools-form-base.js
--- a/static/scripts/mvc/tools/tools-form-base.js
+++ b/static/scripts/mvc/tools/tools-form-base.js
@@ -15,12 +15,10 @@
this.optionsDefault = {
// uses dynamic fields instead of text fields
is_dynamic : true,
- // shows form in compact view mode
- compact : false,
+ // shows form in narrow view mode
+ narrow : false,
// shows errors on start
- initial_errors : false,
- // use default value for disabled fields
- use_defaults : false
+ initial_errors : false
};
// configure options
@@ -58,9 +56,66 @@
$(this.container).append(this.$el);
// build this form
- this._buildForm();
+ this.build(this.options);
},
+ /** Main tool form build function. This function is called once a new model is available.
+ */
+ build: function(options) {
+ // link this
+ var self = this;
+
+ // reset events
+ this.off('refresh');
+ this.off('reset');
+
+ // reset field list, which contains the input field elements
+ this.field_list = {};
+
+ // reset sequential input definition list, which contains the input definitions as provided from the api
+ this.input_list = {};
+
+ // reset input element list, which contains the dom elements of each input element (includes also the input field)
+ this.element_list = {};
+
+ // creates a tree/json data structure from the input form
+ this.tree = new ToolTree(this);
+
+ // request history content and build form
+ this.content = new ToolContent(this);
+
+ // update model data
+ self.options.inputs = options && options.inputs;
+
+ // create ui elements
+ this._renderForm(options);
+
+ // rebuild the underlying data structure
+ this.tree.finalize();
+
+ // show errors on startup
+ if (options.initial_errors) {
+ this._errors(options);
+ }
+
+ // add refresh listener
+ this.on('refresh', function() {
+ // by using/resetting the deferred ajax queue the number of redundant calls is reduced
+ self.deferred.reset();
+ self.deferred.execute(function(){self._updateModel()});
+ });
+
+ // add reset listener
+ this.on('reset', function() {
+ for (var i in this.element_list) {
+ this.element_list[i].reset();
+ }
+ });
+
+ // refresh
+ this.trigger('refresh');
+ },
+
/** Shows the final message (usually upon successful job submission)
*/
reciept: function($el) {
@@ -105,63 +160,6 @@
}
}
},
-
- /** Main tool form build function. This function is called once a new model is available.
- */
- _buildForm: function() {
- // link this
- var self = this;
-
- // reset events
- this.off('refresh');
- this.off('reset');
-
- // reset field list, which contains the input field elements
- this.field_list = {};
-
- // reset sequential input definition list, which contains the input definitions as provided from the api
- this.input_list = {};
-
- // reset input element list, which contains the dom elements of each input element (includes also the input field)
- this.element_list = {};
-
- // creates a tree/json data structure from the input form
- this.tree = new ToolTree(this);
-
- // request history content and build form
- this.content = new ToolContent(this);
-
- // link model options
- var options = this.options;
-
- // create ui elements
- this._renderForm(options);
-
- // rebuild the underlying data structure
- this.tree.finalize();
-
- // show errors on startup
- if (options.initial_errors) {
- this._errors(options);
- }
-
- // add refresh listener
- this.on('refresh', function() {
- // by using/resetting the deferred ajax queue the number of redundant calls is reduced
- self.deferred.reset();
- self.deferred.execute(function(){self._updateModel()});
- });
-
- // add reset listener
- this.on('reset', function() {
- for (var i in this.element_list) {
- this.element_list[i].reset();
- }
- });
-
- // refresh
- this.trigger('refresh');
- },
/** Renders the UI elements required for the form
*/
@@ -175,7 +173,7 @@
// button for version selection
var requirements_button = new Ui.ButtonIcon({
icon : 'fa-info-circle',
- title : (!options.compact && 'Requirements') || null,
+ title : (!options.narrow && 'Requirements') || null,
tooltip : 'Display tool requirements',
onclick : function() {
if (!this.visible) {
@@ -200,7 +198,7 @@
// button for version selection
var versions_button = new Ui.ButtonMenu({
icon : 'fa-cubes',
- title : (!options.compact && 'Versions') || null,
+ title : (!options.narrow && 'Versions') || null,
tooltip : 'Select another tool version'
});
if (options.versions && options.versions.length > 1) {
@@ -213,8 +211,8 @@
icon : 'fa-cube',
onclick : function() {
// here we update the tool version (some tools encode the version also in the id)
- options.id = options.id.replace(options.version, this.version);
- options.version = this.version;
+ self.options.id = self.options.id.replace(self.options.version, this.version);
+ self.options.version = this.version;
// rebuild the model and form
self.deferred.reset();
@@ -230,7 +228,7 @@
// button menu
var menu_button = new Ui.ButtonMenu({
icon : 'fa-caret-down',
- title : (!options.compact && 'Options') || null,
+ title : (!options.narrow && 'Options') || null,
tooltip : 'View available options'
});
@@ -306,7 +304,7 @@
});
// remove padding
- if (options.compact) {
+ if (options.narrow) {
this.portlet.$content.css('padding', '0px');
}
diff -r ff2b00fcbd70e3d7ce10b0444412cc68d2ede46f -r 494418e72cf0007e909c7f4b9134cd2b82df49e2 static/scripts/mvc/tools/tools-form-workflow.js
--- a/static/scripts/mvc/tools/tools-form-workflow.js
+++ b/static/scripts/mvc/tools/tools-form-workflow.js
@@ -21,9 +21,13 @@
this.options = options;
// set labels
- this.options.text_enable = 'In Advance';
- this.options.text_disable = 'At Runtime';
- this.options.use_defaults = true;
+ this.options.text_enable = 'In Advance';
+ this.options.text_disable = 'At Runtime';
+
+ // configure workflow style
+ this.options.is_dynamic = false;
+ this.options.narrow = true;
+ this.options.initial_errors = true;
// declare fields as optional
Utils.deepeach(options.inputs, function(item) {
diff -r ff2b00fcbd70e3d7ce10b0444412cc68d2ede46f -r 494418e72cf0007e909c7f4b9134cd2b82df49e2 static/scripts/mvc/tools/tools-form.js
--- a/static/scripts/mvc/tools/tools-form.js
+++ b/static/scripts/mvc/tools/tools-form.js
@@ -24,7 +24,7 @@
}
ToolFormBase.prototype.initialize.call(this, options);
},
-
+
/** Builds a new model through api call and recreates the entire form
*/
_buildModel: function() {
@@ -47,31 +47,28 @@
}
}
}
-
+
// register process
var process_id = this.deferred.register();
-
+
// get initial model
Utils.request({
type : 'GET',
url : model_url,
success : function(response) {
- // link model data update options
- self.options = response;
-
- // build form
- self._buildForm();
-
+ // build new tool form
+ self.build(response);
+
// notification
self.message.update({
status : 'success',
message : 'Now you are using \'' + self.options.name + '\' version ' + self.options.version + '.',
persistent : false
});
-
+
// process completed
self.deferred.done(process_id);
-
+
// log success
console.debug('tools-form::initialize() - Initial tool model ready.');
console.debug(response);
@@ -79,11 +76,11 @@
error : function(response) {
// process completed
self.deferred.done(process_id);
-
+
// log error
console.debug('tools-form::initialize() - Initial tool model request failed.');
console.debug(response);
-
+
// show error
var error_message = response.error || 'Uncaught error.';
self.modal.show({
@@ -98,7 +95,7 @@
}
});
},
-
+
/** Request a new model for an already created tool form and updates the form inputs
*/
_updateModel: function() {
@@ -112,11 +109,11 @@
return null;
}
});
-
+
// log tool state
console.debug('tools-form::_refreshForm() - Refreshing states.');
console.debug(current_state);
-
+
// activates/disables spinner for dynamic fields to indicate that they are currently being updated
function wait(active) {
for (var i in self.input_list) {
@@ -131,10 +128,10 @@
}
}
}
-
+
// set wait mode
wait(true);
-
+
// register process
var process_id = this.deferred.register();
@@ -179,13 +176,13 @@
}
}
});
-
+
// unset wait mode
wait(false);
-
+
// process completed
self.deferred.done(process_id);
-
+
// log success
console.debug('tools-form::_refreshForm() - States refreshed.');
console.debug(new_model);
@@ -193,7 +190,7 @@
error : function(response) {
// process completed
self.deferred.done(process_id);
-
+
// log error
console.debug('tools-form::_refreshForm() - Refresh request failed.');
console.debug(response);
diff -r ff2b00fcbd70e3d7ce10b0444412cc68d2ede46f -r 494418e72cf0007e909c7f4b9134cd2b82df49e2 static/scripts/packed/mvc/tools/tools-form-base.js
--- a/static/scripts/packed/mvc/tools/tools-form-base.js
+++ b/static/scripts/packed/mvc/tools/tools-form-base.js
@@ -1,1 +1,1 @@
-define(["utils/utils","utils/deferred","mvc/ui/ui-portlet","mvc/ui/ui-misc","mvc/citation/citation-model","mvc/citation/citation-view","mvc/tools","mvc/tools/tools-template","mvc/tools/tools-content","mvc/tools/tools-section","mvc/tools/tools-tree"],function(g,h,f,k,i,a,d,c,e,j,b){return Backbone.View.extend({initialize:function(l){this.optionsDefault={is_dynamic:true,compact:false,initial_errors:false,use_defaults:false};this.options=g.merge(l,this.optionsDefault);console.debug(this.options);var m=parent.Galaxy;if(m&&m.modal){this.modal=m.modal}else{this.modal=new k.Modal.View()}if(m&&m.currUser){this.is_admin=m.currUser.get("is_admin")}else{this.is_admin=false}this.container=this.options.container||"body";this.deferred=new h();this.setElement("<div/>");$(this.container).append(this.$el);this._buildForm()},reciept:function(l){$(this.container).empty();$(this.container).append(l)},highlight:function(m,n,l){var o=this.element_list[m];if(o){o.error(n||"Please verify this parameter.");if(!l){$(this.container).animate({scrollTop:o.$el.offset().top-20},500)}}},_errors:function(n){this.trigger("reset");if(n&&n.errors){var o=this.tree.matchResponse(n.errors);for(var m in this.element_list){var l=this.element_list[m];if(o[m]){this.highlight(m,o[m],true)}}}},_buildForm:function(){var l=this;this.off("refresh");this.off("reset");this.field_list={};this.input_list={};this.element_list={};this.tree=new b(this);this.content=new e(this);var m=this.options;this._renderForm(m);this.tree.finalize();if(m.initial_errors){this._errors(m)}this.on("refresh",function(){l.deferred.reset();l.deferred.execute(function(){l._updateModel()})});this.on("reset",function(){for(var n in this.element_list){this.element_list[n].reset()}});this.trigger("refresh")},_renderForm:function(u){var t=this;this.message=new k.Message();var q=new k.ButtonIcon({icon:"fa-info-circle",title:(!u.compact&&"Requirements")||null,tooltip:"Display tool requirements",onclick:function(){if(!this.visible){this.visible=true;t.message.update({persistent:true,message:c.requirements(u),status:"info"})}else{this.visible=false;t.message.update({message:""})}}});if(!u.requirements||u.requirements.length==0){q.$el.hide()}var m=new k.ButtonMenu({icon:"fa-cubes",title:(!u.compact&&"Versions")||null,tooltip:"Select another tool version"});if(u.versions&&u.versions.length>1){for(var o in u.versions){var r=u.versions[o];if(r!=u.version){m.addMenu({title:"Switch to "+r,version:r,icon:"fa-cube",onclick:function(){u.id=u.id.replace(u.version,this.version);u.version=this.version;t.deferred.reset();t.deferred.execute(function(){t._buildModel()})}})}}}else{m.$el.hide()}var p=new k.ButtonMenu({icon:"fa-caret-down",title:(!u.compact&&"Options")||null,tooltip:"View available options"});if(u.biostar_url){p.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(u.biostar_url+"/p/new/post/")}});p.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(u.biostar_url+"/t/"+u.id+"/")}})}p.addMenu({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",window.location.origin+galaxy_config.root+"root?tool_id="+u.id)}});if(this.is_admin){p.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+u.id+"/download"}})}this.section=new j.View(t,{inputs:u.inputs});if(this.incompatible){this.$el.hide();$("#tool-form-classic").show();return}this.portlet=new f.View({icon:"fa-wrench",title:"<b>"+u.name+"</b> "+u.description+" (Galaxy Tool Version "+u.version+")",cls:"ui-portlet-slim",operations:{requirements:q,menu:p,versions:m},buttons:this.buttons});if(u.compact){this.portlet.$content.css("padding","0px")}this.portlet.append(this.message.$el,true);this.portlet.append(this.section.$el);this.$el.empty();this.$el.append(this.portlet.$el);if(u.help!=""){this.$el.append(c.help(u.help))}if(u.citations){var s=$("<div/>");var l=new i.ToolCitationCollection();l.tool_id=u.id;var n=new a.CitationListView({el:s,collection:l});n.render();l.fetch();this.$el.append(s)}if(u.message){this.message.update({persistent:true,status:"warning",message:u.message})}}})});
\ No newline at end of file
+define(["utils/utils","utils/deferred","mvc/ui/ui-portlet","mvc/ui/ui-misc","mvc/citation/citation-model","mvc/citation/citation-view","mvc/tools","mvc/tools/tools-template","mvc/tools/tools-content","mvc/tools/tools-section","mvc/tools/tools-tree"],function(g,h,f,k,i,a,d,c,e,j,b){return Backbone.View.extend({initialize:function(l){this.optionsDefault={is_dynamic:true,narrow:false,initial_errors:false};this.options=g.merge(l,this.optionsDefault);console.debug(this.options);var m=parent.Galaxy;if(m&&m.modal){this.modal=m.modal}else{this.modal=new k.Modal.View()}if(m&&m.currUser){this.is_admin=m.currUser.get("is_admin")}else{this.is_admin=false}this.container=this.options.container||"body";this.deferred=new h();this.setElement("<div/>");$(this.container).append(this.$el);this.build(this.options)},build:function(m){var l=this;this.off("refresh");this.off("reset");this.field_list={};this.input_list={};this.element_list={};this.tree=new b(this);this.content=new e(this);l.options.inputs=m&&m.inputs;this._renderForm(m);this.tree.finalize();if(m.initial_errors){this._errors(m)}this.on("refresh",function(){l.deferred.reset();l.deferred.execute(function(){l._updateModel()})});this.on("reset",function(){for(var n in this.element_list){this.element_list[n].reset()}});this.trigger("refresh")},reciept:function(l){$(this.container).empty();$(this.container).append(l)},highlight:function(m,n,l){var o=this.element_list[m];if(o){o.error(n||"Please verify this parameter.");if(!l){$(this.container).animate({scrollTop:o.$el.offset().top-20},500)}}},_errors:function(n){this.trigger("reset");if(n&&n.errors){var o=this.tree.matchResponse(n.errors);for(var m in this.element_list){var l=this.element_list[m];if(o[m]){this.highlight(m,o[m],true)}}}},_renderForm:function(u){var t=this;this.message=new k.Message();var q=new k.ButtonIcon({icon:"fa-info-circle",title:(!u.narrow&&"Requirements")||null,tooltip:"Display tool requirements",onclick:function(){if(!this.visible){this.visible=true;t.message.update({persistent:true,message:c.requirements(u),status:"info"})}else{this.visible=false;t.message.update({message:""})}}});if(!u.requirements||u.requirements.length==0){q.$el.hide()}var m=new k.ButtonMenu({icon:"fa-cubes",title:(!u.narrow&&"Versions")||null,tooltip:"Select another tool version"});if(u.versions&&u.versions.length>1){for(var o in u.versions){var r=u.versions[o];if(r!=u.version){m.addMenu({title:"Switch to "+r,version:r,icon:"fa-cube",onclick:function(){t.options.id=t.options.id.replace(t.options.version,this.version);t.options.version=this.version;t.deferred.reset();t.deferred.execute(function(){t._buildModel()})}})}}}else{m.$el.hide()}var p=new k.ButtonMenu({icon:"fa-caret-down",title:(!u.narrow&&"Options")||null,tooltip:"View available options"});if(u.biostar_url){p.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(u.biostar_url+"/p/new/post/")}});p.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(u.biostar_url+"/t/"+u.id+"/")}})}p.addMenu({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",window.location.origin+galaxy_config.root+"root?tool_id="+u.id)}});if(this.is_admin){p.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+u.id+"/download"}})}this.section=new j.View(t,{inputs:u.inputs});if(this.incompatible){this.$el.hide();$("#tool-form-classic").show();return}this.portlet=new f.View({icon:"fa-wrench",title:"<b>"+u.name+"</b> "+u.description+" (Galaxy Tool Version "+u.version+")",cls:"ui-portlet-slim",operations:{requirements:q,menu:p,versions:m},buttons:this.buttons});if(u.narrow){this.portlet.$content.css("padding","0px")}this.portlet.append(this.message.$el,true);this.portlet.append(this.section.$el);this.$el.empty();this.$el.append(this.portlet.$el);if(u.help!=""){this.$el.append(c.help(u.help))}if(u.citations){var s=$("<div/>");var l=new i.ToolCitationCollection();l.tool_id=u.id;var n=new a.CitationListView({el:s,collection:l});n.render();l.fetch();this.$el.append(s)}if(u.message){this.message.update({persistent:true,status:"warning",message:u.message})}}})});
\ No newline at end of file
diff -r ff2b00fcbd70e3d7ce10b0444412cc68d2ede46f -r 494418e72cf0007e909c7f4b9134cd2b82df49e2 static/scripts/packed/mvc/tools/tools-form-workflow.js
--- a/static/scripts/packed/mvc/tools/tools-form-workflow.js
+++ b/static/scripts/packed/mvc/tools/tools-form-workflow.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/tools/tools-form-base"],function(b,a){var c=a.extend({initialize:function(e){this.node=workflow.active_node;if(!this.node){console.debug("FAILED - tools-form-workflow:initialize() - Node not found in workflow.");return}this.post_job_actions=this.node.post_job_actions||{};this.options=e;this.options.text_enable="In Advance";this.options.text_disable="At Runtime";this.options.use_defaults=true;b.deepeach(e.inputs,function(f){if(f.type){f.optional=(["data","data_hidden","hidden","drill_down","repeat","conditional"]).indexOf(f.type)==-1}});b.deepeach(e.inputs,function(f){if(f.type){if(f.type=="conditional"){f.test_param.optional=false}}});var d=this;b.get({url:galaxy_config.root+"api/datatypes",cache:true,success:function(f){d.datatypes=f;d._makeSections(e.inputs);a.prototype.initialize.call(d,e)}})},_makeSections:function(d){d[b.uuid()]={label:"Annotation / Notes",name:"annotation",type:"text",area:true,help:"Add an annotation or note for this step. It will be shown with the workflow.",value:this.node.annotation};var f=this.node.output_terminals&&Object.keys(this.node.output_terminals)[0];if(f){d[b.uuid()]={name:"pja__"+f+"__EmailAction",label:"Email notification",type:"boolean",value:String(Boolean(this.post_job_actions["EmailAction"+f])),ignore:"false",help:"An email notification will be send when the job has completed.",payload:{host:window.location.host}};d[b.uuid()]={name:"pja__"+f+"__DeleteIntermediatesAction",label:"Output cleanup",type:"boolean",value:String(Boolean(this.post_job_actions["DeleteIntermediatesAction"+f])),ignore:"false",help:"Delete intermediate outputs if they are not used as input for another job."};for(var e in this.node.output_terminals){d[b.uuid()]=this._makeSection(e)}}},_makeSection:function(h){var g=[];for(key in this.datatypes){g.push({0:this.datatypes[key],1:this.datatypes[key]})}g.sort(function(j,i){return j.label>i.label?1:j.label<i.label?-1:0});g.unshift({0:"Sequences",1:"Sequences"});g.unshift({0:"Roadmaps",1:"Roadmaps"});g.unshift({0:"Leave unchanged",1:""});var f={label:"Add Actions: '"+h+"'",type:"section",inputs:[{action:"RenameDatasetAction",argument:"newname",label:"Rename dataset",type:"text",value:"",ignore:"",help:'This action will rename the result dataset. Click <a href="https://wiki.galaxyproject.org/Learn/AdvancedWorkflow/Variables">here</a> for more information.'},{action:"ChangeDatatypeAction",argument:"newtype",label:"Change datatype",type:"select",ignore:"",options:g,help:"This action will change the datatype of the output to the indicated value."},{action:"TagDatasetAction",argument:"tags",label:"Tags",type:"text",value:"",ignore:"",help:"This action will set tags for the dataset."},{label:"Assign columns",type:"section",inputs:[{action:"ColumnSetAction",argument:"chromCol",label:"Chrom column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",argument:"startCol",label:"Start column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",argument:"endCol",label:"End column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",argument:"strandCol",label:"Strand column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",argument:"nameCol",label:"Name column",type:"integer",value:"",ignore:""}],help:"This action will set column assignments in the output dataset. Blank fields are ignored."}]};var d=this;function e(n,o){o=o||[];o.push(n);for(var m in n.inputs){var k=n.inputs[m];if(k.action){k.name="pja__"+h+"__"+k.action;if(k.argument){k.name+="__"+k.argument}if(k.payload){for(var s in k.payload){var q=k.payload[s];k.payload[k.name+"__"+s]=q;delete q}}var r=d.post_job_actions[k.action+h];if(r){for(var l in o){o[l].expand=true}if(k.argument){k.value=r.action_arguments&&r.action_arguments[k.argument]||k.value}else{k.value="true"}}}if(k.inputs){e(k,o.slice(0))}}}e(f);return f},_buildModel:function(){Galaxy.modal.show({title:"Coming soon...",body:"This feature has not been implemented yet.",buttons:{Close:function(){Galaxy.modal.hide()}}})},_updateModel:function(){var d=this;var e=this.tree.finalize();console.debug("tools-form-workflow::_refreshForm() - Refreshing states.");console.debug(e);var g=this.deferred.register();var f=galaxy_config.root+"workflow/editor_form_post?tool_id="+this.options.id+"&__is_dynamic__=False";b.request({type:"GET",url:f,data:e,success:function(h){d.node.update_field_data(h);d._errors(h&&h.tool_model);d.deferred.done(g);console.debug("tools-form::_refreshForm() - States refreshed.");console.debug(h)},error:function(h){d.deferred.done(g);console.debug("tools-form::_refreshForm() - Refresh request failed.");console.debug(h)}})}});return{View:c}});
\ No newline at end of file
+define(["utils/utils","mvc/tools/tools-form-base"],function(b,a){var c=a.extend({initialize:function(e){this.node=workflow.active_node;if(!this.node){console.debug("FAILED - tools-form-workflow:initialize() - Node not found in workflow.");return}this.post_job_actions=this.node.post_job_actions||{};this.options=e;this.options.text_enable="In Advance";this.options.text_disable="At Runtime";this.options.is_dynamic=false;this.options.narrow=true;this.options.initial_errors=true;b.deepeach(e.inputs,function(f){if(f.type){f.optional=(["data","data_hidden","hidden","drill_down","repeat","conditional"]).indexOf(f.type)==-1}});b.deepeach(e.inputs,function(f){if(f.type){if(f.type=="conditional"){f.test_param.optional=false}}});var d=this;b.get({url:galaxy_config.root+"api/datatypes",cache:true,success:function(f){d.datatypes=f;d._makeSections(e.inputs);a.prototype.initialize.call(d,e)}})},_makeSections:function(d){d[b.uuid()]={label:"Annotation / Notes",name:"annotation",type:"text",area:true,help:"Add an annotation or note for this step. It will be shown with the workflow.",value:this.node.annotation};var f=this.node.output_terminals&&Object.keys(this.node.output_terminals)[0];if(f){d[b.uuid()]={name:"pja__"+f+"__EmailAction",label:"Email notification",type:"boolean",value:String(Boolean(this.post_job_actions["EmailAction"+f])),ignore:"false",help:"An email notification will be send when the job has completed.",payload:{host:window.location.host}};d[b.uuid()]={name:"pja__"+f+"__DeleteIntermediatesAction",label:"Output cleanup",type:"boolean",value:String(Boolean(this.post_job_actions["DeleteIntermediatesAction"+f])),ignore:"false",help:"Delete intermediate outputs if they are not used as input for another job."};for(var e in this.node.output_terminals){d[b.uuid()]=this._makeSection(e)}}},_makeSection:function(h){var g=[];for(key in this.datatypes){g.push({0:this.datatypes[key],1:this.datatypes[key]})}g.sort(function(j,i){return j.label>i.label?1:j.label<i.label?-1:0});g.unshift({0:"Sequences",1:"Sequences"});g.unshift({0:"Roadmaps",1:"Roadmaps"});g.unshift({0:"Leave unchanged",1:""});var f={label:"Add Actions: '"+h+"'",type:"section",inputs:[{action:"RenameDatasetAction",argument:"newname",label:"Rename dataset",type:"text",value:"",ignore:"",help:'This action will rename the result dataset. Click <a href="https://wiki.galaxyproject.org/Learn/AdvancedWorkflow/Variables">here</a> for more information.'},{action:"ChangeDatatypeAction",argument:"newtype",label:"Change datatype",type:"select",ignore:"",options:g,help:"This action will change the datatype of the output to the indicated value."},{action:"TagDatasetAction",argument:"tags",label:"Tags",type:"text",value:"",ignore:"",help:"This action will set tags for the dataset."},{label:"Assign columns",type:"section",inputs:[{action:"ColumnSetAction",argument:"chromCol",label:"Chrom column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",argument:"startCol",label:"Start column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",argument:"endCol",label:"End column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",argument:"strandCol",label:"Strand column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",argument:"nameCol",label:"Name column",type:"integer",value:"",ignore:""}],help:"This action will set column assignments in the output dataset. Blank fields are ignored."}]};var d=this;function e(n,o){o=o||[];o.push(n);for(var m in n.inputs){var k=n.inputs[m];if(k.action){k.name="pja__"+h+"__"+k.action;if(k.argument){k.name+="__"+k.argument}if(k.payload){for(var s in k.payload){var q=k.payload[s];k.payload[k.name+"__"+s]=q;delete q}}var r=d.post_job_actions[k.action+h];if(r){for(var l in o){o[l].expand=true}if(k.argument){k.value=r.action_arguments&&r.action_arguments[k.argument]||k.value}else{k.value="true"}}}if(k.inputs){e(k,o.slice(0))}}}e(f);return f},_buildModel:function(){Galaxy.modal.show({title:"Coming soon...",body:"This feature has not been implemented yet.",buttons:{Close:function(){Galaxy.modal.hide()}}})},_updateModel:function(){var d=this;var e=this.tree.finalize();console.debug("tools-form-workflow::_refreshForm() - Refreshing states.");console.debug(e);var g=this.deferred.register();var f=galaxy_config.root+"workflow/editor_form_post?tool_id="+this.options.id+"&__is_dynamic__=False";b.request({type:"GET",url:f,data:e,success:function(h){d.node.update_field_data(h);d._errors(h&&h.tool_model);d.deferred.done(g);console.debug("tools-form::_refreshForm() - States refreshed.");console.debug(h)},error:function(h){d.deferred.done(g);console.debug("tools-form::_refreshForm() - Refresh request failed.");console.debug(h)}})}});return{View:c}});
\ No newline at end of file
diff -r ff2b00fcbd70e3d7ce10b0444412cc68d2ede46f -r 494418e72cf0007e909c7f4b9134cd2b82df49e2 static/scripts/packed/mvc/tools/tools-form.js
--- a/static/scripts/packed/mvc/tools/tools-form.js
+++ b/static/scripts/packed/mvc/tools/tools-form.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/ui/ui-misc","mvc/tools/tools-form-base","mvc/tools/tools-jobs"],function(c,e,b,a){var d=b.extend({initialize:function(g){var f=this;this.job_handler=new a(this);this.buttons={execute:new e.Button({icon:"fa-check",tooltip:"Execute: "+g.name,title:"Execute",cls:"btn btn-primary",floating:"clear",onclick:function(){f.job_handler.submit()}})};b.prototype.initialize.call(this,g)},_buildModel:function(){var f=this;var g=galaxy_config.root+"api/tools/"+this.options.id+"/build?";if(this.options.job_id){g+="job_id="+this.options.job_id}else{if(this.options.dataset_id){g+="dataset_id="+this.options.dataset_id}else{g+="tool_version="+this.options.version+"&";var i=top.location.href;var j=i.indexOf("?");if(i.indexOf("tool_id=")!=-1&&j!==-1){g+=i.slice(j+1)}}}var h=this.deferred.register();c.request({type:"GET",url:g,success:function(k){f.options=k;f._buildForm();f.message.update({status:"success",message:"Now you are using '"+f.options.name+"' version "+f.options.version+".",persistent:false});f.deferred.done(h);console.debug("tools-form::initialize() - Initial tool model ready.");console.debug(k)},error:function(k){f.deferred.done(h);console.debug("tools-form::initialize() - Initial tool model request failed.");console.debug(k);var l=k.error||"Uncaught error.";f.modal.show({title:"Tool cannot be executed",body:l,buttons:{Close:function(){f.modal.hide()}}})}})},_updateModel:function(){var f=this;var g=this.tree.finalize({data:function(k){if(k.values.length>0&&k.values[0]&&k.values[0].src==="hda"){return f.content.get({id:k.values[0].id,src:"hda"}).id_uncoded}return null}});console.debug("tools-form::_refreshForm() - Refreshing states.");console.debug(g);function j(n){for(var l in f.input_list){var m=f.field_list[l];var k=f.input_list[l];if(k.is_dynamic&&m.wait&&m.unwait){if(n){m.wait()}else{m.unwait()}}}}j(true);var i=this.deferred.register();var h=galaxy_config.root+"api/tools/"+this.options.id+"/build?tool_version="+this.options.version;c.request({type:"GET",url:h,data:g,success:function(k){f.tree.matchModel(k,function(m,q){var l=f.input_list[m];if(l&&l.options){if(!_.isEqual(l.options,q.options)){l.options=q.options;var r=f.field_list[m];if(r.update){var p=[];if((["data","data_collection","drill_down"]).indexOf(l.type)!=-1){p=l.options}else{for(var o in q.options){var n=q.options[o];if(n.length>2){p.push({label:n[0],value:n[1]})}}}r.update(p);r.trigger("change");console.debug("Updating options for "+m)}}}});j(false);f.deferred.done(i);console.debug("tools-form::_refreshForm() - States refreshed.");console.debug(k)},error:function(k){f.deferred.done(i);console.debug("tools-form::_refreshForm() - Refresh request failed.");console.debug(k)}})}});return{View:d}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-misc","mvc/tools/tools-form-base","mvc/tools/tools-jobs"],function(c,e,b,a){var d=b.extend({initialize:function(g){var f=this;this.job_handler=new a(this);this.buttons={execute:new e.Button({icon:"fa-check",tooltip:"Execute: "+g.name,title:"Execute",cls:"btn btn-primary",floating:"clear",onclick:function(){f.job_handler.submit()}})};b.prototype.initialize.call(this,g)},_buildModel:function(){var f=this;var g=galaxy_config.root+"api/tools/"+this.options.id+"/build?";if(this.options.job_id){g+="job_id="+this.options.job_id}else{if(this.options.dataset_id){g+="dataset_id="+this.options.dataset_id}else{g+="tool_version="+this.options.version+"&";var i=top.location.href;var j=i.indexOf("?");if(i.indexOf("tool_id=")!=-1&&j!==-1){g+=i.slice(j+1)}}}var h=this.deferred.register();c.request({type:"GET",url:g,success:function(k){f.build(k);f.message.update({status:"success",message:"Now you are using '"+f.options.name+"' version "+f.options.version+".",persistent:false});f.deferred.done(h);console.debug("tools-form::initialize() - Initial tool model ready.");console.debug(k)},error:function(k){f.deferred.done(h);console.debug("tools-form::initialize() - Initial tool model request failed.");console.debug(k);var l=k.error||"Uncaught error.";f.modal.show({title:"Tool cannot be executed",body:l,buttons:{Close:function(){f.modal.hide()}}})}})},_updateModel:function(){var f=this;var g=this.tree.finalize({data:function(k){if(k.values.length>0&&k.values[0]&&k.values[0].src==="hda"){return f.content.get({id:k.values[0].id,src:"hda"}).id_uncoded}return null}});console.debug("tools-form::_refreshForm() - Refreshing states.");console.debug(g);function j(n){for(var l in f.input_list){var m=f.field_list[l];var k=f.input_list[l];if(k.is_dynamic&&m.wait&&m.unwait){if(n){m.wait()}else{m.unwait()}}}}j(true);var i=this.deferred.register();var h=galaxy_config.root+"api/tools/"+this.options.id+"/build?tool_version="+this.options.version;c.request({type:"GET",url:h,data:g,success:function(k){f.tree.matchModel(k,function(m,q){var l=f.input_list[m];if(l&&l.options){if(!_.isEqual(l.options,q.options)){l.options=q.options;var r=f.field_list[m];if(r.update){var p=[];if((["data","data_collection","drill_down"]).indexOf(l.type)!=-1){p=l.options}else{for(var o in q.options){var n=q.options[o];if(n.length>2){p.push({label:n[0],value:n[1]})}}}r.update(p);r.trigger("change");console.debug("Updating options for "+m)}}}});j(false);f.deferred.done(i);console.debug("tools-form::_refreshForm() - States refreshed.");console.debug(k)},error:function(k){f.deferred.done(i);console.debug("tools-form::_refreshForm() - Refresh request failed.");console.debug(k)}})}});return{View:d}});
\ No newline at end of file
diff -r ff2b00fcbd70e3d7ce10b0444412cc68d2ede46f -r 494418e72cf0007e909c7f4b9134cd2b82df49e2 templates/webapps/galaxy/tool_form.mako
--- a/templates/webapps/galaxy/tool_form.mako
+++ b/templates/webapps/galaxy/tool_form.mako
@@ -9,8 +9,7 @@
## TEMPORARY: create tool dictionary in mako while both tool forms are in use.
## This avoids making two separate requests since the classic form requires the mako anyway.
params = dict(trans.request.params)
- if 'id' in params:
- params['dataset_id'] = params['id']
+ params['__dataset_id__'] = params.get('id', None)
self.form_config = tool.to_json(trans, **params)
self.form_config.update({
'id' : tool.id,
diff -r ff2b00fcbd70e3d7ce10b0444412cc68d2ede46f -r 494418e72cf0007e909c7f4b9134cd2b82df49e2 templates/webapps/galaxy/workflow/editor_tool_form.mako
--- a/templates/webapps/galaxy/workflow/editor_tool_form.mako
+++ b/templates/webapps/galaxy/workflow/editor_tool_form.mako
@@ -15,9 +15,6 @@
'id' : tool.id,
'job_id' : trans.security.encode_id( job.id ) if job else None,
'history_id' : trans.security.encode_id( trans.history.id ),
- 'is_dynamic' : False,
- 'compact' : True,
- 'initial_errors' : True,
'container' : '#right-content'
})
%>
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: Bugfix for bugfix d3b1f6b.
by commits-noreply@bitbucket.org 05 Feb '15
by commits-noreply@bitbucket.org 05 Feb '15
05 Feb '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/ff2b00fcbd70/
Changeset: ff2b00fcbd70
User: jmchilton
Date: 2015-02-05 18:32:56+00:00
Summary: Bugfix for bugfix d3b1f6b.
d3b1f6b fix the GUI (in an obsecure use) but broke fairly typical uses of the API.
Affected #: 1 file
diff -r b6349ba5cda26cdea678c4842136e50363c0629f -r ff2b00fcbd70e3d7ce10b0444412cc68d2ede46f lib/galaxy/workflow/modules.py
--- a/lib/galaxy/workflow/modules.py
+++ b/lib/galaxy/workflow/modules.py
@@ -330,7 +330,9 @@
# so do that now so dependent steps can be recalculated. In the future
# everything should come in from the API and this can be eliminated.
if not invocation.has_input_for_step( step.id ):
- invocation.add_input( step_outputs.values()[ 0 ], step.id )
+ content = step_outputs.values()[ 0 ]
+ if content:
+ invocation.add_input( content, step.id )
progress.set_outputs_for_input( step, step_outputs )
return job
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
4 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/73e9ca698df3/
Changeset: 73e9ca698df3
User: jmchilton
Date: 2015-02-05 17:27:46+00:00
Summary: Fix workflow schedulers to fallback onto sample like other config files.
Affected #: 1 file
diff -r 2f436edb5288bf750382ae1ccddd95ed611db6a1 -r 73e9ca698df3f0da3fe145878938cdf60978d17c lib/galaxy/config.py
--- a/lib/galaxy/config.py
+++ b/lib/galaxy/config.py
@@ -143,7 +143,6 @@
self.collect_outputs_from = [ x.strip() for x in kwargs.get( 'collect_outputs_from', 'new_file_path,job_working_directory' ).lower().split(',') ]
self.template_path = resolve_path( kwargs.get( "template_path", "templates" ), self.root )
self.template_cache = resolve_path( kwargs.get( "template_cache_path", "database/compiled_templates" ), self.root )
- self.workflow_schedulers_config_file = resolve_path( kwargs.get( 'workflow_schedulers_config_file', 'config/workflow_schedulers_conf.xml' ), self.root )
self.local_job_queue_workers = int( kwargs.get( "local_job_queue_workers", "5" ) )
self.cluster_job_queue_workers = int( kwargs.get( "cluster_job_queue_workers", "3" ) )
self.job_queue_cleanup_interval = int( kwargs.get("job_queue_cleanup_interval", "5") )
@@ -459,6 +458,7 @@
shed_data_manager_config_file=[ 'shed_data_manager_conf.xml', 'config/shed_data_manager_conf.xml' ],
shed_tool_data_table_config=[ 'shed_tool_data_table_conf.xml', 'config/shed_tool_data_table_conf.xml' ],
tool_sheds_config_file=[ 'config/tool_sheds_conf.xml', 'tool_sheds_conf.xml', 'config/tool_sheds_conf.xml.sample' ],
+ workflow_schedulers_config_file=['config/workflow_schedulers_conf.xml', 'config/workflow_schedulers_conf.xml.sample'],
)
listify_defaults = dict(
https://bitbucket.org/galaxy/galaxy-central/commits/d3b1f6b04d4b/
Changeset: d3b1f6b04d4b
User: jmchilton
Date: 2015-02-05 17:27:46+00:00
Summary: Workflow scheduling delay fix.
There were problems if all three of these conditions were met - 1) workflow from GUI, 2) workflow evaluation delayed, and 3) a delayed step was connected to a input dataset. This fixes these workflows.
Affected #: 3 files
diff -r 73e9ca698df3f0da3fe145878938cdf60978d17c -r d3b1f6b04d4b4fb9db667afdfb2beb78db5226a0 lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -3253,6 +3253,27 @@
def update( self ):
self.update_time = galaxy.model.orm.now.now()
+ def add_input( self, content, step_id ):
+ if content.history_content_type == "dataset":
+ request_to_content = WorkflowRequestToInputDatasetAssociation()
+ request_to_content.dataset = content
+ request_to_content.workflow_step_id = step_id
+ self.input_datasets.append( request_to_content )
+ else:
+ request_to_content = WorkflowRequestToInputDatasetCollectionAssociation()
+ request_to_content.dataset_collection = content
+ request_to_content.workflow_step_id = step_id
+ self.input_dataset_collections.append( request_to_content )
+
+ def has_input_for_step( self, step_id ):
+ for content in self.input_datasets:
+ if content.workflow_step_id == step_id:
+ return True
+ for content in self.input_dataset_collections:
+ if content.workflow_step_id == step_id:
+ return True
+ return False
+
class WorkflowInvocationStep( object, Dictifiable ):
dict_collection_visible_keys = ( 'id', 'update_time', 'job_id', 'workflow_step_id', 'action' )
diff -r 73e9ca698df3f0da3fe145878938cdf60978d17c -r d3b1f6b04d4b4fb9db667afdfb2beb78db5226a0 lib/galaxy/workflow/modules.py
--- a/lib/galaxy/workflow/modules.py
+++ b/lib/galaxy/workflow/modules.py
@@ -326,6 +326,11 @@
step_outputs[ 'input_ds_copy' ] = new_hdca
else:
raise Exception("Unknown history content encountered")
+ # If coming from UI - we haven't registered invocation inputs yet,
+ # so do that now so dependent steps can be recalculated. In the future
+ # everything should come in from the API and this can be eliminated.
+ if not invocation.has_input_for_step( step.id ):
+ invocation.add_input( step_outputs.values()[ 0 ], step.id )
progress.set_outputs_for_input( step, step_outputs )
return job
diff -r 73e9ca698df3f0da3fe145878938cdf60978d17c -r d3b1f6b04d4b4fb9db667afdfb2beb78db5226a0 lib/galaxy/workflow/run_request.py
--- a/lib/galaxy/workflow/run_request.py
+++ b/lib/galaxy/workflow/run_request.py
@@ -297,18 +297,8 @@
value=value,
type=param_types.REPLACEMENT_PARAMETERS,
)
-
for step_id, content in run_config.inputs.iteritems():
- if content.history_content_type == "dataset":
- request_to_content = model.WorkflowRequestToInputDatasetAssociation()
- request_to_content.dataset = content
- request_to_content.workflow_step_id = step_id
- workflow_invocation.input_datasets.append( request_to_content )
- else:
- request_to_content = model.WorkflowRequestToInputDatasetCollectionAssociation()
- request_to_content.dataset_collection = content
- request_to_content.workflow_step_id = step_id
- workflow_invocation.input_dataset_collections.append( request_to_content )
+ workflow_invocation.add_input( content, step_id )
for step in workflow.steps:
state = step.state
https://bitbucket.org/galaxy/galaxy-central/commits/ff56bdbf7b3e/
Changeset: ff56bdbf7b3e
User: jmchilton
Date: 2015-02-05 17:27:46+00:00
Summary: Fix scheduling_manager.py for unknown attribute reference.
Not sure if this was a poor rebasing or a copy and paste error.
Affected #: 1 file
diff -r d3b1f6b04d4b4fb9db667afdfb2beb78db5226a0 -r ff56bdbf7b3e1a7a19eaab24be8d2ac6b8aa970c lib/galaxy/workflow/scheduling_manager.py
--- a/lib/galaxy/workflow/scheduling_manager.py
+++ b/lib/galaxy/workflow/scheduling_manager.py
@@ -116,7 +116,6 @@
for plugin_element in plugins_element.getchildren():
plugin_type = plugin_element.tag
plugin_kwds = dict( plugin_element.items() )
- plugin_kwds.update( self.extra_kwargs )
workflow_scheduler_id = plugin_kwds.get( 'id', None )
self.__init_plugin( plugin_type, workflow_scheduler_id, **plugin_kwds )
https://bitbucket.org/galaxy/galaxy-central/commits/b6349ba5cda2/
Changeset: b6349ba5cda2
User: jmchilton
Date: 2015-02-05 17:27:46+00:00
Summary: Improved error message if things don't match up when recovering workflows.
Ideally this shouldn't really happen - but this should help if it does.
Affected #: 1 file
diff -r ff56bdbf7b3e1a7a19eaab24be8d2ac6b8aa970c -r b6349ba5cda26cdea678c4842136e50363c0629f lib/galaxy/workflow/run.py
--- a/lib/galaxy/workflow/run.py
+++ b/lib/galaxy/workflow/run.py
@@ -251,7 +251,13 @@
step_outputs = self.outputs[ connection.output_step.id ]
if step_outputs is STEP_OUTPUT_DELAYED:
raise modules.DelayedWorkflowEvaluation()
- replacement = step_outputs[ connection.output_name ]
+ output_name = connection.output_name
+ try:
+ replacement = step_outputs[ output_name ]
+ except KeyError:
+ template = "Workflow evaluation problem - failed to find output_name %s in step_outputs %s"
+ message = template % ( output_name, step_outputs )
+ raise Exception( message )
if isinstance( replacement, model.HistoryDatasetCollectionAssociation ):
if not replacement.collection.populated:
if not replacement.collection.waiting_for_elements:
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] c55a48: disable new toolform by Aysam's request
by GitHub 05 Feb '15
by GitHub 05 Feb '15
05 Feb '15
Branch: refs/heads/master
Home: https://github.com/galaxyproject/usegalaxy-playbook
Commit: c55a48d5a1f2b839e19bcd5bd8fec116fd9fc087
https://github.com/galaxyproject/usegalaxy-playbook/commit/c55a48d5a1f2b839…
Author: martenson <cech.marten(a)gmail.com>
Date: 2015-02-05 (Thu, 05 Feb 2015)
Changed paths:
M stage/group_vars/galaxyservers.yml
Log Message:
-----------
disable new toolform by Aysam's request
1
0
commit/galaxy-central: guerler: Workflow: Fix text and boolean parameter handling, simplify module update
by commits-noreply@bitbucket.org 05 Feb '15
by commits-noreply@bitbucket.org 05 Feb '15
05 Feb '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/2f436edb5288/
Changeset: 2f436edb5288
User: guerler
Date: 2015-02-05 15:08:45+00:00
Summary: Workflow: Fix text and boolean parameter handling, simplify module update
Affected #: 3 files
diff -r 6133a80c7a08b88f1e7d2e83456acdc329b88b47 -r 2f436edb5288bf750382ae1ccddd95ed611db6a1 lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -263,8 +263,15 @@
else:
return form_builder.TextField( self.name, self.size, value )
+ def to_string( self, value, app ):
+ """Convert a value to a string representation suitable for persisting"""
+ if value is None:
+ return ''
+ else:
+ return str( value )
+
def to_html_value( self, value, app ):
- if not value:
+ if value is None:
return ''
else:
return self.to_string( value, app )
@@ -335,13 +342,6 @@
return ""
raise ValueError( "An integer is required" )
- def to_string( self, value, app ):
- """Convert a value to a string representation suitable for persisting"""
- if value is None:
- return ""
- else:
- return str( value )
-
def to_python( self, value, app ):
try:
return int( value )
@@ -414,13 +414,6 @@
return ""
raise ValueError( "A real number is required" )
- def to_string( self, value, app ):
- """Convert a value to a string representation suitable for persisting"""
- if value is None:
- return ""
- else:
- return str( value )
-
def to_python( self, value, app ):
try:
return float( value )
@@ -480,7 +473,7 @@
return [ 'true' ]
def to_python( self, value, app ):
- return ( value == 'True' )
+ return ( value in [ 'True', 'true' ])
def get_initial_value( self, trans, context, history=None ):
return self.checked
diff -r 6133a80c7a08b88f1e7d2e83456acdc329b88b47 -r 2f436edb5288bf750382ae1ccddd95ed611db6a1 lib/galaxy/webapps/galaxy/controllers/workflow.py
--- a/lib/galaxy/webapps/galaxy/controllers/workflow.py
+++ b/lib/galaxy/webapps/galaxy/controllers/workflow.py
@@ -619,17 +619,25 @@
} )
# create tool model and default tool state (if missing)
- tool_model = None
if type == 'tool' and not tool_state:
tool_model = module.tool.to_json(trans, **incoming)
module.state.inputs = copy.deepcopy(tool_model['state_inputs'])
+ return {
+ 'tool_model': tool_model,
+ 'tool_state': module.get_state(),
+ 'data_inputs': module.get_data_inputs(),
+ 'data_outputs': module.get_data_outputs(),
+ 'tool_errors': module.get_errors(),
+ 'form_html': module.get_config_form(),
+ 'annotation': annotation,
+ 'post_job_actions': module.get_post_job_actions(incoming)
+ }
# update module state
module.update_state( incoming )
if type == 'tool':
return {
- 'tool_model': tool_model,
'tool_state': module.get_state(),
'data_inputs': module.get_data_inputs(),
'data_outputs': module.get_data_outputs(),
diff -r 6133a80c7a08b88f1e7d2e83456acdc329b88b47 -r 2f436edb5288bf750382ae1ccddd95ed611db6a1 lib/galaxy/workflow/modules.py
--- a/lib/galaxy/workflow/modules.py
+++ b/lib/galaxy/workflow/modules.py
@@ -684,8 +684,11 @@
input_dicts.append( { "name": name, "description": "runtime parameter for tool %s" % self.get_name() } )
return input_dicts
- def get_post_job_actions( self ):
- return self.post_job_actions
+ def get_post_job_actions( self, incoming=None):
+ if incoming is None:
+ return self.post_job_actions
+ else:
+ return ActionBox.handle_incoming(incoming)
def get_config_form( self ):
self.add_dummy_datasets()
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: dannon: pep8, cleanup in galaxy/buildapp
by commits-noreply@bitbucket.org 05 Feb '15
by commits-noreply@bitbucket.org 05 Feb '15
05 Feb '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/6133a80c7a08/
Changeset: 6133a80c7a08
User: dannon
Date: 2015-02-05 14:45:15+00:00
Summary: pep8, cleanup in galaxy/buildapp
Affected #: 1 file
diff -r cca00d61df85a6ecd1be49265f0c92e7482b91f9 -r 6133a80c7a08b88f1e7d2e83456acdc329b88b47 lib/galaxy/webapps/galaxy/buildapp.py
--- a/lib/galaxy/webapps/galaxy/buildapp.py
+++ b/lib/galaxy/webapps/galaxy/buildapp.py
@@ -6,8 +6,6 @@
import os
import os.path
import atexit
-import warnings
-import glob
from paste import httpexceptions
import pkg_resources
@@ -28,6 +26,7 @@
class GalaxyWebApplication( galaxy.web.framework.webapp.WebApplication ):
pass
+
def app_factory( global_conf, **kwargs ):
"""
Return a wsgi application serving the root object
@@ -41,7 +40,7 @@
else:
try:
from galaxy.app import UniverseApplication
- app = UniverseApplication( global_conf = global_conf, **kwargs )
+ app = UniverseApplication( global_conf=global_conf, **kwargs )
except:
import traceback
traceback.print_exc()
@@ -65,8 +64,8 @@
webapp.add_route( '/datasets/:dataset_id/display/{filename:.+?}', controller='dataset', action='display', dataset_id=None, filename=None)
webapp.add_route( '/datasets/:dataset_id/:action/:filename', controller='dataset', action='index', dataset_id=None, filename=None)
webapp.add_route( '/display_application/:dataset_id/:app_name/:link_name/:user_id/:app_action/:action_param',
- controller='dataset', action='display_application', dataset_id=None, user_id=None,
- app_name = None, link_name = None, app_action = None, action_param = None )
+ controller='dataset', action='display_application', dataset_id=None, user_id=None,
+ app_name=None, link_name=None, app_action=None, action_param=None )
webapp.add_route( '/u/:username/d/:slug/:filename', controller='dataset', action='display_by_username_and_slug', filename=None )
webapp.add_route( '/u/:username/p/:slug', controller='page', action='display_by_username_and_slug' )
webapp.add_route( '/u/:username/h/:slug', controller='history', action='display_by_username_and_slug' )
@@ -103,7 +102,6 @@
log.error("Static middleware is enabled in your configuration but this is a uwsgi process. Refusing to wrap in static middleware.")
else:
webapp = wrap_in_static( webapp, global_conf, plugin_frameworks=[ app.visualizations_registry ], **kwargs )
- #webapp = wrap_in_static( webapp, global_conf, plugin_frameworks=None, **kwargs )
if asbool(kwargs.get('pack_scripts', False)):
log.warn( "The 'pack_scripts' option is deprecated" )
pack_scripts()
@@ -112,7 +110,6 @@
galaxy.model.mapping.metadata.engine.connection_provider._pool.dispose()
except:
pass
- # Close any pooled database connections before forking
try:
galaxy.model.tool_shed_install.mapping.metadata.engine.connection_provider._pool.dispose()
except:
@@ -137,32 +134,32 @@
controller='history_contents',
path_prefix='/api/histories/:history_id/contents',
parent_resources=dict( member_name='history', collection_name='histories' ),
- )
+ )
# Legacy access to HDA details via histories/:history_id/contents/:hda_id
webapp.mapper.resource( 'content',
- 'contents',
- controller='history_contents',
- name_prefix='history_',
- path_prefix='/api/histories/:history_id',
- parent_resources=dict( member_name='history', collection_name='histories' ) )
- webapp.mapper.connect("history_contents_display",
- "/api/histories/:history_id/contents/:history_content_id/display",
- controller="datasets",
- action="display",
- conditions=dict(method=["GET"]))
+ 'contents',
+ controller='history_contents',
+ name_prefix='history_',
+ path_prefix='/api/histories/:history_id',
+ parent_resources=dict( member_name='history', collection_name='histories' ) )
+ webapp.mapper.connect( "history_contents_display",
+ "/api/histories/:history_id/contents/:history_content_id/display",
+ controller="datasets",
+ action="display",
+ conditions=dict(method=["GET"]))
webapp.mapper.resource( 'user',
- 'users',
- controller='group_users',
- name_prefix='group_',
- path_prefix='/api/groups/:group_id',
- parent_resources=dict( member_name='group', collection_name='groups' ) )
+ 'users',
+ controller='group_users',
+ name_prefix='group_',
+ path_prefix='/api/groups/:group_id',
+ parent_resources=dict( member_name='group', collection_name='groups' ) )
webapp.mapper.resource( 'role',
- 'roles',
- controller='group_roles',
- name_prefix='group_',
- path_prefix='/api/groups/:group_id',
- parent_resources=dict( member_name='group', collection_name='groups' ) )
+ 'roles',
+ controller='group_roles',
+ name_prefix='group_',
+ path_prefix='/api/groups/:group_id',
+ parent_resources=dict( member_name='group', collection_name='groups' ) )
_add_item_tags_controller( webapp,
name_prefix="history_content_",
path_prefix='/api/histories/:history_id/contents/:history_content_id' )
@@ -173,17 +170,17 @@
name_prefix="workflow_",
path_prefix='/api/workflows/:workflow_id' )
_add_item_annotation_controller( webapp,
- name_prefix="history_content_",
- path_prefix='/api/histories/:history_id/contents/:history_content_id' )
+ name_prefix="history_content_",
+ path_prefix='/api/histories/:history_id/contents/:history_content_id' )
_add_item_annotation_controller( webapp,
- name_prefix="history_",
- path_prefix='/api/histories/:history_id' )
+ name_prefix="history_",
+ path_prefix='/api/histories/:history_id' )
_add_item_annotation_controller( webapp,
- name_prefix="workflow_",
- path_prefix='/api/workflows/:workflow_id' )
+ name_prefix="workflow_",
+ path_prefix='/api/workflows/:workflow_id' )
_add_item_provenance_controller( webapp,
- name_prefix="history_content_",
- path_prefix='/api/histories/:history_id/contents/:history_content_id' )
+ name_prefix="history_content_",
+ path_prefix='/api/histories/:history_id/contents/:history_content_id' )
webapp.mapper.resource( 'dataset', 'datasets', path_prefix='/api' )
webapp.mapper.resource( 'tool_data', 'tool_data', path_prefix='/api' )
@@ -216,27 +213,28 @@
webapp.mapper.resource( 'datatype',
'datatypes',
path_prefix='/api',
- collection={ 'sniffers': 'GET', 'mapping' : 'GET', 'converters': 'GET' },
+ collection={ 'sniffers': 'GET', 'mapping': 'GET', 'converters': 'GET' },
parent_resources=dict( member_name='datatype', collection_name='datatypes' ) )
- #webapp.mapper.connect( 'run_workflow', '/api/workflow/{workflow_id}/library/{library_id}', controller='workflows', action='run', workflow_id=None, library_id=None, conditions=dict(method=["GET"]) )
webapp.mapper.resource( 'search', 'search', path_prefix='/api' )
webapp.mapper.resource( 'page', 'pages', path_prefix="/api")
webapp.mapper.resource( 'revision', 'revisions',
- path_prefix='/api/pages/:page_id',
- controller='page_revisions',
- parent_resources=dict( member_name='page', collection_name='pages' ) )
+ path_prefix='/api/pages/:page_id',
+ controller='page_revisions',
+ parent_resources=dict( member_name='page', collection_name='pages' ) )
- webapp.mapper.connect( "history_archive_export", "/api/histories/{id}/exports",
- controller="histories", action="archive_export", conditions=dict( method=[ "PUT" ] ) )
- webapp.mapper.connect( "history_archive_download", "/api/histories/{id}/exports/{jeha_id}",
- controller="histories", action="archive_download", conditions=dict( method=[ "GET" ] ) )
+ webapp.mapper.connect( "history_archive_export",
+ "/api/histories/{id}/exports", controller="histories",
+ action="archive_export", conditions=dict( method=[ "PUT" ] ) )
+ webapp.mapper.connect( "history_archive_download",
+ "/api/histories/{id}/exports/{jeha_id}", controller="histories",
+ action="archive_download", conditions=dict( method=[ "GET" ] ) )
webapp.mapper.connect( "create_api_key", "/api/users/:user_id/api_key",
- controller="users", action="api_key", user_id=None, conditions=dict( method=["POST"] ) )
+ controller="users", action="api_key", user_id=None,
+ conditions=dict( method=["POST"] ) )
# visualizations registry generic template renderer
- webapp.add_route( '/visualization/show/:visualization_name',
- controller='visualization', action='render', visualization_name=None )
+ webapp.add_route( '/visualization/show/:visualization_name', controller='visualization', action='render', visualization_name=None )
# Deprecated in favor of POST /api/workflows with 'workflow' in payload.
webapp.mapper.connect( 'import_workflow_deprecated', '/api/workflows/upload', controller='workflows', action='import_new_workflow_deprecated', conditions=dict( method=['POST'] ) )
@@ -446,8 +444,8 @@
parent_resources=dict( member_name="job", collection_name="jobs" ) )
_add_item_extended_metadata_controller( webapp,
- name_prefix="history_dataset_",
- path_prefix='/api/histories/:history_id/contents/:history_content_id' )
+ name_prefix="history_dataset_",
+ path_prefix='/api/histories/:history_id/contents/:history_content_id' )
# ====================
# ===== TOOLSHED =====
@@ -463,46 +461,46 @@
# Galaxy API for tool shed features.
webapp.mapper.resource( 'tool_shed_repository',
'tool_shed_repositories',
- member={ 'repair_repository_revision' : 'POST',
- 'exported_workflows' : 'GET',
- 'import_workflow' : 'POST',
- 'import_workflows' : 'POST' },
- collection={ 'get_latest_installable_revision' : 'POST',
- 'reset_metadata_on_installed_repositories' : 'POST' },
+ member={ 'repair_repository_revision': 'POST',
+ 'exported_workflows': 'GET',
+ 'import_workflow': 'POST',
+ 'import_workflows': 'POST' },
+ collection={ 'get_latest_installable_revision': 'POST',
+ 'reset_metadata_on_installed_repositories': 'POST' },
controller='tool_shed_repositories',
name_prefix='tool_shed_repository_',
path_prefix='/api',
- new={ 'install_repository_revision' : 'POST' },
+ new={ 'install_repository_revision': 'POST' },
parent_resources=dict( member_name='tool_shed_repository', collection_name='tool_shed_repositories' ) )
-
# ==== Trace/Metrics Logger
# Connect logger from app
if app.trace_logger:
webapp.trace_logger = app.trace_logger
# metrics logging API
- #webapp.mapper.connect( "index", "/api/metrics",
+ # webapp.mapper.connect( "index", "/api/metrics",
# controller="metrics", action="index", conditions=dict( method=["GET"] ) )
- #webapp.mapper.connect( "show", "/api/metrics/{id}",
+ # webapp.mapper.connect( "show", "/api/metrics/{id}",
# controller="metrics", action="show", conditions=dict( method=["GET"] ) )
- webapp.mapper.connect( "create", "/api/metrics",
- controller="metrics", action="create", conditions=dict( method=["POST"] ) )
+ webapp.mapper.connect( "create", "/api/metrics", controller="metrics",
+ action="create", conditions=dict( method=["POST"] ) )
def pack_scripts():
from glob import glob
from subprocess import call
cmd = "java -jar scripts/yuicompressor.jar --type js static/scripts/%(fname)s -o static/scripts/packed/%(fname)s"
- raw_js= [os.path.basename(g) for g in glob( "static/scripts/*.js" )]
+ raw_js = [os.path.basename(g) for g in glob( "static/scripts/*.js" )]
for fname in raw_js:
if os.path.exists('static/scripts/packed/%s' % fname):
if os.path.getmtime('static/scripts/packed/%s' % fname) > os.path.getmtime('static/scripts/%s' % fname):
- continue # Skip, packed is newer than source.
+ continue # Skip, packed is newer than source.
d = dict( fname=fname )
log.info("%(fname)s --> packed/%(fname)s" % d)
call( cmd % d, shell=True )
+
def _add_item_tags_controller( webapp, name_prefix, path_prefix, **kwd ):
# Not just using map.resources because actions should be based on name not id
controller = "%stags" % name_prefix
@@ -511,24 +509,24 @@
map = webapp.mapper
# Allow view items' tags.
map.connect(name, path,
- controller=controller, action="index",
- conditions=dict(method=["GET"]))
+ controller=controller, action="index",
+ conditions=dict(method=["GET"]))
# Allow remove tag from item
map.connect("%s_delete" % name, "%s/tags/:tag_name" % path_prefix,
- controller=controller, action="delete",
- conditions=dict(method=["DELETE"]))
+ controller=controller, action="delete",
+ conditions=dict(method=["DELETE"]))
# Allow create a new tag with from name
map.connect("%s_create" % name, "%s/tags/:tag_name" % path_prefix,
- controller=controller, action="create",
- conditions=dict(method=["POST"]))
+ controller=controller, action="create",
+ conditions=dict(method=["POST"]))
# Allow update tag value
map.connect("%s_update" % name, "%s/tags/:tag_name" % path_prefix,
- controller=controller, action="update",
- conditions=dict(method=["PUT"]))
+ controller=controller, action="update",
+ conditions=dict(method=["PUT"]))
# Allow show tag by name
map.connect("%s_show" % name, "%s/tags/:tag_name" % path_prefix,
- controller=controller, action="show",
- conditions=dict(method=["GET"]))
+ controller=controller, action="show",
+ conditions=dict(method=["GET"]))
def _add_item_extended_metadata_controller( webapp, name_prefix, path_prefix, **kwd ):
@@ -536,11 +534,13 @@
name = "%sextended_metadata" % name_prefix
webapp.mapper.resource(name, "extended_metadata", path_prefix=path_prefix, controller=controller)
+
def _add_item_annotation_controller( webapp, name_prefix, path_prefix, **kwd ):
controller = "%sannotations" % name_prefix
name = "%sannotation" % name_prefix
webapp.mapper.resource(name, "annotation", path_prefix=path_prefix, controller=controller)
+
def _add_item_provenance_controller( webapp, name_prefix, path_prefix, **kwd ):
controller = "%sprovenance" % name_prefix
name = "%sprovenance" % name_prefix
@@ -566,11 +566,11 @@
# upstream server
if asbool(conf.get( 'use_remote_user', False )):
from galaxy.web.framework.middleware.remoteuser import RemoteUser
- app = RemoteUser( app, maildomain = conf.get( 'remote_user_maildomain', None ),
- display_servers = util.listify( conf.get( 'display_servers', '' ) ),
- admin_users = conf.get( 'admin_users', '' ).split( ',' ),
- remote_user_header = conf.get( 'remote_user_header', 'HTTP_REMOTE_USER' ),
- remote_user_secret_header = conf.get('remote_user_secret', None) )
+ app = RemoteUser( app, maildomain=conf.get( 'remote_user_maildomain', None ),
+ display_servers=util.listify( conf.get( 'display_servers', '' ) ),
+ admin_users=conf.get( 'admin_users', '' ).split( ',' ),
+ remote_user_header=conf.get( 'remote_user_header', 'HTTP_REMOTE_USER' ),
+ remote_user_secret_header=conf.get('remote_user_secret', None) )
# The recursive middleware allows for including requests in other
# requests or forwarding of requests, all on the server side.
if asbool(conf.get('use_recursive', True)):
@@ -626,6 +626,7 @@
log.debug( "Enabling 'Request ID' middleware" )
return app
+
def wrap_in_static( app, global_conf, plugin_frameworks=None, **local_conf ):
from galaxy.web.framework.middleware.static import CacheableStaticURLParser as Static
urlmap, cache_time = galaxy.web.framework.webapp.build_url_map( app, global_conf, local_conf )
@@ -642,6 +643,7 @@
# URL mapper becomes the root webapp
return urlmap
+
def build_template_error_formatters():
"""
Build a list of template error formatters for WebError. When an error
@@ -651,6 +653,7 @@
formatters = []
# Formatter for mako
import mako.exceptions
+
def mako_html_data( exc_value ):
if isinstance( exc_value, ( mako.exceptions.CompileException, mako.exceptions.SyntaxException ) ):
return mako.exceptions.html_error_template().render( full=False, css=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: dannon: Prevent uwsgi from ever loading static middleware -- it can serve static files directly with appropriate routes in its config (see wiki).
by commits-noreply@bitbucket.org 05 Feb '15
by commits-noreply@bitbucket.org 05 Feb '15
05 Feb '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/cca00d61df85/
Changeset: cca00d61df85
User: dannon
Date: 2015-02-05 14:35:36+00:00
Summary: Prevent uwsgi from ever loading static middleware -- it can serve static files directly with appropriate routes in its config (see wiki).
Affected #: 1 file
diff -r 1989401bb9009e76fbaaafdeeffa68c0f12959ab -r cca00d61df85a6ecd1be49265f0c92e7482b91f9 lib/galaxy/webapps/galaxy/buildapp.py
--- a/lib/galaxy/webapps/galaxy/buildapp.py
+++ b/lib/galaxy/webapps/galaxy/buildapp.py
@@ -86,9 +86,24 @@
# Wrap the webapp in some useful middleware
if kwargs.get( 'middleware', True ):
webapp = wrap_in_middleware( webapp, global_conf, **kwargs )
- if asbool( kwargs.get( 'static_enabled', True ) ):
- webapp = wrap_in_static( webapp, global_conf, plugin_frameworks=[ app.visualizations_registry ], **kwargs )
- #webapp = wrap_in_static( webapp, global_conf, plugin_frameworks=None, **kwargs )
+ # TEST FOR UWSGI -- TODO save this somewhere so we only have to do it once.
+ is_uwsgi = False
+ try:
+ # The uwsgi module is automatically injected by the parent uwsgi
+ # process and only exists that way. If anything works, this is a
+ # uwsgi-managed process.
+ import uwsgi
+ is_uwsgi = uwsgi.numproc
+ is_uwsgi = True
+ except ImportError:
+ # This is not a uwsgi process, or something went horribly wrong.
+ pass
+ if asbool( kwargs.get( 'static_enabled', True) ):
+ if is_uwsgi:
+ log.error("Static middleware is enabled in your configuration but this is a uwsgi process. Refusing to wrap in static middleware.")
+ else:
+ webapp = wrap_in_static( webapp, global_conf, plugin_frameworks=[ app.visualizations_registry ], **kwargs )
+ #webapp = wrap_in_static( webapp, global_conf, plugin_frameworks=None, **kwargs )
if asbool(kwargs.get('pack_scripts', False)):
log.warn( "The 'pack_scripts' option is deprecated" )
pack_scripts()
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: dannon: Fixed typo'd require for lunr.
by commits-noreply@bitbucket.org 05 Feb '15
by commits-noreply@bitbucket.org 05 Feb '15
05 Feb '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/1989401bb900/
Changeset: 1989401bb900
User: dannon
Date: 2015-02-05 13:38:14+00:00
Summary: Fixed typo'd require for lunr.
Affected #: 3 files
diff -r 19079eea7d2285d701866b0df77beeff20a677e8 -r 1989401bb9009e76fbaaafdeeffa68c0f12959ab client/galaxy/scripts/mvc/tools.js
--- a/client/galaxy/scripts/mvc/tools.js
+++ b/client/galaxy/scripts/mvc/tools.js
@@ -2,7 +2,7 @@
* Model, view, and controller objects for Galaxy tools and tool panel.
*/
- define( ["libs/underscore", "viz/trackster/util", "mvc/data", "libs/lunr.js" ],
+ define( ["libs/underscore", "viz/trackster/util", "mvc/data", "libs/lunr" ],
function(_, util, data) {
/**
diff -r 19079eea7d2285d701866b0df77beeff20a677e8 -r 1989401bb9009e76fbaaafdeeffa68c0f12959ab static/scripts/mvc/tools.js
--- a/static/scripts/mvc/tools.js
+++ b/static/scripts/mvc/tools.js
@@ -2,7 +2,7 @@
* Model, view, and controller objects for Galaxy tools and tool panel.
*/
- define( ["libs/underscore", "viz/trackster/util", "mvc/data", "libs/lunr.js" ],
+ define( ["libs/underscore", "viz/trackster/util", "mvc/data", "libs/lunr" ],
function(_, util, data) {
/**
diff -r 19079eea7d2285d701866b0df77beeff20a677e8 -r 1989401bb9009e76fbaaafdeeffa68c0f12959ab static/scripts/packed/mvc/tools.js
--- a/static/scripts/packed/mvc/tools.js
+++ b/static/scripts/packed/mvc/tools.js
@@ -1,1 +1,1 @@
-define(["libs/underscore","viz/trackster/util","mvc/data","libs/lunr.js"],function(x,a,y){var g={hidden:false,show:function(){this.set("hidden",false)},hide:function(){this.set("hidden",true)},toggle:function(){this.set("hidden",!this.get("hidden"))},is_visible:function(){return !this.attributes.hidden}};var e=Backbone.Model.extend({defaults:{name:null,label:null,type:null,value:null,html:null,num_samples:5},initialize:function(z){this.attributes.html=unescape(this.attributes.html)},copy:function(){return new e(this.toJSON())},set_value:function(z){this.set("value",z||"")}});var i=Backbone.Collection.extend({model:e});var k=e.extend({});var d=e.extend({set_value:function(z){this.set("value",parseInt(z,10))},get_samples:function(){return d3.scale.linear().domain([this.get("min"),this.get("max")]).ticks(this.get("num_samples"))}});var f=d.extend({set_value:function(z){this.set("value",parseFloat(z))}});var t=e.extend({get_samples:function(){return x.map(this.get("options"),function(z){return z[0]})}});e.subModelTypes={integer:d,"float":f,data:k,select:t};var j=Backbone.Model.extend({defaults:{id:null,name:null,description:null,target:null,inputs:[],outputs:[]},urlRoot:galaxy_config.root+"api/tools",initialize:function(z){this.set("inputs",new i(x.map(z.inputs,function(A){var B=e.subModelTypes[A.type]||e;return new B(A)})))},toJSON:function(){var z=Backbone.Model.prototype.toJSON.call(this);z.inputs=this.get("inputs").map(function(A){return A.toJSON()});return z},remove_inputs:function(A){var z=this,B=z.get("inputs").filter(function(C){return(A.indexOf(C.get("type"))!==-1)});z.get("inputs").remove(B)},copy:function(A){var B=new j(this.toJSON());if(A){var z=new Backbone.Collection();B.get("inputs").each(function(C){if(C.get_samples()){z.push(C)}});B.set("inputs",z)}return B},apply_search_results:function(z){(x.indexOf(z,this.attributes.id)!==-1?this.show():this.hide());return this.is_visible()},set_input_value:function(z,A){this.get("inputs").find(function(B){return B.get("name")===z}).set("value",A)},set_input_values:function(A){var z=this;x.each(x.keys(A),function(B){z.set_input_value(B,A[B])})},run:function(){return this._run()},rerun:function(A,z){return this._run({action:"rerun",target_dataset_id:A.id,regions:z})},get_inputs_dict:function(){var z={};this.get("inputs").each(function(A){z[A.get("name")]=A.get("value")});return z},_run:function(B){var C=x.extend({tool_id:this.id,inputs:this.get_inputs_dict()},B);var A=$.Deferred(),z=new a.ServerStateDeferred({ajax_settings:{url:this.urlRoot,data:JSON.stringify(C),dataType:"json",contentType:"application/json",type:"POST"},interval:2000,success_fn:function(D){return D!=="pending"}});$.when(z.go()).then(function(D){A.resolve(new y.DatasetCollection().reset(D))});return A}});x.extend(j.prototype,g);var q=Backbone.View.extend({});var n=Backbone.Collection.extend({model:j});var v=Backbone.Model.extend(g);var l=Backbone.Model.extend({defaults:{elems:[],open:false},clear_search_results:function(){x.each(this.attributes.elems,function(z){z.show()});this.show();this.set("open",false)},apply_search_results:function(A){var B=true,z;x.each(this.attributes.elems,function(C){if(C instanceof v){z=C;z.hide()}else{if(C instanceof j){if(C.apply_search_results(A)){B=false;if(z){z.show()}}}}});if(B){this.hide()}else{this.show();this.set("open",true)}}});x.extend(l.prototype,g);var c=Backbone.Model.extend({defaults:{search_hint_string:"search tools",min_chars_for_search:3,spinner_url:"",clear_btn_url:"",search_url:"",visible:true,query:"",results:null,clear_key:27},initialize:function(){this.on("change:query",this.do_search)},do_search:function(){var B=this.attributes.query;if(B.length<this.attributes.min_chars_for_search){this.set("results",null);return}var A=B+"*";if(this.timer){clearTimeout(this.timer)}$("#search-clear-btn").hide();$("#search-spinner").show();var z=this;this.timer=setTimeout(function(){$.get(z.attributes.search_url,{query:A},function(C){z.set("results",C);$("#search-spinner").hide();$("#search-clear-btn").show()},"json")},200)},clear_search:function(){this.set("query","");this.set("results",null)}});x.extend(c.prototype,g);var o=Backbone.Model.extend({initialize:function(z){this.attributes.tool_search=z.tool_search;this.attributes.tool_search.on("change:results",this.apply_search_results,this);this.attributes.tools=z.tools;this.attributes.layout=new Backbone.Collection(this.parse(z.layout))},parse:function(A){var z=this,B=function(E){var D=E.model_class;if(D.indexOf("Tool")===D.length-4){return z.attributes.tools.get(E.id)}else{if(D==="ToolSection"){var C=x.map(E.elems,B);E.elems=C;return new l(E)}else{if(D==="ToolSectionLabel"){return new v(E)}}}};return x.map(A,B)},clear_search_results:function(){this.get("layout").each(function(z){if(z instanceof l){z.clear_search_results()}else{z.show()}})},apply_search_results:function(){var A=this.get("tool_search").get("results");if(A===null){this.clear_search_results();return}var z=null;this.get("layout").each(function(B){if(B instanceof v){z=B;z.hide()}else{if(B instanceof j){if(B.apply_search_results(A)){if(z){z.show()}}}else{z=null;B.apply_search_results(A)}}})}});var s=Backbone.View.extend({initialize:function(){this.model.on("change:hidden",this.update_visible,this);this.update_visible()},update_visible:function(){(this.model.attributes.hidden?this.$el.hide():this.$el.show())}});var m=s.extend({tagName:"div",render:function(){var z=$("<div/>");z.append(Handlebars.templates.tool_link(this.model.toJSON()));if(this.model.id==="upload1"){z.find("a").on("click",function(A){A.preventDefault();Galaxy.upload.show()})}this.$el.append(z);return this}});var b=s.extend({tagName:"div",className:"toolPanelLabel",render:function(){this.$el.append($("<span/>").text(this.model.attributes.text));return this}});var r=s.extend({tagName:"div",className:"toolSectionWrapper",initialize:function(){s.prototype.initialize.call(this);this.model.on("change:open",this.update_open,this)},render:function(){this.$el.append(Handlebars.templates.panel_section(this.model.toJSON()));var z=this.$el.find(".toolSectionBody");x.each(this.model.attributes.elems,function(A){if(A instanceof j){var B=new m({model:A,className:"toolTitle"});B.render();z.append(B.$el)}else{if(A instanceof v){var C=new b({model:A});C.render();z.append(C.$el)}else{}}});return this},events:{"click .toolSectionTitle > a":"toggle"},toggle:function(){this.model.set("open",!this.model.attributes.open)},update_open:function(){(this.model.attributes.open?this.$el.children(".toolSectionBody").slideDown("fast"):this.$el.children(".toolSectionBody").slideUp("fast"))}});var p=Backbone.View.extend({tagName:"div",id:"tool-search",className:"bar",events:{click:"focus_and_select","keyup :input":"query_changed","click #search-clear-btn":"clear"},render:function(){this.$el.append(Handlebars.templates.tool_search(this.model.toJSON()));if(!this.model.is_visible()){this.$el.hide()}this.$el.find("[title]").tooltip();return this},focus_and_select:function(){this.$el.find(":input").focus().select()},clear:function(){this.model.clear_search();this.$el.find(":input").val(this.model.attributes.search_hint_string);this.focus_and_select();return false},query_changed:function(z){if((this.model.attributes.clear_key)&&(this.model.attributes.clear_key===z.which)){this.clear();return false}this.model.set("query",this.$el.find(":input").val())}});var w=Backbone.View.extend({tagName:"div",className:"toolMenu",initialize:function(){this.model.get("tool_search").on("change:results",this.handle_search_results,this)},render:function(){var z=this;var A=new p({model:this.model.get("tool_search")});A.render();z.$el.append(A.$el);this.model.get("layout").each(function(C){if(C instanceof l){var B=new r({model:C});B.render();z.$el.append(B.$el)}else{if(C instanceof j){var D=new m({model:C,className:"toolTitleNoSection"});D.render();z.$el.append(D.$el)}else{if(C instanceof v){var E=new b({model:C});E.render();z.$el.append(E.$el)}}}});z.$el.find("a.tool-link").click(function(D){var C=$(this).attr("class").split(/\s+/)[0],B=z.model.get("tools").get(C);z.trigger("tool_link_click",D,B)});return this},handle_search_results:function(){var z=this.model.get("tool_search").get("results");if(z&&z.length===0){$("#search-no-results").show()}else{$("#search-no-results").hide()}}});var u=Backbone.View.extend({className:"toolForm",render:function(){this.$el.children().remove();this.$el.append(Handlebars.templates.tool_form(this.model.toJSON()))}});var h=Backbone.View.extend({className:"toolMenuAndView",initialize:function(){this.tool_panel_view=new w({collection:this.collection});this.tool_form_view=new u()},render:function(){this.tool_panel_view.render();this.tool_panel_view.$el.css("float","left");this.$el.append(this.tool_panel_view.$el);this.tool_form_view.$el.hide();this.$el.append(this.tool_form_view.$el);var z=this;this.tool_panel_view.on("tool_link_click",function(B,A){B.preventDefault();z.show_tool(A)})},show_tool:function(A){var z=this;A.fetch().done(function(){z.tool_form_view.model=A;z.tool_form_view.render();z.tool_form_view.$el.show();$("#left").width("650px")})}});return{ToolParameter:e,IntegerToolParameter:d,SelectToolParameter:t,Tool:j,ToolCollection:n,ToolSearch:c,ToolPanel:o,ToolPanelView:w,ToolFormView:u}});
\ No newline at end of file
+define(["libs/underscore","viz/trackster/util","mvc/data","libs/lunr"],function(x,a,y){var g={hidden:false,show:function(){this.set("hidden",false)},hide:function(){this.set("hidden",true)},toggle:function(){this.set("hidden",!this.get("hidden"))},is_visible:function(){return !this.attributes.hidden}};var e=Backbone.Model.extend({defaults:{name:null,label:null,type:null,value:null,html:null,num_samples:5},initialize:function(z){this.attributes.html=unescape(this.attributes.html)},copy:function(){return new e(this.toJSON())},set_value:function(z){this.set("value",z||"")}});var i=Backbone.Collection.extend({model:e});var k=e.extend({});var d=e.extend({set_value:function(z){this.set("value",parseInt(z,10))},get_samples:function(){return d3.scale.linear().domain([this.get("min"),this.get("max")]).ticks(this.get("num_samples"))}});var f=d.extend({set_value:function(z){this.set("value",parseFloat(z))}});var t=e.extend({get_samples:function(){return x.map(this.get("options"),function(z){return z[0]})}});e.subModelTypes={integer:d,"float":f,data:k,select:t};var j=Backbone.Model.extend({defaults:{id:null,name:null,description:null,target:null,inputs:[],outputs:[]},urlRoot:galaxy_config.root+"api/tools",initialize:function(z){this.set("inputs",new i(x.map(z.inputs,function(A){var B=e.subModelTypes[A.type]||e;return new B(A)})))},toJSON:function(){var z=Backbone.Model.prototype.toJSON.call(this);z.inputs=this.get("inputs").map(function(A){return A.toJSON()});return z},remove_inputs:function(A){var z=this,B=z.get("inputs").filter(function(C){return(A.indexOf(C.get("type"))!==-1)});z.get("inputs").remove(B)},copy:function(A){var B=new j(this.toJSON());if(A){var z=new Backbone.Collection();B.get("inputs").each(function(C){if(C.get_samples()){z.push(C)}});B.set("inputs",z)}return B},apply_search_results:function(z){(x.indexOf(z,this.attributes.id)!==-1?this.show():this.hide());return this.is_visible()},set_input_value:function(z,A){this.get("inputs").find(function(B){return B.get("name")===z}).set("value",A)},set_input_values:function(A){var z=this;x.each(x.keys(A),function(B){z.set_input_value(B,A[B])})},run:function(){return this._run()},rerun:function(A,z){return this._run({action:"rerun",target_dataset_id:A.id,regions:z})},get_inputs_dict:function(){var z={};this.get("inputs").each(function(A){z[A.get("name")]=A.get("value")});return z},_run:function(B){var C=x.extend({tool_id:this.id,inputs:this.get_inputs_dict()},B);var A=$.Deferred(),z=new a.ServerStateDeferred({ajax_settings:{url:this.urlRoot,data:JSON.stringify(C),dataType:"json",contentType:"application/json",type:"POST"},interval:2000,success_fn:function(D){return D!=="pending"}});$.when(z.go()).then(function(D){A.resolve(new y.DatasetCollection().reset(D))});return A}});x.extend(j.prototype,g);var q=Backbone.View.extend({});var n=Backbone.Collection.extend({model:j});var v=Backbone.Model.extend(g);var l=Backbone.Model.extend({defaults:{elems:[],open:false},clear_search_results:function(){x.each(this.attributes.elems,function(z){z.show()});this.show();this.set("open",false)},apply_search_results:function(A){var B=true,z;x.each(this.attributes.elems,function(C){if(C instanceof v){z=C;z.hide()}else{if(C instanceof j){if(C.apply_search_results(A)){B=false;if(z){z.show()}}}}});if(B){this.hide()}else{this.show();this.set("open",true)}}});x.extend(l.prototype,g);var c=Backbone.Model.extend({defaults:{search_hint_string:"search tools",min_chars_for_search:3,spinner_url:"",clear_btn_url:"",search_url:"",visible:true,query:"",results:null,clear_key:27},initialize:function(){this.on("change:query",this.do_search)},do_search:function(){var B=this.attributes.query;if(B.length<this.attributes.min_chars_for_search){this.set("results",null);return}var A=B+"*";if(this.timer){clearTimeout(this.timer)}$("#search-clear-btn").hide();$("#search-spinner").show();var z=this;this.timer=setTimeout(function(){$.get(z.attributes.search_url,{query:A},function(C){z.set("results",C);$("#search-spinner").hide();$("#search-clear-btn").show()},"json")},200)},clear_search:function(){this.set("query","");this.set("results",null)}});x.extend(c.prototype,g);var o=Backbone.Model.extend({initialize:function(z){this.attributes.tool_search=z.tool_search;this.attributes.tool_search.on("change:results",this.apply_search_results,this);this.attributes.tools=z.tools;this.attributes.layout=new Backbone.Collection(this.parse(z.layout))},parse:function(A){var z=this,B=function(E){var D=E.model_class;if(D.indexOf("Tool")===D.length-4){return z.attributes.tools.get(E.id)}else{if(D==="ToolSection"){var C=x.map(E.elems,B);E.elems=C;return new l(E)}else{if(D==="ToolSectionLabel"){return new v(E)}}}};return x.map(A,B)},clear_search_results:function(){this.get("layout").each(function(z){if(z instanceof l){z.clear_search_results()}else{z.show()}})},apply_search_results:function(){var A=this.get("tool_search").get("results");if(A===null){this.clear_search_results();return}var z=null;this.get("layout").each(function(B){if(B instanceof v){z=B;z.hide()}else{if(B instanceof j){if(B.apply_search_results(A)){if(z){z.show()}}}else{z=null;B.apply_search_results(A)}}})}});var s=Backbone.View.extend({initialize:function(){this.model.on("change:hidden",this.update_visible,this);this.update_visible()},update_visible:function(){(this.model.attributes.hidden?this.$el.hide():this.$el.show())}});var m=s.extend({tagName:"div",render:function(){var z=$("<div/>");z.append(Handlebars.templates.tool_link(this.model.toJSON()));if(this.model.id==="upload1"){z.find("a").on("click",function(A){A.preventDefault();Galaxy.upload.show()})}this.$el.append(z);return this}});var b=s.extend({tagName:"div",className:"toolPanelLabel",render:function(){this.$el.append($("<span/>").text(this.model.attributes.text));return this}});var r=s.extend({tagName:"div",className:"toolSectionWrapper",initialize:function(){s.prototype.initialize.call(this);this.model.on("change:open",this.update_open,this)},render:function(){this.$el.append(Handlebars.templates.panel_section(this.model.toJSON()));var z=this.$el.find(".toolSectionBody");x.each(this.model.attributes.elems,function(A){if(A instanceof j){var B=new m({model:A,className:"toolTitle"});B.render();z.append(B.$el)}else{if(A instanceof v){var C=new b({model:A});C.render();z.append(C.$el)}else{}}});return this},events:{"click .toolSectionTitle > a":"toggle"},toggle:function(){this.model.set("open",!this.model.attributes.open)},update_open:function(){(this.model.attributes.open?this.$el.children(".toolSectionBody").slideDown("fast"):this.$el.children(".toolSectionBody").slideUp("fast"))}});var p=Backbone.View.extend({tagName:"div",id:"tool-search",className:"bar",events:{click:"focus_and_select","keyup :input":"query_changed","click #search-clear-btn":"clear"},render:function(){this.$el.append(Handlebars.templates.tool_search(this.model.toJSON()));if(!this.model.is_visible()){this.$el.hide()}this.$el.find("[title]").tooltip();return this},focus_and_select:function(){this.$el.find(":input").focus().select()},clear:function(){this.model.clear_search();this.$el.find(":input").val(this.model.attributes.search_hint_string);this.focus_and_select();return false},query_changed:function(z){if((this.model.attributes.clear_key)&&(this.model.attributes.clear_key===z.which)){this.clear();return false}this.model.set("query",this.$el.find(":input").val())}});var w=Backbone.View.extend({tagName:"div",className:"toolMenu",initialize:function(){this.model.get("tool_search").on("change:results",this.handle_search_results,this)},render:function(){var z=this;var A=new p({model:this.model.get("tool_search")});A.render();z.$el.append(A.$el);this.model.get("layout").each(function(C){if(C instanceof l){var B=new r({model:C});B.render();z.$el.append(B.$el)}else{if(C instanceof j){var D=new m({model:C,className:"toolTitleNoSection"});D.render();z.$el.append(D.$el)}else{if(C instanceof v){var E=new b({model:C});E.render();z.$el.append(E.$el)}}}});z.$el.find("a.tool-link").click(function(D){var C=$(this).attr("class").split(/\s+/)[0],B=z.model.get("tools").get(C);z.trigger("tool_link_click",D,B)});return this},handle_search_results:function(){var z=this.model.get("tool_search").get("results");if(z&&z.length===0){$("#search-no-results").show()}else{$("#search-no-results").hide()}}});var u=Backbone.View.extend({className:"toolForm",render:function(){this.$el.children().remove();this.$el.append(Handlebars.templates.tool_form(this.model.toJSON()))}});var h=Backbone.View.extend({className:"toolMenuAndView",initialize:function(){this.tool_panel_view=new w({collection:this.collection});this.tool_form_view=new u()},render:function(){this.tool_panel_view.render();this.tool_panel_view.$el.css("float","left");this.$el.append(this.tool_panel_view.$el);this.tool_form_view.$el.hide();this.$el.append(this.tool_form_view.$el);var z=this;this.tool_panel_view.on("tool_link_click",function(B,A){B.preventDefault();z.show_tool(A)})},show_tool:function(A){var z=this;A.fetch().done(function(){z.tool_form_view.model=A;z.tool_form_view.render();z.tool_form_view.$el.show();$("#left").width("650px")})}});return{ToolParameter:e,IntegerToolParameter:d,SelectToolParameter:t,Tool:j,ToolCollection:n,ToolSearch:c,ToolPanel:o,ToolPanelView:w,ToolFormView:u}});
\ 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