I need the base_url and the proxy. That is why I am using cookie_path. Any 
thoughts on how to get both.

Thanks,

Ilya


-----Original Message-----
From: Greg Von Kuster [mailto:g...@bx.psu.edu] 
Sent: Friday, October 21, 2011 6:11 AM
To: Chorny, Ilya
Cc: galaxy-dev@lists.bx.psu.edu
Subject: Re: [galaxy-dev] FW: how do I pass the URL of the input and output 
files to my tool wrapper?

Ilya, you can use trans.request.host to get the base url.


On Oct 20, 2011, at 11:52 AM, Chorny, Ilya wrote:

> I thought I would add this to the list in case anyone in the galaxy :) knew 
> the answer. I get a mapping error every time I invoke  url_for. What variable 
> stores the base url for the galaxy instance?
> 
> Thanks,
> 
> Ilya
> 
> -----Original Message-----
> From: Chorny, Ilya
> Sent: Wednesday, October 19, 2011 4:21 PM
> To: 'James Taylor'
> Subject: RE: [galaxy-dev] how do I pass the URL of the input and output files 
> to my tool wrapper?
> 
> Hi James,
> 
> I got the code working but I can't figure out how to set the URL. I have a 
> hack right now (i.e. url = 'http://' + socket.getfqdn() + 
> config_info.cookie_path + '/datasets/' + sec.encode_id(dataset.id) + 
> '/display/?preview=True' ).  I tried using url_for() but was unable to get 
> that to work. Attached are the diff's for the files I made changes to.
> 
> If you have any suggestions on how to properly set the url please let me know.
> 
> Thanks,
> 
> Ilya
> 
> 
> -----Original Message-----
> From: James Taylor [mailto:ja...@jamestaylor.org]
> Sent: Tuesday, October 18, 2011 11:38 AM
> To: Chorny, Ilya
> Subject: RE: [galaxy-dev] how do I pass the URL of the input and output files 
> to my tool wrapper?
> 
> Hi Ilya, I think any case where $__app__ is used should raise red flags, it 
> is definitely breaking abstraction. In this case, you're passing a very 
> specific implementation detail of the web layer all the way down to your tool.
> 
> I think the right way to do what you want is to add a 'web_display_url'
> attribute to the class DatasetFilenameWrapper in tools/__init__.py.
> Every dataset gets wrapped by this when put into the namespace for building 
> command lines. If you added an attribute it would them be available as 
> ${input.web_display_url} in the command line template. 
> 
> Historically tool wrappers were designed so that they have no knowledge of 
> the UI, allowing non-web UIs to be added on top. At this point it seems 
> unlikely that this will ever happen, but it is still a good idea to avoid 
> this kind of coupling. Otherwise we can't change how the web interface does 
> security without changing individual tools.
> 
> Excerpts from Chorny, Ilya's message of 2011-10-17 22:56:40 +0000:
>> So we came up with a work around and I wouldn't mind getting your opinion on 
>> it. Specifically with respect to passing cookie_path. I could not figure out 
>> how to get the proxy prefix from the universe_wsgi.ini file via the $__app__ 
>> call. Also you mention in the wiki the the $__app__ may get deprecated.
>> 
>> Thanks,
>> 
>> Ilya
>> 
>> 
>> We copied the encryption code (i.e)
>> 
>> def encode_id(dataset_id,id_secret):
>>    id_cipher = Blowfish.new(id_secret)
>>    s = dataset_id
>>    s = ( "!" * ( 8 - len(s) % 8 ) ) + s
>>    encrypted_id = id_cipher.encrypt( s ).encode( 'hex' )
>>    return encrypted_id
>> 
>> and we passed to the too wrapperl:
>> 
>> -i input -i $input.dataset.id
>> 
>> as well as
>> 
>> --id_secret=$__app__.config.id_secret
>> --cookie_path=$__app__.config.cookie_path
>> 
>> -----Original Message-----
>> From: Chorny, Ilya
>> Sent: Monday, October 17, 2011 11:10 AM
>> To: Chorny, Ilya; James Taylor
>> Cc: galaxy-dev
>> Subject: RE: [galaxy-dev] how do I pass the URL of the input and output 
>> files to my tool wrapper?
>> 
>> Would it be difficult to add the url as an attribute of the input and output 
>> parameters ($param.url)? If you point me to where these values are set, I 
>> can try to make the changes to the code.
>> 
>> Thanks,
>> 
>> Ilya
>> 
>> 
>> -----Original Message-----
>> From: galaxy-dev-boun...@lists.bx.psu.edu
>> [mailto:galaxy-dev-boun...@lists.bx.psu.edu] On Behalf Of Chorny, 
>> Ilya
>> Sent: Sunday, October 16, 2011 7:36 AM
>> To: James Taylor
>> Cc: galaxy-dev
>> Subject: Re: [galaxy-dev] how do I pass the URL of the input and output 
>> files to my tool wrapper?
>> 
>> PDF report.
>> 
>> Sent from my iPhone
>> 
>> On Oct 15, 2011, at 7:36 PM, "James Taylor" <ja...@jamestaylor.org> wrote:
>> 
>>> Excerpts from Chorny, Ilya's message of 2011-10-14 23:46:25 +0000:
>>>> Anyone know if it possible to pass the url (shown in the eye ball) to a 
>>>> tool wrapper?
>>> 
>>> Ilya, this isn't currently supported because it breaks the 
>>> abstraction between the web interface and tools (tools shouldn't 
>>> know they are being invoked by a web application). What are you trying to 
>>> achieve with this?
>>> Is this for a tool generating an HTML report? 
>>> --
>>> James Taylor, Assistant Professor, Biology / Computer Science, Emory 
>>> University 
>>> ___________________________________________________________
>>> Please keep all replies on the list by using "reply all"
>>> in your mail client.  To manage your subscriptions to this and other 
>>> Galaxy lists, please use the interface at:
>>> 
>>> http://lists.bx.psu.edu/
>> 
>> ___________________________________________________________
>> Please keep all replies on the list by using "reply all"
>> in your mail client.  To manage your subscriptions to this and other Galaxy 
>> lists, please use the interface at:
>> 
>>  http://lists.bx.psu.edu/
> --
> James Taylor, Assistant Professor, Biology / Computer Science, Emory 
> University 
> <lib.galaxy.tools.__init__.py.diff><lib.galaxy.tools.actions.__init__.
> py.diff>___________________________________________________________
> Please keep all replies on the list by using "reply all"
> in your mail client.  To manage your subscriptions to this and other 
> Galaxy lists, please use the interface at:
> 
>  http://lists.bx.psu.edu/

Greg Von Kuster
Galaxy Development Team
g...@bx.psu.edu




___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

  http://lists.bx.psu.edu/

Reply via email to