10 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/955d18fc07d5/ changeset: 955d18fc07d5 user: fbacall date: 2012-03-26 14:40:42 summary: Made myExperiment URL configurable affected #: 2 files diff -r 4a23e38b7a12d65b50ff274272305f89fb5d0309 -r 955d18fc07d52cb38b6d4e34992112527c2a4f52 lib/galaxy/web/controllers/workflow.py --- a/lib/galaxy/web/controllers/workflow.py +++ b/lib/galaxy/web/controllers/workflow.py @@ -986,7 +986,7 @@ """ # Get workflow XML. # Get workflow content. - conn = httplib.HTTPConnection( self.__myexp_url ) + conn = httplib.HTTPConnection( trans.app.config.get( "myexperiment_url", self.__myexp_url ) ) # NOTE: blocks web thread. headers = {} if myexp_username and myexp_password: @@ -1055,7 +1055,7 @@ # Do request and get result. auth_header = base64.b64encode( '%s:%s' % ( myexp_username, myexp_password )) headers = { "Content-type": "text/xml", "Accept": "text/xml", "Authorization" : "Basic %s" % auth_header } - conn = httplib.HTTPConnection( self.__myexp_url ) + conn = httplib.HTTPConnection( trans.app.config.get( "myexperiment_url", self.__myexp_url ) ) # NOTE: blocks web thread. conn.request("POST", "/workflow.xml", request, headers) response = conn.getresponse() diff -r 4a23e38b7a12d65b50ff274272305f89fb5d0309 -r 955d18fc07d52cb38b6d4e34992112527c2a4f52 universe_wsgi.ini.sample --- a/universe_wsgi.ini.sample +++ b/universe_wsgi.ini.sample @@ -653,6 +653,9 @@ #pbs_stage_path = #pbs_dataset_server = +# The URL to the myExperiment instance being used (omit scheme but include port) +myexperiment_url = www.myexperiment.org:80 + # ---- Tool Job Runners ----------------------------------------------------- # Individual per-tool job runner overrides. Parameters can be included to define https://bitbucket.org/galaxy/galaxy-central/changeset/3ac664d53a15/ changeset: 3ac664d53a15 user: fbacall date: 2012-03-26 14:47:06 summary: Added link to myExperiment on the import_workflow page affected #: 2 files diff -r 955d18fc07d52cb38b6d4e34992112527c2a4f52 -r 3ac664d53a15f1ea0995b9277a783990cd739220 lib/galaxy/web/controllers/workflow.py --- a/lib/galaxy/web/controllers/workflow.py +++ b/lib/galaxy/web/controllers/workflow.py @@ -1124,6 +1124,9 @@ message = kwd.get( 'message', '' ) status = kwd.get( 'status', 'done' ) import_button = kwd.get( 'import_button', False ) + # The special Galaxy integration landing page's URL on myExperiment + myexperiment_target_url = 'http://%s/galaxy?galaxy_url=%s' % \ + ( trans.app.config.get( "myexperiment_url", "www.myexperiment.org" ), trans.request.base ) # The following parameters will have values only if the workflow # id being imported from a Galaxy tool shed repository. tool_shed_url = kwd.get( 'tool_shed_url', '' ) @@ -1269,7 +1272,8 @@ url=url, message=message, status=status, - use_panels=True ) + use_panels=True, + myexperiment_target_url=myexperiment_target_url ) @web.json def get_datatypes( self, trans ): ext_to_class_name = dict() diff -r 955d18fc07d52cb38b6d4e34992112527c2a4f52 -r 3ac664d53a15f1ea0995b9277a783990cd739220 templates/workflow/import.mako --- a/templates/workflow/import.mako +++ b/templates/workflow/import.mako @@ -48,6 +48,18 @@ <div style="clear: both"></div></div><div class="form-row"> + <label>Import a Galaxy workflow from myExperiment:</label> + <div class="form-row-input"> + <a href="${h.url_for( myexperiment_target_url )}"> + Visit myExperiment + </a> + </div> + <div class="toolParamHelp" style="clear: both;"> + Click the link above to visit myExperiment and browse for Galaxy workflows. + </div> + <div style="clear: both"></div> + </div> + <div class="form-row"><input type="submit" class="primary-button" name="import_button" value="Import"></div></form> https://bitbucket.org/galaxy/galaxy-central/changeset/f02a38f851cc/ changeset: f02a38f851cc user: fbacall date: 2012-03-26 14:50:35 summary: Changed export feature to export workflow in pure JSON format rather than a XML/JSON hybrid affected #: 1 file diff -r 3ac664d53a15f1ea0995b9277a783990cd739220 -r f02a38f851cc7a5e19538471ff3b782359a1be55 lib/galaxy/web/controllers/workflow.py --- a/lib/galaxy/web/controllers/workflow.py +++ b/lib/galaxy/web/controllers/workflow.py @@ -1037,11 +1037,8 @@ # Create and submit workflow myExperiment request. # - # Create workflow content XML. - workflow_dict_packed = simplejson.dumps( workflow_dict, indent=4, sort_keys=True ) - workflow_content = trans.fill_template( "workflow/myexp_export_content.mako", \ - workflow_dict_packed=workflow_dict_packed, \ - workflow_steps=workflow_dict['steps'] ) + # Create workflow content JSON. + workflow_content = simplejson.dumps( workflow_dict, indent=4, sort_keys=True ) # Create myExperiment request. request_raw = trans.fill_template( "workflow/myexp_export.mako", \ https://bitbucket.org/galaxy/galaxy-central/changeset/2ac9b8cced40/ changeset: 2ac9b8cced40 user: fbacall date: 2012-03-26 14:53:33 summary: Change import_from_myexp feature to understand pure JSON, but have not tested and am not sure this is even used... affected #: 1 file diff -r f02a38f851cc7a5e19538471ff3b782359a1be55 -r 2ac9b8cced40c3f18bc8eb71e03fdf583a7be3db lib/galaxy/web/controllers/workflow.py --- a/lib/galaxy/web/controllers/workflow.py +++ b/lib/galaxy/web/controllers/workflow.py @@ -999,10 +999,8 @@ parser = SingleTagContentsParser( "content" ) parser.feed( workflow_xml ) workflow_content = base64.b64decode( parser.tag_content ) - # Process workflow XML and create workflow. - parser = SingleTagContentsParser( "galaxy_json" ) - parser.feed( workflow_content ) - workflow_dict = from_json_string( parser.tag_content ) + # Process workflow JSON and create workflow. + workflow_dict = from_json_string( workflow_content ) # Create workflow. workflow, missing_tool_tups = self._workflow_from_dict( trans, workflow_dict, source="myExperiment" ).latest_workflow if missing_tool_tups: https://bitbucket.org/galaxy/galaxy-central/changeset/cf086646b83a/ changeset: cf086646b83a user: fbacall date: 2012-03-26 15:14:58 summary: Added extra optional parameter to allow the source of a workflow to be declared on import affected #: 1 file diff -r 2ac9b8cced40c3f18bc8eb71e03fdf583a7be3db -r cf086646b83a6100555f3cc779214db02f98d2b3 lib/galaxy/web/controllers/workflow.py --- a/lib/galaxy/web/controllers/workflow.py +++ b/lib/galaxy/web/controllers/workflow.py @@ -1122,6 +1122,8 @@ # The special Galaxy integration landing page's URL on myExperiment myexperiment_target_url = 'http://%s/galaxy?galaxy_url=%s' % \ ( trans.app.config.get( "myexperiment_url", "www.myexperiment.org" ), trans.request.base ) + # The source of the workflow, used by myExperiment to indicate the workflow came from there. + workflow_source = kwd.get( 'workflow_source', 'uploaded file' ) # The following parameters will have values only if the workflow # id being imported from a Galaxy tool shed repository. tool_shed_url = kwd.get( 'tool_shed_url', '' ) @@ -1192,7 +1194,7 @@ # Galaxy instance, the tool information will be available in the step_dict. src = None if cntrller != 'api': - src="uploaded file" + src = workflow_source workflow, missing_tool_tups = self._workflow_from_dict( trans, data, source=src, add_to_menu=add_to_menu ) workflow = workflow.latest_workflow if workflow_name: https://bitbucket.org/galaxy/galaxy-central/changeset/a6572ba77912/ changeset: a6572ba77912 user: fbacall date: 2012-03-26 15:15:32 summary: Moved link to myExperiment to under the regular import form affected #: 1 file diff -r cf086646b83a6100555f3cc779214db02f98d2b3 -r a6572ba7791208ec23c12c065dbf6a1f461e4320 templates/workflow/import.mako --- a/templates/workflow/import.mako +++ b/templates/workflow/import.mako @@ -48,21 +48,22 @@ <div style="clear: both"></div></div><div class="form-row"> - <label>Import a Galaxy workflow from myExperiment:</label> - <div class="form-row-input"> - <a href="${h.url_for( myexperiment_target_url )}"> - Visit myExperiment - </a> - </div> - <div class="toolParamHelp" style="clear: both;"> - Click the link above to visit myExperiment and browse for Galaxy workflows. - </div> - <div style="clear: both"></div> - </div> - <div class="form-row"><input type="submit" class="primary-button" name="import_button" value="Import"></div></form> + <hr/> + <div class="form-row"> + <label>Import a Galaxy workflow from myExperiment:</label> + <div class="form-row-input"> + <a href="${h.url_for( myexperiment_target_url )}"> + Visit myExperiment + </a> + </div> + <div class="toolParamHelp" style="clear: both;"> + Click the link above to visit myExperiment and browse for Galaxy workflows. + </div> + <div style="clear: both"></div> + </div></div></div></%def> https://bitbucket.org/galaxy/galaxy-central/changeset/822594759b14/ changeset: 822594759b14 user: fbacall date: 2012-03-26 15:27:58 summary: Changed method of getting current Galaxy instance URL affected #: 1 file diff -r a6572ba7791208ec23c12c065dbf6a1f461e4320 -r 822594759b1413101bb6e72b04e928570222bdbb lib/galaxy/web/controllers/workflow.py --- a/lib/galaxy/web/controllers/workflow.py +++ b/lib/galaxy/web/controllers/workflow.py @@ -1121,7 +1121,7 @@ import_button = kwd.get( 'import_button', False ) # The special Galaxy integration landing page's URL on myExperiment myexperiment_target_url = 'http://%s/galaxy?galaxy_url=%s' % \ - ( trans.app.config.get( "myexperiment_url", "www.myexperiment.org" ), trans.request.base ) + ( trans.app.config.get( "myexperiment_url", "www.myexperiment.org" ), url_for('/', qualified=True) ) # The source of the workflow, used by myExperiment to indicate the workflow came from there. workflow_source = kwd.get( 'workflow_source', 'uploaded file' ) # The following parameters will have values only if the workflow https://bitbucket.org/galaxy/galaxy-central/changeset/6ad275d3dea8/ changeset: 6ad275d3dea8 user: fbacall date: 2012-03-28 13:40:47 summary: Added ability to auth with myExperiment using a cookie. Improved some error messages affected #: 1 file diff -r 822594759b1413101bb6e72b04e928570222bdbb -r 6ad275d3dea8dc55bfe4df8af5a3709590a04924 lib/galaxy/web/controllers/workflow.py --- a/lib/galaxy/web/controllers/workflow.py +++ b/lib/galaxy/web/controllers/workflow.py @@ -980,11 +980,15 @@ return trans.fill_template( "/workflow/export.mako", item=stored, use_panels=True ) @web.expose @web.require_login( "use workflows" ) - def import_from_myexp( self, trans, myexp_id, myexp_username=None, myexp_password=None ): + def import_from_myexp( self, trans, myexp_id, **kwd ): """ Imports a workflow from the myExperiment website. + Authenticates either by using HTTP basic, or with a cookie. """ - # Get workflow XML. + # Parse parameters + myexp_username = kwd.get( 'myexp_username', None ) + myexp_password = kwd.get( 'myexp_password', None ) + myexp_cookie = kwd.get( 'myexp_cookie', None ) # Get workflow content. conn = httplib.HTTPConnection( trans.app.config.get( "myexperiment_url", self.__myexp_url ) ) # NOTE: blocks web thread. @@ -992,28 +996,36 @@ if myexp_username and myexp_password: auth_header = base64.b64encode( '%s:%s' % ( myexp_username, myexp_password )) headers = { "Authorization" : "Basic %s" % auth_header } + elif myexp_cookie: + headers = { "Cookie" : "myexperiment_session=%s" % myexp_cookie } conn.request( "GET", "/workflow.xml?id=%s&elements=content" % myexp_id, headers=headers ) response = conn.getresponse() - workflow_xml = response.read() + response_data = response.read() conn.close() - parser = SingleTagContentsParser( "content" ) - parser.feed( workflow_xml ) - workflow_content = base64.b64decode( parser.tag_content ) - # Process workflow JSON and create workflow. - workflow_dict = from_json_string( workflow_content ) - # Create workflow. - workflow, missing_tool_tups = self._workflow_from_dict( trans, workflow_dict, source="myExperiment" ).latest_workflow - if missing_tool_tups: - # TODO: handle the case where the imported workflow requires tools that are not available in - # the local Galaxy instance. - pass + if response.status == 200: + parser = SingleTagContentsParser( "content" ) + parser.feed( response_data ) + workflow_content = base64.b64decode( parser.tag_content ) + # Process workflow JSON and create workflow. + workflow_dict = from_json_string( workflow_content ) + # Create workflow. + workflow, missing_tool_tups = self._workflow_from_dict( trans, workflow_dict, source="myExperiment" ) + workflow = workflow.latest_workflow + if missing_tool_tups: + # TODO: handle the case where the imported workflow requires tools that are not available in + # the local Galaxy instance. + pass + # Provide user feedback. + workflow_list_str = " <br>Return to <a href='%s'>workflow list." % url_for( action='list' ) + if response.status != 200: + return trans.show_error_message( "There was a problem importing the workflow. Error: %s %s" % (response_data, workflow_list_str) ) if workflow.has_errors: - return trans.show_warn_message( "Imported, but some steps in this workflow have validation errors" ) + return trans.show_warn_message( "Imported, but some steps in this workflow have validation errors. %s" % workflow_list_str ) if workflow.has_cycles: - return trans.show_warn_message( "Imported, but this workflow contains cycles" ) + return trans.show_warn_message( "Imported, but this workflow contains cycles. %s" % workflow_list_str ) else: - return trans.show_message( "Workflow '%s' imported" % workflow.name ) + return trans.show_message( "Workflow '%s' imported. %s" % (workflow.name, workflow_list_str) ) @web.expose @web.require_login( "use workflows" ) def export_to_myexp( self, trans, id, myexp_username, myexp_password ): @@ -1050,7 +1062,8 @@ # Do request and get result. auth_header = base64.b64encode( '%s:%s' % ( myexp_username, myexp_password )) headers = { "Content-type": "text/xml", "Accept": "text/xml", "Authorization" : "Basic %s" % auth_header } - conn = httplib.HTTPConnection( trans.app.config.get( "myexperiment_url", self.__myexp_url ) ) + myexp_url = trans.app.config.get( "myexperiment_url", self.__myexp_url ) + conn = httplib.HTTPConnection( myexp_url ) # NOTE: blocks web thread. conn.request("POST", "/workflow.xml", request, headers) response = conn.getresponse() @@ -1064,12 +1077,13 @@ workflow_list_str = " <br>Return to <a href='%s'>workflow list." % url_for( action='list' ) if myexp_workflow_id: return trans.show_message( \ - "Workflow '%s' successfully exported to myExperiment. %s" % \ - ( stored.name, workflow_list_str ), + """Workflow '%s' successfully exported to myExperiment. <br/> + <a href="http://%s/workflows/%s">Click here to view the workflow on myExperiment</a> %s + """ % ( stored.name, myexp_url, myexp_workflow_id, workflow_list_str ), use_panels=True ) else: return trans.show_error_message( \ - "Workflow '%s' could not be exported to myExperiment. Error: %s. %s" % \ + "Workflow '%s' could not be exported to myExperiment. Error: %s %s" % \ ( stored.name, response_data, workflow_list_str ), use_panels=True ) @web.json_pretty https://bitbucket.org/galaxy/galaxy-central/changeset/1187e46dfbdf/ changeset: 1187e46dfbdf user: fbacall date: 2012-03-28 14:15:05 summary: Decided to post actual workflow across to avoid security issues# affected #: 1 file diff -r 6ad275d3dea8dc55bfe4df8af5a3709590a04924 -r 1187e46dfbdfea72208abd5a9129ed3dce66fafa lib/galaxy/web/controllers/workflow.py --- a/lib/galaxy/web/controllers/workflow.py +++ b/lib/galaxy/web/controllers/workflow.py @@ -984,6 +984,7 @@ """ Imports a workflow from the myExperiment website. Authenticates either by using HTTP basic, or with a cookie. + !!! This isn't currently used. MyExperiment uses the generic import_workflow method !!! """ # Parse parameters myexp_username = kwd.get( 'myexp_username', None ) https://bitbucket.org/galaxy/galaxy-central/changeset/1744124f8ee4/ changeset: 1744124f8ee4 user: jgoecks date: 2012-05-10 22:27:33 summary: Merged in fbacall/galaxy-central-myexp-integration (pull request #45) affected #: 294 files Diff too large to display. 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.