2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/bd450366fc9d/ Changeset: bd450366fc9d User: jmchilton Date: 2014-09-09 22:41:34 Summary: Pull separate missing tools template out of run.mako. If you look at the conflicting sets of parameters these templates require I think it makes more sense to separate them this way - think result is simpler. Likewise, no need to for instance show collapse/expand all buttons on page with no actual rows for steps for instance. Most important thing here though is that now one can assume that step.module and step.state are available for all steps throughout run.mako (this will lead to further simplications). Affected #: 3 files diff -r 74b2495de918c95730f1f2fd2ac1bf502018a99f -r bd450366fc9da736c46358e6a827496c5c58d174 lib/galaxy/webapps/galaxy/controllers/workflow.py --- a/lib/galaxy/webapps/galaxy/controllers/workflow.py +++ b/lib/galaxy/webapps/galaxy/controllers/workflow.py @@ -1351,10 +1351,8 @@ if missing_tools: stored.annotation = self.get_item_annotation_str( trans.sa_session, trans.user, stored ) return trans.fill_template( - "workflow/run.mako", - steps=[], + "workflow/missing_tools.mako", workflow=stored, - hide_fixed_params=hide_fixed_params, missing_tools=missing_tools ) # Render the form diff -r 74b2495de918c95730f1f2fd2ac1bf502018a99f -r bd450366fc9da736c46358e6a827496c5c58d174 templates/webapps/galaxy/workflow/missing_tools.mako --- /dev/null +++ b/templates/webapps/galaxy/workflow/missing_tools.mako @@ -0,0 +1,17 @@ +<%inherit file="/base.mako"/> + +<h2>Cannot run workflow "${h.to_unicode( workflow.name )}"</h2> + +%if workflow.annotation: + <div class="workflow-annotation">${workflow.annotation}</div> + <hr/> +%endif + +<div class='errormessage'> + <strong>This workflow utilizes tools which are unavailable, and cannot be run. Enable the tools listed below, or <a href="${h.url_for(controller='workflow', action='editor', id=trans.security.encode_id(workflow.id) )}" target="_parent">edit the workflow</a> to correct these errors.</strong><br/> + <ul> + %for i, tool in enumerate( missing_tools ): + <li>${tool}</li> + %endfor + </ul> +</div> \ No newline at end of file diff -r 74b2495de918c95730f1f2fd2ac1bf502018a99f -r bd450366fc9da736c46358e6a827496c5c58d174 templates/webapps/galaxy/workflow/run.mako --- a/templates/webapps/galaxy/workflow/run.mako +++ b/templates/webapps/galaxy/workflow/run.mako @@ -605,21 +605,11 @@ </div> %endif %endfor -%if missing_tools: - <div class='errormessage'> - <strong>This workflow utilizes tools which are unavailable, and cannot be run. Enable the tools listed below, or <a href="${h.url_for(controller='workflow', action='editor', id=trans.security.encode_id(workflow.id) )}" target="_parent">edit the workflow</a> to correct these errors.</strong><br/> - <ul> - %for i, tool in enumerate( missing_tools ): - <li>${tool}</li> - %endfor - </ul> -%else: - %if history_id is None: -<p id='new_history_p'> - <input type="checkbox" name='new_history' value="true" id='new_history_cbx'/><label for='new_history_cbx'>Send results to a new history </label> - <span id="new_history_input">named: <input type='text' name='new_history_name' value='${ h.to_unicode( workflow.name ) | h }'/></span> -</p> - %endif +%if history_id is None: + <p id='new_history_p'> + <input type="checkbox" name='new_history' value="true" id='new_history_cbx'/><label for='new_history_cbx'>Send results to a new history </label> + <span id="new_history_input">named: <input type='text' name='new_history_name' value='${ h.to_unicode( workflow.name ) | h }'/></span> + </p> +%endif <input type="submit" class="btn btn-primary" name="run_workflow" value="Run workflow" /></form> -%endif https://bitbucket.org/galaxy/galaxy-central/commits/89ab3ca6171d/ Changeset: 89ab3ca6171d User: jmchilton Date: 2014-09-09 22:41:34 Summary: Unify API for encoding runtime state across tool and input modules. Add some documentation. Affected #: 2 files diff -r bd450366fc9da736c46358e6a827496c5c58d174 -r 89ab3ca6171d10d37d26fb7c50242bd6dcde45d9 lib/galaxy/workflow/modules.py --- a/lib/galaxy/workflow/modules.py +++ b/lib/galaxy/workflow/modules.py @@ -114,6 +114,14 @@ raise TypeError( "Abstract method" ) def encode_runtime_state( self, trans, state ): + """ Encode the runtime state (loaded from the stored step and + populated via the WorkflowModuleInjector below) for use in a hidden + parameter on the webpage. + + This will combined with runtime parameters supplied by user running + the workflow to create the final state to pass along to execute during + workflow invocation. + """ raise TypeError( "Abstract method" ) def decode_runtime_state( self, trans, string ): @@ -460,6 +468,9 @@ return self.trans.fill_template( "workflow/editor_tool_form.mako", tool=self.tool, values=self.state.inputs, errors=( self.errors or {} ) ) + def encode_runtime_state( self, trans, state ): + return state.encode( self.tool, self.trans.app ) + def update_state( self, incoming ): # Build a callback that handles setting an input to be required at # runtime. We still process all other parameters the user might have diff -r bd450366fc9da736c46358e6a827496c5c58d174 -r 89ab3ca6171d10d37d26fb7c50242bd6dcde45d9 templates/webapps/galaxy/workflow/run.mako --- a/templates/webapps/galaxy/workflow/run.mako +++ b/templates/webapps/galaxy/workflow/run.mako @@ -542,11 +542,15 @@ </script> %endif %for i, step in enumerate( steps ): + <!-- Only way module would be missing is if tool is missing, but + that would cause missing_tools.mako to render instead of this + template. --> + <% module = step.module %> + <input type="hidden" name="${step.id}|tool_state" value="${module.encode_runtime_state( t, step.state )}"> %if step.type == 'tool' or step.type is None: <% tool = trans.app.toolbox.get_tool( step.tool_id ) %> - <input type="hidden" name="${step.id}|tool_state" value="${step.state.encode( tool, app )}"><div class="toolForm"><div class="toolFormTitle"><span class='title_ul_text'>Step ${int(step.order_index)+1}: ${tool.name}</span> @@ -580,8 +584,6 @@ </div></div> %else: - <% module = step.module %> - <input type="hidden" name="${step.id}|tool_state" value="${module.encode_runtime_state( t, step.state )}"><div class="toolForm"><div class="toolFormTitle"><span class='title_ul_text'>Step ${int(step.order_index)+1}: ${module.name}</span> 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.